⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 save_small.asp

📁 商城源码程序(上海数字商城整站) 功能列表: 商品管理
💻 ASP
字号:

<!--#include file="conn.asp"-->
<%call time_out()%>
<%
if instr(session("proview"),"s1")=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"))
bigid=trim(request("bigid"))
smallid=trim(request("smallid"))
select case action
case "add"
if trim(request("smallname"))="" then
response.Write "<script language=javascript>alert('类别名称不能为空!');window.location.href='small_product.asp';</script>"
response.end
end if

sql="select * from pro_small"
    set rs=server.CreateObject("adodb.recordset")
	rs.open sql,conn,1,3
	rs.addnew
	rs("bigid")=bigid
	rs("smallname")=triM(request("smallname"))
	rs.update
	rs.close
	set rs=nothing
	response.Redirect("small_product.asp?bigid="&bigid)

'修改
case "edit"
sql="select * from pro_small where smallid="&smallid
    set rs=server.CreateObject("adodb.recordset")
	rs.open sql,conn,1,3
	rs("smallname")=triM(request("smallname"))
	rs.update
	rs.close
	set rs=nothing
	response.redirect "small_product.asp?bigid="&bigid

'删除
case "del"
'判断是否可以删除
sql1="select smallid from product where smallid="&smallid
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='small_product.asp?bigid="&bigid&"';</script>"
response.end
end if
rs.close
set rs=nothing

sql="select * from pro_small where smallid="&smallid
    set rs=server.CreateObject("adodb.recordset")
	rs.open sql,conn,1,3
    rs.delete
	rs.update
	rs.close
	set rs=nothing
	response.redirect "small_product.asp?bigid="&bigid

end select
%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -