📄 guanli-shezhisave.asp
字号:
<%
if Session("ljl_liujinlu")="" or Session("ljl_grad")="" then%>
<script language=vbscript>
MsgBox "错误:非法用户!"
location.href = "login.asp"
</script>
<%end if%>
<!--#include file="bkconn.asp"-->
<%
'获取数据
sname=request.form("name")
sdanwei=request.form("danwei")
sxinghao=request.form("xinghao")
sbeizhu=request.form("beizhu")
n=Year(date())
y=Month(date())
r=Day(date())
s=Hour(time())
f=Minute(time())
m=Second(time())
if len(y)=1 then y="0" & y
if len(r)=1 then r="0" & r
if len(s)=1 then s="0" & s
if len(f)=1 then f="0" & f
if len(m)=1 then m="0" & m
ssj=n & "年" & y & "月" & r & "日" & s & ":" & f & ":" & m
'检验数据合法性
if sname="" or sxinghao="" then
%>
<script language=vbscript>
MsgBox "错误:输入不能有空!"
location.href = "guanli-shezhi.asp"
</script>
<%else
set tablelist=conn.execute("select * from 材料分类 where 材料名称='" &sname &"'")
if not(tablelist.eof and tablelist.bof) then
%>
<script language=vbscript>
MsgBox "错误:数据库中已经存在此产品名称,禁止重复提交,您可以用名称+型号的方法为此材料命名!"
location.href = "guanli-shezhi.asp"
</script>
<%else
'写入记录
conn.execute("insert into 材料分类(材料名称,材料单位,材料型号,录入时间,备注) values('" &sname &"','" &sdanwei &"','" &sxinghao &"','" &ssj &"','" &sbeizhu &"')")
'同时在库存数据库中生成相应记录
conn.execute("insert into 库存(材料名称,单位,规格型号,录入时间,备注) values('" &sname &"','" &sdanwei &"','" &sxinghao &"','" &ssj &"','" &sbeizhu &"')")
%>
<script language=vbscript>
MsgBox "系统提示:提交成功,按此返回!"
location.href = "guanli-shezhi.asp"
</script>
<%end if
conn.close
set conn=nothing
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -