📄 save_enter.asp
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<% response.buffer=true %>
<!--#include file="conn.asp"-->
<!--#include file=function.asp-->
<head>
<title></title>
</head>
<body topmargin=0>
<%
msg=""
if not IsNumeric(request("in_num")) then
msg=msg+"你输入的必须是数字!<br>"
else
if request("in_num")<=0 then
msg=msg+"你输入的数字小于零,无效!<br>"
end if
end if
if not IsNumeric(request("in_price")) then
msg=msg+"你输入的必须是数字!<br>"
else
if request("in_price")<=0 then
msg=msg+"你输入的数字小于零,无效!<br>"
end if
end if
if request("zy")="" then
msg=msg+"描述不能为空!<br>"
end if
if request("zl")="" then
msg=msg+"种类不能为空!<br>"
end if
if request("hs")="" then
msg=msg+"号数不能为空!<br>"
end if
if request("selprovider")=0 then
msg=msg+"供应商不能为空!<br>"
end if
if msg<>"" then
showerror(msg)
end if
session("g_id")=request("selprovider")
sql= "update detail set jz_log=0 where name_id="&session("name_id")&" and c_id="&session("storage")
rs.open sql,conn
sql="select * from detail where name_id="&session("name_id")&" and c_id="&session("storage") &" and left_num>0 order by id"
rs.open sql,conn,3,2
if not rs.eof then
sql="select * from detail"
rs3.open sql,conn,3,2
do while not rs.eof
rs3.addnew
rs3("jz_log")=0
rs3("c_id")=session("storage")
rs3("g_id")=request("selprovider")
rs3("name_id")=session("name_id")
rs3("rq")=date()
rs3("zl")=request("zl")
rs3("hs")=request("hs")
rs3("zy")=request("zy")
rs3("now_num")=rs("now_num")
rs3("now_price")=rs("now_price")
rs3("now_sum")=rs("now_sum")
rs3("left_num")=rs("left_num")
rs3("jz_log")=1
rs3.update
rs("left_num")=0
rs("jz_log")=0
rs.update
rs.movenext
loop
rs3.close
end if
rs.close
sql="select * from detail"
rs.open sql,conn,3,2
rs.addnew
rs("jz_log")=1
rs("c_id")=session("storage")
rs("g_id")=request("selprovider")
rs("name_id")=session("name_id")
rs("rq")=date()
rs("zl")=request("zl")
rs("hs")=request("hs")
rs("zy")=request("zy")
rs("in_num")=request("in_num")
rs("in_price")=request("in_price")
rs("in_sum")=rs("in_num")*rs("in_price")
rs("out_num")=0
rs("out_price")=0
rs("out_sum")=0
rs("now_num")=rs("in_num")
rs("now_price")=rs("in_price")
rs("now_sum")=rs("in_sum")
rs("left_num")=rs("left_num")+rs("in_num")
rs.update
rs.close
update_stock
response.redirect "list.asp?id="&session("name_id")
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -