📄 save_shtype.asp
字号:
<!--#include file="conn.asp"-->
<%call time_out()%>
<%
if instr(session("proview"),"s5")=0 then
response.Write "<script language=javascript>alert('您无权操作!');window.location.href='index.asp';</script>"
response.end
end if%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<%
action=trim(request("action"))
shid=trim(request("shid"))
select case action
case "add"
if trim(request("shtype"))="" then
response.Write "<script language=javascript>alert('类别名称不能为空!');window.location.href='sh_type.asp';</script>"
response.end
end if
sql="select * from shop_songhuo"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
rs("shtype")=triM(request("shtype"))
rs("addmoney")=triM(request("addmoney"))
rs.update
rs.close
set rs=nothing
response.Redirect("sh_type.asp")
'修改
case "edit"
sql="select * from shop_songhuo where shid="&shid
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
rs("shtype")=triM(request("shtype"))
rs("addmoney")=triM(request("addmoney"))
rs.update
rs.close
set rs=nothing
response.Redirect("sh_type.asp")
'删除
case "del"
'判断是否可以删除
sql1="select shid from [order] where shid="&shid
set rs=server.createobject("adodb.recordset")
rs.open sql1,conn,1,1
if not rs.eof then
response.Write "<script language=javascript>alert('订单中有该送货方式信息,不可删除!');window.location.href='sh_type.asp';</script>"
response.end
end if
rs.close
set rs=nothing
sql="select * from shop_songhuo where shid="&shid
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
rs.delete
rs.update
rs.close
set rs=nothing
response.Redirect("sh_type.asp")
end select
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -