?? cull_convert.asp
字號:
<%@ LANGUAGE="VBSCRIPT" %>
<%
response.buffer=true
Response.Expires = 0
Response.CacheControl = "Private"
%>
<%const title="分揀操作"%>
<!-- #include file=../data/username.inc-->
<!-- #include file=../data/connect.asp-->
<!-- #include file=../data/myPrg.asp-->
<html>
<head>
<meta http-equiv="Content-Type"content="text/html; charset=gb_2312-80">
<title><%=title%></title>
<link rel="stylesheet" type="text/css" href="../data/forum.css">
<script language=vbscript>
<!--
Sub datacheck()
if isdate(trim(input1.cull_date.value)) = false then
msgbox "「分揀日期」格式不對!", 64, "請輸入正確的日期!"
document.input1.cull_date.focus()
Exit Sub
End if
if isdate(trim(input1.cull_time.value)) = false then
msgbox "「分揀時間」格式不對!", 64, "請輸入正確的時間格式!"
document.input1.cull_time.focus()
Exit Sub
End if
if trim(input1.elink_odd.value)=empty then
msgbox "「易聯單號」不得為空白!", 64, "請輸入易聯單號 !"
document.input1.elink_odd.focus()
Exit Sub
End if
if trim(input1.fact_weight.value)<> empty then
if isnumeric(trim(input1.fact_weight.value)) = false then
msgbox "「實際重量」必須為數字!", 64, "請輸入實際重量 !"
document.input1.fact_weight.focus()
Exit Sub
end if
End if
if trim(input1.tally_weight.value)<> empty then
if isnumeric(trim(input1.tally_weight.value)) = false then
msgbox "「記費重量」必須為數字!", 64, "請輸入記費重量 !"
document.input1.tally_weight.focus()
Exit Sub
end if
End if
if trim(input1.fact_weight.value)<> empty and trim(input1.tally_weight.value)<> empty then
if clng(trim(input1.fact_weight.value)) > clng(trim(input1.tally_weight.value)) then
msgbox "「記費重量」必須大于等于「實際重量」!", 64, "請輸入正確的記費重量 !"
document.input1.tally_weight.focus()
Exit Sub
end if
end if
if trim(input1.cull_operate.value)= empty then
msgbox "「分揀操作人」必須選擇!", 64, "請輸入分揀操作人!"
document.input1.cull_operate.focus()
Exit Sub
End if
if trim(input1.transport_no.value) <> empty then
if isnumeric(trim(input1.transport_no.value)) = false then
msgbox "「件數」必須為數字!", 64, "請輸入件數!"
document.input1.transport_no.focus()
Exit Sub
end if
End if
input1.Submit
End Sub
-->
</script>
</head>
<body topmargin="0" onload="javascript:self.moveTo(0,0);document.input1.cull_date.focus();">
<%
if isempty(session("username")) then
call closedatabase
Response.Write "請重新登入!"
Response.End
end if
newcompanyid = request("companyid")
if newcompanyid = "" then
call closedatabase
Response.Write "<script language=javascript>"
Response.Write "alert(""請先選擇公司再做此步操作!"");"
Response.write "history.go(-1);"
Response.Write "</script>"
Response.End
elseif not isnumeric(newcompanyid) then
call closedatabase
Response.Write "<script language=javascript>"
Response.Write "alert(""companyid必須為整數!"");history.go(-1);"
Response.Write "</script>"
Response.End
else
newcompanyid = cint(newcompanyid)
end if
arra = split(session("username"),";")
UserCompanyid = arra(0)
flag = arra(1)
User = arra(2)
userno = arra(4)
outw_id = request("id")
if not isnumeric(outw_id) then
call closedatabase
Response.Write "<script language=javascript>"
Response.Write "alert(""id必須為整數!"");history.go(-1);"
Response.Write "</script>"
Response.End
end if
guest_id = request("guest_id")
if not isnumeric(guest_id) then
call closedatabase
Response.Write "<script language=javascript>"
Response.Write "alert(""guest_id必須為整數!"");history.go(-1);"
Response.Write "</script>"
Response.End
end if
dc_id = request("dc_id")
if not isnumeric(dc_id) then
call closedatabase
Response.Write "<script language=javascript>"
Response.Write "alert(""dc_id必須為整數!"");history.go(-1);"
Response.Write "</script>"
Response.End
end if
dir_flag = request("dir_flag")
if cstr(dir_flag) = "False" or cstr(dir_flag) = "0" then
dir_flag = 0
elseif cstr(dir_flag) = "True" or cstr(dir_flag) = "1" then
dir_flag = 1
else
call closedatabase
Response.End
end if
'Response.Write dir_flag
'Response.End
outw_sra = request("sra")
outw_sra = replace(outw_sra,"'","’")
detail_id = request("detail_id")
detail_id = replace(detail_id,"'","’")
if Request.ServerVariables("REQUEST_METHOD")="POST" then
'發運日期
cull_date = trim(request("cull_date"))
cull_date = replace(cull_date,":",":")
'發運時間
cull_time = trim(request("cull_time"))
cull_time = replace(cull_time,":",":")
cull_datetime = cull_date&" "&cull_time
if isdate(cull_datetime) = false then
call closedatabase
Response.Write "<script language=javascript>"
Response.Write "alert(""發運時間格式不正確,請按規定的格式填寫!!!"");"
Response.Write "history.go(-1);"
Response.Write "</script>"
Response.End
end if
'易聯單號
elink_odd = trim(request("elink_odd"))
elink_odd = replace(elink_odd,"'","’")
'運輸件數
transport_no = trim(request("transport_no"))
if transport_no = "" then transport_no = 0
'實際重量
fact_weight = trim(request("fact_weight"))
if fact_weight = "" then fact_weight = 0
'記費重量
tally_weight = trim(request("tally_weight"))
if tally_weight = "" then tally_weight = 0
'分揀操作人
cull_operate = trim(Request("cull_operate"))
cull_operate = replace(cull_operate,"'","’")
'分揀備注
cull_beizu = trim(request("cull_beizu"))
if cull_beizu = "" then
cull_beizu= " "
else
cull_beizu = replace(cull_beizu,"'","’")
end if
'分運單號
transport_fenyun = trim(Request("transport_fenyun"))
transport_fenyun = replace(transport_fenyun,"'","’")
if transport_fenyun <> "" then
sp = split(transport_fenyun,"/")
high = ubound(sp)+1
end if
if transport_no <> "" and transport_fenyun <> "" then
Response.Write "<br>"
for i = 0 to ubound(sp)
if trim(sp(i)) = "" then
call closedatabase
Response.Write "<center>第" & i+1 &"個分運單不對,您的輸入格式可能錯了</center>"
Response.Write "<center>請<a href='#' onclick=history.go(-1)><font color=blue size=3>返回</font></a>檢查分運單!</center>"
Response.End
end if
next
end if
if transport_fenyun <> "" then
if (transport_no <> "") and (transport_fenyun <> "") and (clng(transport_no) <> clng(high)) then
call closedatabase
Response.Write "<br>"
Response.Write "<center>分運單個數不對!</center>"
Response.Write "<center>請<a href='#' onclick=history.go(-1)><font color=blue size=3>返回</font></a>檢查分運單!</center>"
Response.End
end if
end if
'--------------------------------------
'2003-1-27修改
'檢驗該客戶是否已經被分揀,防止被多次分揀
sql = "select * from outward_detail where detail_outw_id = "&outw_id&" and detail_guest_id = "&guest_id&" and detail_elink_id = 0"
set rs_detail = conn.execute(sql)
if rs_detail.eof then
rs_detail.close
set rs_detail = nothing
call closedatabase
Response.Write "<script language=javascript>"
Response.write "alert(""該客戶分揀操作在此之前已經完成!請確認?。?!"");opener.location.reload();"
Response.Write "window.close();</script>"
Response.End
else
rs_detail.close
set rs_detail = nothing
end if
'--------------------------------------
sql = "select * from outward_elink where elink_odd = '"&elink_odd&"' and elink_companyid = "&newcompanyid&""
set rs_elink = conn.execute(sql)
if rs_elink.eof then
'Response.Write "outw_id "&outw_id&"<br>"
'Response.Write "guest_id "&guest_id&"<br>"
'Response.Write "elink_odd "&elink_odd&"<br>"
'Response.Write "cull_datetime "&cull_datetime&"<br>"
'Response.Write "transport_no "&transport_no &"<br>"
'Response.Write "fact_weight " &fact_weight &"<br>"
'Response.Write "tally_weight " &tally_weight &"<br>"
'Response.Write "cull_operate "&cull_operate &"<br>"
'Response.Write "newcompanyid " &newcompanyid&"<br>"
'Response.Write "user " &user&"<br>"
'Response.End
set cmd=server.CreateObject("ADODB.Command")
cmd.ActiveConnection = conn
cmd.CommandType = 4
cmd.CommandText = "Cull_Convert"
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -