<%
if Action="Show" then
call ShowOrderForm()
elseif Action="Del" then
call DelOrderForm()
else
call main()
end if
if FoundErr=True then
call WriteErrMsg()
end if
call CloseConn()
sub main()
sql="select * from OrderForm order by OrderFormID desc"
Set rsOrderForm= Server.CreateObject("ADODB.Recordset")
rsOrderForm.open sql,conn,1,1
if rsOrderForm.eof and rsOrderForm.bof then
totalPut=0
if Child=0 then
response.write "
没有任何文章!
"
else
response.write "
此栏目的下一级子栏目中没有任何文章!
"
end if
else
totalPut=rsOrderForm.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage strFileName,totalput,MaxPerPage,true,true,"篇文章"
else
if (currentPage-1)*MaxPerPage
<%
end sub
sub ShowOrderForm()
dim OrderFormID
OrderFormID=trim(request("OrderFormID"))
if OrderFormID="" then
FoundErr=true
ErrMsg=ErrMsg & "
请指定订单ID
"
exit sub
else
OrderFormID=Clng(OrderFormID)
end if
sql="select * from OrderForm where OrderFormID=" & OrderFormID
Set rsOrderForm= Server.CreateObject("ADODB.Recordset")
rsOrderForm.open sql,conn,1,1
if rsOrderForm.eof and rsOrderForm.bof then
FoundErr=True
ErrMsg=ErrMsg & "
找不到指定的订单!
"
rsOrderForm.close
set rsOrderForm=nothing
exit sub
end if
%>
<%
rsOrderForm.close
set rsOrderForm=nothing
end sub
%>
<%
sub DelOrderForm()
dim OrderFormID,i
OrderFormID=trim(Request("OrderFormID"))
if OrderFormID="" then
FoundErr=True
ErrMsg=ErrMsg & "
请指定订单ID
"
Exit sub
end if
if instr(OrderFormID,",")>0 then
dim idarr
idArr=split(OrderFormID)
for i = 0 to ubound(idArr)
conn.execute "delete from OrderForm where OrderFormID=" & Clng(idArr(i))
conn.execute "delete from OrderForm_Item where OrderFormID=" & Clng(idArr(i))
next
else
conn.execute "delete from OrderForm where OrderFormID=" & Clng(OrderFormID)
conn.execute "delete from OrderForm_Item where OrderFormID=" & Clng(OrderFormID)
end if
call CloseConn()
response.redirect "Admin_OrderForm.asp"
end sub
%>