FunCode="F999"
session("title")="菜单管理"
session("headline")="首页 -> 注册系统 -> 菜单管理"
%>
ID=request("ID")
if ID="" then
session("mesg")="产品种类的ID不能为空"
Response.Redirect "../result.asp"
end if
'if request("menuAction") = "del" then
' conn.execute ("delete from menu where id='"&request("MenuID")&"'")
'end if
menuAction = request("menuAction")
select case menuAction
case "del"
conn.execute ("delete from menu where id='"&request("MenuID")&"'")
call List()
case "add_pre"
call Add_Pre()
case "add"
call Add()
call List()
case "edit_pre"
call Edit_Pre()
case "edit"
call Edit()
call List()
case else
call List()
end select
sub Edit
ID=request("ID")
newID = request("newID")
MenuID=request("MenuID")
strMenu=request("menu")
strURL=request("strURL")
listID=request("ListID")
status=request("status")
if MenuID="" or ID="" or newID="" or listID="" or strMenu="" or strURL="" or status="" then
session("mesg")="输入域都不能为空"
Response.Redirect "../result.asp"
end if
'需要增加字段校验信息
set rs=server.createobject("adodb.recordset")
sql="select * from menu where ID='"&MenuID&"'"
rs.open sql,conn,1,3
if rs.eof then
session("mesg")="该ID的产品不存在"
Response.Redirect "../result.asp"
end if
rs("class")=newID
rs("listID")=listID
rs("Menu")=strMenu
rs("URL")=strURL
rs("status")=status
classID=rs("class")
rs.update
rs.close
set rs=nothing
end sub
sub Edit_Pre()
call Check()
set rs=server.createobject("adodb.recordset")
sql="select * from menu where ID='"&request("MenuID")&"'"
rs.open sql,conn,1,1
if rs.eof then
session("mesg")="该ID的菜单不存在"
Response.Redirect "../result.asp"
end if
%>
cellspacing=0 width=50% class='size09' align='center'>
功能编码*
功能类型*
do while not rsc.eof
if rsc("ID") = ID then
response.write ""&rsc("class")&""
else
response.write ""&rsc("class")&""
end if
rsc.movenext
loop
rsc.close
set rsc=nothing
%>
顺序号*
产品*
URL(处理程序)*
状态*
正常
锁定
锁定表示不开展该项业务
end sub
sub Add()
MenuID=request("MenuID")
strClass=request("ID")
strMenu=request("menu")
strURL=request("strURL")
listID=request("ListID")
status=request("status")
if MenuID="" or strclass="" or listID="" or strMenu="" or strURL="" or status="" then
session("mesg")="输入域都不能为空"
Response.Redirect "../result.asp"
end if
'需要增加字段校验信息
set rs=server.createobject("adodb.recordset")
sql="select * from menu where ID='"&MenuID&"'"
rs.open sql,conn,1,3
if not rs.eof then
rs.close
set rs=nothing
session("mesg")="已经存在编码为["&MenuID&"]的菜单"
session("mesgtype")="mesg"
Response.Redirect "../result.asp"
end if
rs.addnew
rs("ID")=MenuID
rs("class")=strclass
rs("listID")=listID
rs("menu")=strMenu
rs("URL")=strURL
rs("status")=status
rs.update
rs.close
set rs=nothing
end sub
sub Add_Pre()
call Check()
%>
cellspacing=0 width=50% class='size09' align='center'>
功能编码*
显示ID*
菜单*
处理程序(URL)*
状态*
正常锁定锁定表示不开展该项业务
end sub
sub List()
set rs=server.createobject("adodb.recordset")
sql="select * from menu where class='"&ID&"' order by listid"
rs.open sql,conn,1,1
%>
共计 条记录
功能编号排序菜单URL(处理程序)状态删 除修 改
i=1
do while not rs.eof %>
rs.movenext
loop
%>
rs.close
set rs=nothing
conn.close
set conn=nothing
end sub
sub Check()
%>
function check_input()
{
f=document.F1;
if(f.MenuID.value=='')
{
alert('功能代码不能为空');
f.MenuID.focus();
return false;
}
if(f.listID.value=='')
{
alert('排序不能为空');
f.listID.focus();
return false;
}
if(isNaN(f.listID.value))
{
alert('排序只能为数字');
f.listID.focus();
return false;
}
if(f.menu.value=='')
{
alert('菜单名不能为空');
f.menu.focus();
return false;
}
if(f.strURL.value=='')
{
alert("处理程序名不能为空");
f.strURL.focus();
return false;
}
}
//-->
End sub
%>