Dim DispNextClass
DispNextClass=CheckStr(Trim(Request.QueryString("next")))
if not isNum(DispNextClass) then DispNextClass=0
Dim AddClassB_BR
AddClassB_BR=Request.Form("AddClass")
If AddClassB_BR="AddClass" then
Dim ClassNameBB_R,ClassIDB_B_R
ClassNameBB_R=CheckStr(Trim(Request.Form("ClassNameBBR")))
ClassIDB_B_R=Request.Form("ClassIDBBR")
if Not isNum(ClassIDB_B_R) then Call ALertInfo("对不起,商品分类的所属分类ID有误!请返回!","CnbbrClass_Add.asp",1)
Dim RsClass
sql="select max(orderid) as m from aucclass where upid="& ClassIDB_B_R
set RsClass=server.createobject("ADODB.recordset")
RsClass.open sql,conn,1,1
k=RsClass("m")
if k="" or isNull(k) then
k=1
else
k=k+1
end if
RsClass.Close
Set RsClass=Nothing
Sql="Select * From AucClass Where ClassID is Null"
Set Rs=Server.CreateObject("ADODB.RecordSet")
Rs.Open Sql,conn,1,3
Rs.AddNew
Rs("ClassName")=ClassNameBB_R
Rs("UpID")=ClassIDB_B_R
Rs("orderID")=k
Rs("AucAmount")=0
Rs.Update
Call AlertInfo("商品分类添加成功!","CnbbrClass_Add.asp",1)
End if
With ReSponse
.Write "" & Vbcrlf
.Write "" & Vbcrlf
.Write "" & Vbcrlf
.Write " " & Vbcrlf
.Write " 商品分类管理页 ( 现只支持四级分类 )" & Vbcrlf
.Write " " & Vbcrlf
.Write " " & Vbcrlf
.Write " " & Vbcrlf
Sql="Select * From AucClass Where UpId=0 order by orderid"
Set Rs=Server.CreateObject("ADODB.RecordSet")
Rs.Open Sql,conn,1,1
If Rs.Eof then
.Write "还没有商品分类,请先添加分类!" & Vbcrlf
Else
Do While Not Rs.Eof
.Write "" & Vbcrlf
.Write " " & vbcrlf
.Write " + "& Rs("ClassName") &"" & Vbcrlf
.Write " 添加分类 | 管理分类 | 删除分类 | 向上 | 向下" & Vbcrlf
.Write " " & Vbcrlf
if Clng(DispNextClass)=Clng(Rs("ClassID")) then Call RsNextClass(Rs("ClassID"),1)
.Write "" & Vbcrlf
Rs.MoveNext
Loop
End if
.Write " " & Vbcrlf
.Write " " & Vbcrlf
.Write " " & Vbcrlf
.Write " " & Vbcrlf
.Write " " & Vbcrlf
.Write "" & Vbcrlf
.Write "" & Vbcrlf
End With
Function RsNextClass(UpClassID,CurrentDeep)
if Response.IsClientConnected=0 then Exit Function
Dim RsNextClassBBR
Sql="Select ClassName,ClassId From AucClass Where UpID="& UpClassID &" order by orderid"
Set RsNextClassBBR=Server.CreateObject("ADODB.ReCordSet")
RsNextClassBBR.Open Sql,Conn,1,1
If Not RsNextClassBBR.Eof then
Do While Not RsNextClassBBR.Eof
Response.Write " " & vbcrlf
Response.Write " "& Print_Space(CurrentDeep*2) &"┠ "& RsNextClassBBR("ClassName") &"" & Vbcrlf
Response.Write " 添加分类 | 管理分类 | 删除分类 | 向上 | 向下" & Vbcrlf
Response.Write " " & Vbcrlf
Call RsNextClass(RsNextClassBBR("ClassID"),CurrentDeep+1)
RsNextClassBBR.MoveNext
Loop
End If
RsNextClassBBR.Close
set RsNextClassBBR=Nothing
End Function
%>