📄 cailiaoedit.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"-->
<%
'获取数据
sid=clng(request.querystring("id"))
sguestname=request.form("guestname")
sdw=request.form("dw")
sdj=request.form("dj")
sdw1=request.form("dw1")
if sdw1="" then sdw1="无"
'检验数据合法性
if sguestname="" or sdw="" or sdj="" then%>
<script language=vbscript>
MsgBox "错误:输入不能有空,请重新提交!"
location.href = "guanli-shezhi.asp"
</script>
<%else
'校验修改是否与其他的名称重复
set tablelist=conn.execute("select * from 材料分类 where 材料名称='" &sguestname &"'and id<>"&sid)
if not(tablelist.eof and tablelist.bof) then
%>
<script language=vbscript>
MsgBox "错误:数据库中已经存在此产品名称,禁止重复提交,您可以用名称+型号的方法为此材料命名!"
location.href = "guanli-shezhi.asp"
</script>
<%else
'写入记录
conn.execute("update 材料分类 set 材料名称='"&sguestname&"',材料型号='"&sdw&"',材料单位='"&sdj&"',备注='"&sdw1&"' where id="&sid)
'同时修改库存中的信息
conn.execute("update 库存 set 材料名称='"&sguestname&"',规格型号='"&sdw&"',单位='"&sdj&"',备注='"&sdw1&"' where id="&sid)
%>
<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 + -