<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Function.asp"-->
<%
Call ChkLogin(session("WebAdminsUserName"))
Call ConnectionDataBase(2)
Action = Request("Action")
Select Case Action
	Case "AddCategory"
		Call AddCategory
End Select

Sub AddCategory()
	CateID = Request.Form("CateID")
	BigCategory = Request.Form("BigCategory")
	SubClass = Request.Form("SubCategory")
	SortID = Request.Form("SortID")
	ID = Request.Form("ID")
	Call ChkIsNumber(CateID,"参数类型错误!")
	Call ChkIsNull(SubClass,"请输入分类名称!")
	Call ChkIsNumber(SortID,"参数类型错误!")
	Call ChkIsNumber(ID,"参数类型错误!")
	AllID = ""
	Sql = "SELECT TOP 1 AllID FROM T_Class WHERE ID = " & BigCategory
	SetRs Rs,Sql,conn,1,1
	IF Not Rs.EOF Then AllID = Rs("AllID")
	DisRs Rs
	strSql = "Select * From T_Class Where ID=" & ID	
	SetRs Rs,strSql,conn,1,3
	IF Rs.EOF Then	Rs.Addnew()
	Rs("CateID") = CateID
	Rs("ParentID") = BigCategory	
	Rs("ClassName") = SubClass
	Rs("SortID") = SortID
	Rs("AllID") = AllID & BigCategory & "|"
	Rs.Update
	DisRs Rs
	Call CloseDatabase
	Call Success("信息提交成功!",Request.ServerVariables("HTTP_REFERER"))
End Sub
%>