📄 depot_edit.inc.bak
字号:
<%
'#############################################################################################
'#
'# 文件名 : depot_edit.inc
'# Copyright(c) 2001-2002 上海阿尔卡特网络支援系统有限公司
'#
'# 创建人 : yaoxiaohui
'# 日 期 : 2002-07-19
'#
'# 修改历史 : ****年**月**日 ****** 修改内容:**********************************************
'#
'# 功能描述 : 新增仓库函数文件
'# 版 本 :
'#
'#############################################################################################
Function DepotDetail(sSQL)
dim crs, rs
dim sDepotName, sLocation, sDepotType, sRemark
dim sSd1n, sSd1, sSd2n, sSd2, sSd3n, sSd3, sSd4n, sSd4, sSd5n, sSd5
dim sStartupTime, sDepotKeeper
dim sLink
dim ActionStatus
' if not IsLibraryAdmin() then
' Server.Transfer("../common/error.asp")
' Response.end
' end if
if not IsEmpty(iDepotID) then
set rs = Openrs(conn, sSQL)
if rs.EOF then
Server.Transfer("../common/error.asp")
Response.end
end if
'' 获取任务信息的各种数据
sDepotName = GetValue(rs,"depot_name")
sLocation = GetValue(rs,"location")
sDepotType = GetValue(rs,"depot_type")
sRemark = GetValue(rs,"remark")
sStartupTime = GetValue(rs,"startup_time")
sDepotKeeper = GetValue(rs,"depot_keeper")
sSd1n = GetValue(rs,"sd1n")
sSd1 = GetValue(rs,"sd1")
sSd2n = GetValue(rs,"sd2n")
sSd2 = GetValue(rs,"sd2")
sSd3n = GetValue(rs,"sd3n")
sSd3 = GetValue(rs,"sd3")
sSd4n = GetValue(rs,"sd4n")
sSd4 = GetValue(rs,"sd4")
sSd5n = GetValue(rs,"sd5n")
sSd5 = GetValue(rs,"sd5")
rs.Close()
set rs=nothing
end if
if IsEmpty(iDepotID) then
sLink = _
"<tr bgcolor=white height=20>" & _
" <td colspan=6 align=center>" & _
" <img border=0 src=""../images/button/add.gif"" onclick=""btnAdd_OnClick()"" style=""cursor:hand""> " & _
" <img border=0 src=""../images/button/cancel.gif"" onclick=""btnCancelAdd_OnClick()"" style=""cursor:hand""></td>" & _
"</tr>"
else
if hasright(ID_STOCK) < RIGHT_WRITE then
sLink = _
"<tr bgcolor=white height=20>" & _
" <input type=""hidden"" name=""depot_id"" value=""" & iDepotID & """>" & _
" <td colspan=6 align=center>" & _
" <img border=0 src=""../images/button/back.gif"" onclick=""btnCancel_OnClick()"" style=""cursor:hand""></td>" & _
"</tr>"
else
sLink = _
"<tr bgcolor=white height=20>" & _
" <input type=""hidden"" name=""depot_id"" value=""" & iDepotID & """>" & _
" <td colspan=6 align=center>" & _
" <img border=0 src=""../images/button/update.gif"" onclick=""btnUpdate_OnClick()"" style=""cursor:hand""> " & _
" <img border=0 src=""../images/button/delete.gif"" onclick=""btnDelete_OnClick()"" style=""cursor:hand""> " & _
" <img border=0 src=""../images/button/cancel.gif"" onclick=""btnCancel_OnClick()"" style=""cursor:hand""></td>" & _
"</tr>"
end if
end if
DepotDetail = _
"<table cellspacing=1 cellpadding=0 width=""100%"" border=0 align=center bgcolor=silver>" & _
"<form method=""post"" name=""frmAdd"" action=""depot_edit.asp"">" & _
"<input type=""hidden"" name=""FormAction"">" & _
"<tr height=20 style=""color:white;font-weight:600"">" & _
" <td background=""../images/bg/bnbg.gif"" align=center colspan=8>仓库详细信息</td>" & _
"</tr>" & _
"<tr bgcolor=white height=30>" & _
" <td width=100 align=center colspan=1>仓库名称</td>" & _
" <td width=300 colspan=3><input type=""text"" name=""depot_name"" value=""" & sDepotName & """ size=20 maxlength=20></td>" & _
" <td width=100 align=center colspan=1>仓库类别</td>" & vbLF & _
" <td width=100 align=center colspan=1>" & vbLF & _
" <select name=""depot_type"" style=""width:90"">" & vbLF & _
" <option value="""">全部</option>" & vbLF & _
SelectOptions(conn, "select *from t_goods_type", "type_desc", "type_desc", sDepotType) & vbLF & _
" </select></td>" & vbLF & _
"</tr>" & _
"<tr bgcolor=white height=30>" & _
" <td width=100 align=center colspan=1>仓库位置</td><td width=100><input type=""text"" name=""Location"" value=""" & sLocation & """ size=12 maxlength=20></td>" & _
" <td width=100 align=center colspan=1>管 理 人</td><td width=100><input type=""text"" name=""depot_keeper"" value=""" & sDepotKeeper & """ size=12 maxlength=20></td>" & _
" <td width=100 align=center colspan=1>启用时间</td><td align=center width=100>"& DrawCal("", sStartupTime, "startup_time", "dateimg") &"</td>" & vbLF & _
"</tr>" & _
"<tr bgcolor=white height=60>" & _
" <td align=center>备 注:</td><td colspan=5><textarea name=""remark"" rows=5 cols=87>" & sRemark & "</textarea></td>" & _
"</tr>" & _
"<tr height=20 style=""color:white;font-weight:600"">" & _
" <td background=""../images/bg/bnbg.gif"" align=center colspan=6>用户自定义字段</td>" & _
"</tr>" & _
"<tr bgcolor=white height=30>" & _
"<td align=center colspan=1>自定义字段名</td>" & _
"<td><input type=""text"" name=""sd1n"" value=""" & sSd1n & """ size=12 maxlength=20></td>" & _
"<td><input type=""text"" name=""sd2n"" value=""" & sSd2n & """ size=12 maxlength=20></td>" & _
"<td><input type=""text"" name=""sd3n"" value=""" & sSd3n & """ size=12 maxlength=20></td>" & _
"<td><input type=""text"" name=""sd4n"" value=""" & sSd4n & """ size=12 maxlength=20></td>" & _
"<td><input type=""text"" name=""sd5n"" value=""" & sSd5n & """ size=12 maxlength=20></td>" & _
"</tr>" & _
"<tr bgcolor=white height=30>" & _
"<td align=center colspan=1>自定义字段取值</td>" & _
"<td><input type=""text"" name=""sd1"" value=""" & sSd1 & """ size=12 maxlength=20></td>" & _
"<td><input type=""text"" name=""sd2"" value=""" & sSd2 & """ size=12 maxlength=20></td>" & _
"<td><input type=""text"" name=""sd3"" value=""" & sSd3 & """ size=12 maxlength=20></td>" & _
"<td><input type=""text"" name=""sd4"" value=""" & sSd4 & """ size=12 maxlength=20></td>" & _
"<td><input type=""text"" name=""sd5"" value=""" & sSd5 & """ size=12 maxlength=20></td>" & _
"</tr>" & _
sLink & _
"</td></tr></form></table>" & _
"<br>"
End Function
Function AddDepot()
dim strSQL
dim sDepotName : sDepotName = GetParam("depot_name")
dim sLocation : sLocation = GetParam("Location")
dim sDepotType : sDepotType = GetParam("depot_type")
dim sRemark : sRemark = GetParam("remark")
dim sStartupTime : sStartupTime = GetParam("startup_time")
dim sDepotKeeper : sDepotKeeper = GetParam("depot_keeper")
dim sSd1n : sSd1n = GetParam("sd1n")
dim sSd1 : sSd1 = GetParam("sd1")
dim sSd2n : sSd2n = GetParam("sd2n")
dim sSd2 : sSd2 = GetParam("sd2")
dim sSd3n : sSd3n = GetParam("sd3n")
dim sSd3 : sSd3 = GetParam("sd3")
dim sSd4n : sSd4n = GetParam("sd4n")
dim sSd4 : sSd4 = GetParam("sd4")
dim sSd5n : sSd5n = GetParam("sd5n")
dim sSd5 : sSd5 = GetParam("sd5")
strSQL = "insert into T_depot(depot_name, location, startup_time, depot_keeper, depot_type, remark, sd1n, sd1, sd2n, sd2, sd3n, sd3, sd4n, sd4, sd5n, sd5)" & _
" values(" & ToSQL(sDepotName, "Text") & ", " & ToSQL(sLocation, "Text") & ", " & ToSQL(sStartupTime,"Text") & ", " & ToSQL(sDepotKeeper,"Text") & ", " & _
ToSQL(sDepotType, "Text") & ", " & ToSQL(sRemark, "Text") & ", " & _
ToSQL(sSd1n, "Text") & ", " & ToSQL(sSd1, "Text") & ", " & _
ToSQL(sSd2n, "Text") & ", " & ToSQL(sSd2, "Text") & ", " & _
ToSQL(sSd3n, "Text") & ", " & ToSQL(sSd3, "Text") & ", " & _
ToSQL(sSd4n, "Text") & ", " & ToSQL(sSd4, "Text") & ", " & _
ToSQL(sSd5n, "Text") & ", " & ToSQL(sSd5, "Text") & ")"
call Openrs(conn, strSQL)
iDepotID = DLookUp(conn, "select max(depot_id) from t_depot")
Response.Redirect "Depot_edit.asp?depot_id=" & iDepotID & "&"
Response.end
End Function
Function UpdateDepot()
dim strSQL
dim sDepotName : sDepotName = GetParam("depot_name")
dim sLocation : sLocation = GetParam("location")
dim sDepotType : sDepotType = GetParam("depot_type")
dim sRemark : sRemark = GetParam("remark")
dim sStartupTime : sStartupTime = GetParam("startup_time")
dim sDepotKeeper : sDepotKeeper = GetParam("depot_keeper")
dim sSd1n : sSd1n = GetParam("sd1n")
dim sSd1 : sSd1 = GetParam("sd1")
dim sSd2n : sSd2n = GetParam("sd2n")
dim sSd2 : sSd2 = GetParam("sd2")
dim sSd3n : sSd3n = GetParam("sd3n")
dim sSd3 : sSd3 = GetParam("sd3")
dim sSd4n : sSd4n = GetParam("sd4n")
dim sSd4 : sSd4 = GetParam("sd4")
dim sSd5n : sSd5n = GetParam("sd5n")
dim sSd5 : sSd5 = GetParam("sd5")
strSQL = "update T_Depot" & _
" set Depot_Name = " & ToSQL(sDepotName, "Text") & _
", location = " & ToSQL(sLocation, "Text") & _
", depot_type = " & ToSQL(sDepotType, "Text") & _
", startup_time = " & ToSQL(sStartupTime, "Text") & _
", depot_keeper = " & ToSQL(sDepotKeeper, "Text") & _
", remark = " & ToSQL(sRemark, "Text") & _
", sd1n = " & ToSQL(sSd1n, "Text") & _
", sd1 = " & ToSQL(sSd1, "Text") & _
", sd2n = " & ToSQL(sSd2n, "Text") & _
", sd2 = " & ToSQL(sSd2, "Text") & _
", sd3n = " & ToSQL(sSd3n, "Text") & _
", sd3 = " & ToSQL(sSd3, "Text") & _
", sd4n = " & ToSQL(sSd4n, "Text") & _
", sd4 = " & ToSQL(sSd4, "Text") & _
", sd5n = " & ToSQL(sSd5n, "Text") & _
", sd5 = " & ToSQL(sSd5, "Text") & _
" where Depot_ID = " & iDepotID
call Openrs(conn, strSQL)
Response.Redirect "Depot_edit.asp?depot_id=" & iDepotID & "&"
Response.end
End Function
sub DeleteDepot()
dim sSQL, iRows
'' 检查是否存在使用中的类别名称
iRows = DLookUp(conn, "select count(*) from t_goods where depot_id =" & ToSQL(iDepotID, "Number"))
if iRows > 0 then
Response.Write _
"<script language=""javascript"">" & vbLF & _
" alert(""对不起,仓库中有存货,该仓库不能删除!"");" & vbLF & _
"</script>" & vbLF
exit sub
end if
sSQL = "delete from t_depot where depot_id = " & ToSQL(iDepotID, "Number")
call Openrs(conn,sSQL)
iDepotID = empty '' 重新置成新增状态
response.redirect "depot_list.asp"
End sub
Function TableLink()
TableLink = _
"<table width=600 cellspacing=0 cellpadding=0 border=0 align=center>" & _
"<tr height=10>" & _
" <td width=600><img src=""../images/bg/line.gif"" width=600 height=3></td>" & _
"</tr>" & _
"<tr height=20>" & _
" <td width=600> " & _
" <img src=""../images/goto.gif""> <a href=""depot_list.asp"">仓库列表</a> "
TableLink = TableLink & _
" <img src=""../images/goto.gif""> <a href=""goods_query.asp"">库存查询</a></td></tr>" & _
"</table>"
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -