📄 wm.skin_label_sort.asp
字号:
Rs.Close
WM_Taxis = 1
WM_ParentPath = 0
WM_Depth = 0
End If
Rs.Open"Select WM_ID From WM_LabelSort Where WM_Name='"&WM_Name&"' and WM_SkinDir = '"&WR_Setting(5)&"'"&TypeSql,Conn,1,1
If Not Rs.Eof Then
Call WRMPS.ErrView("·此分类已经存在,请重新输入", 0)
End If
Rs.CLose
Conn.Execute ("insert into WM_LabelSort(WM_ClassID,WM_Taxis,WM_ParentID,WM_Name,WM_ParentPath,WM_Depth,WM_Child,WM_Type,WM_SkinDir) Values(" & WM_ClassID & "," & WM_Taxis & "," & WM_ParentID & ",'" & WM_Name & "','" & WM_ParentPath & "'," & WM_Depth & ",0,"&eType&",'"&WR_Setting(5)&"')")
If WM_ParentID > 0 Then
Conn.Execute ("update WM_LabelSort set WM_Child=WM_Child+1 Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_ID=" & WM_ParentID&TypeSql)
Rs.Open "Select * From WM_LabelSort Where WM_SkinDir = '"&WR_Setting(5)&"'" & TypeSql & " Order By WM_ID Desc", Conn, 1, 1
Conn.Execute ("update WM_LabelSort set WM_Taxis=WM_Taxis+1 Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_ClassID=" & WM_ClassID & TypeSql &" and WM_Taxis>=" & WM_Taxis & " and WM_ID<>" & Rs("WM_ID") & "")
Rs.Close
End If
If WM_ParentID <> "" Then
Response.Redirect "?Action=Add&eID="&eID&"&WM_ID=" & WM_ParentID & "&eType="&eType
Else
Response.Redirect "?Action=Add&eID="&eID&"&WM_ID=" & WM_ID & "&eType="&eType
End If
Case "ClassEditSave" '修改保存
WM_Name = WRMPS.CheckStr(Request.Form("WM_Name"), 0)
OLDName = WRMPS.CheckStr(Request.Form("OLDName"), 0)
If WM_Name = "" Then Call WRMPS.ErrView("·请输入分类名称", 0): Exit Sub
Rs.Open"Select WM_ID From WM_LabelSort Where WM_Name='"&WM_Name&"' and WM_SkinDir = '"&WR_Setting(5)&"'"&TypeSql&" and WM_ID<>" & WM_ID,Conn,1,1
If Not Rs.Eof Then
Call WRMPS.ErrView("·此分类已经存在,请重新输入", 0)
End If
Rs.CLose
Conn.Execute ("Update WM_LabelSort Set WM_Name= '" & WM_Name & "' Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_ID=" & WM_ID&TypeSql)
Conn.Execute ("Update WM_Label Set WM_Sort= '" & WM_Name & "' Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_Sort = '"&OLDName&"'"&TypeSql)
Response.Redirect "?Action=View&eID="&eID&"&eType=" & eType
Case "Del" '删除
'得到要移动分类相关
If WRMPS.CheckStr(Request("Coalition"), 0) <> "" Then
ClassID = WRMPS.CheckStr(Request("ClassID"), 1)
WM_ClassID = WRMPS.CheckStr(Request("WM_ClassID"), 1)
If ClassID = "" Or ClassID < 0 Then Call WRMPS.ErrView("·请选择待移动分类", 0): Exit Sub
If WM_ClassID = "" Or WM_ClassID < 0 Then Call WRMPS.ErrView("·请选择目标分类", 0): Exit Sub
If ClassID = WM_ClassID Then Call WRMPS.ErrView("·待移动分类和目标分类不能相同", 0): Exit Sub
Dim NewParentPath
Rs.Open "Select WM_ParentPath From WM_LabelSort Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_ID = " & WM_ClassID&TypeSql, Conn, 1, 1
If Not Rs.EOF Then
NewParentPath = Rs(0)
Else
WM_ClassID = 0
End If
Rs.Close
If Instr(NewParentPath&",",","&ClassID&",") > 0 And WRMPS.CheckStr(Request("Del"), 1) <> "" Then
Call WRMPS.ErrView("·目标分类为待移动分类的下属分类,不能选择“删除被移动的分类及子分类”", 0): Exit Sub
End If
Del = WRMPS.CheckStr(Request("Del"), 1)
If Del = "" Then Del = 0
WM_ID = ClassID
'合并分类
OldName = WRDB.GetClassName("WM_LabelSort",ClassID)
NewName = WRDB.GetClassName("WM_LabelSort",WM_ClassID)
Conn.Execute ("UpDate WM_Label Set WM_Sort = '" & NewName & "' Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_Sort = '"&OldName&"'"&TypeSql)
Else
Del = 1
End If
'删除分类的相关信息
If Del = 1 Then
Rs.Open "Select * From WM_LabelSort Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_ID=" & WM_ID&TypeSql, Conn, 1, 1
If Not Rs.EOF Then
WM_TaxisID = Rs("WM_ClassID")
WM_Taxis = Rs("WM_Taxis")
WM_ParentID = Rs("WM_ParentID")
End If
Rs.Close
'删除下级分类
Rs.Open "Select * From WM_LabelSort Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_ClassID=" & WM_TaxisID & TypeSql &" and WM_ParentPath<>'0'", Conn, 1, 1
Do While Not Rs.EOF
If Instr(Rs("WM_ParentPath")&",",","&WM_ID&",")>0 Then
OldName = WRDB.GetClassName("WM_LabelSort",Rs("WM_ID"))
If WRMPS.CheckStr(Request("Coalition"), 0) <> "" Then
Conn.Execute ("UpDate WM_Label Set WM_Sort = '" & NewName & "' Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_Sort = '"&OldName&"'"&TypeSql)
Else
Conn.Execute ("UpDate WM_Label Set WM_Sort = '未分类' Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_Sort = '"&OldName&"'"&TypeSql)
End If
Conn.Execute ("Delete From WM_LabelSort Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_ID=" & Rs("WM_ID")&TypeSql)
End If
Rs.MoveNext
Loop
Rs.Close
If WM_ParentID > 0 Then
Conn.Execute ("Update WM_LabelSort set WM_Child=WM_Child-1 Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_ID=" & WM_ParentID&TypeSql)
End If
Conn.Execute ("Update WM_LabelSort set WM_Taxis=WM_Taxis-1 Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_ClassID=" & WM_TaxisID & " and WM_Taxis > " & WM_Taxis & TypeSql &"")
If WRMPS.CheckStr(Request("Coalition"), 0) = "" Then
OldName = WRDB.GetClassName("WM_LabelSort",WM_ID)
Conn.Execute ("UpDate WM_Label Set WM_Sort = '未分类' Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_Sort = '"&OldName&"'"&TypeSql)
End If
Conn.Execute ("Delete From WM_LabelSort Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_ID=" & WM_ID&TypeSql)
End If
Response.Redirect "?Action=View&eID="&eID&"&eType=" & eType & ""
Case "Taxis" '排序
Content = Content & "<table width='100%' border=0 align=center cellpadding=5 cellspacing=1 class=td1>" & vbCrLf
Content = Content & " <tr class=td4><td colspan=4><strong>分类排序</strong></td></tr>" & vbCrLf
Rs.Open "Select * From WM_LabelSort Where WM_ID Is Not Null"&TypeSql&" Order By WM_ClassID,WM_Taxis", Conn, 1, 1
If Rs.EOF Then
Content = Content & "<tr class=td2><td align=center colspan=4>还没有任何分类或分类</td></tr>" & vbCrLf
Else
Content = Content & "<tr class=td3 align=center>" & vbCrLf
Content = Content & " <td width='5%'>ID</td>" & vbCrLf
Content = Content & " <td width='35%'>分类名称</td>" & vbCrLf
Content = Content & " <td width='10%' colspan=2>操作</td>" & vbCrLf
Content = Content & " </tr>" & vbCrLf
Rso.Open "Select WM_ID From WM_LabelSort Where WM_SkinDir = '"&WR_Setting(5)&"'"&TypeSql&" Order By WM_ClassID Desc,WM_Taxis Desc", Conn, 1, 1
If Not Rso.Eof Then
WM_ClassBig = Rso(0)
End If
Rso.Close
Rso.Open "Select WM_ClassID From WM_LabelSort Where WM_SkinDir = '"&WR_Setting(5)&"'"&TypeSql&" Order By WM_ClassID", Conn, 1, 1
If Not Rso.Eof Then
WM_ClassSmall = Rso(0)
End If
Rso.Close
Do While Not Rs.EOF
Content = Content & " <tr class=td2 align=center> " & vbCrLf
Content = Content & " <td>" & Rs("WM_ID") & "</td>" & vbCrLf
Content = Content & " <td align=left>" & vbCrLf
If Rs("WM_Depth") > 0 Then
For i = 1 To Rs("WM_Depth")
Content = Content & " "
Next
End If
If Rs("WM_ParentPath") = "0" Then Content = Content & "<b>" & Rs("WM_Name") & "</b>" Else Content = Content & Rs("WM_Name")
If Rs("WM_Child") <> 0 Then Content = Content & " <font class=font3>(" & Rs("WM_Child") & ")</font>"
Content = Content & " </td><td>"
If Rs("WM_ClassID") > Int(WM_ClassSmall) Or Rs("WM_Taxis") > 1 Then
Content = Content & "<a href=?Action=TaxisSave&eID="&eID&"&eType=" & eType & "&WM_ID=" & Rs("WM_ID") & "&Parent=" & Rs("WM_ParentID") & "&Taxis=Up><img src='img/Up.gif' border=0 Title='向上一级'></a>" & vbCrLf
End If
Content = Content & "</td><td>"
If Rs("WM_ID") <> Int(WM_ClassBig) Then
Content = Content & "<a href=?Action=TaxisSave&eID="&eID&"&eType=" & eType & "&WM_ID=" & Rs("WM_ID") & "&Parent=" & Rs("WM_ParentID") & "&Taxis=Down><img border=0 src='img/Down.gif' Title='向下一级'></a>" & vbCrLf
End If
Content = Content & "</td></tr>"
Rs.MoveNext
Loop
End If
Content = Content & "</table>"
Case "TaxisSave" '排序保存
Rs.Open "Select WM_Taxis,WM_ClassID From WM_LabelSort Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_ID=" & WM_ID&TypeSql, Conn, 1, 1
If Not Rs.EOF Then
WM_ClassID = Rs(1)
WM_Taxis = Rs(0)
Select Case Parent
Case 0 '一级分类
Rso.Open "Select WM_ClassID From WM_LabelSort Where WM_SkinDir = '"&WR_Setting(5)&"'"&TypeSql&" Order By WM_ClassID Desc", Conn, 1, 1
If Not Rso.Eof Then
WM_ClassBig = Rso(0)
End If
Rso.Close
Rso.Open "Select WM_ClassID From WM_LabelSort Where WM_SkinDir = '"&WR_Setting(5)&"'"&TypeSql&" Order By WM_ClassID", Conn, 1, 1
If Not Rso.Eof Then
WM_ClassSmall = Rso(0)
End If
Rso.Close
If WRMPS.CheckStr(Request("Taxis"), 0) = "Up" Then
If WM_ClassID <= WM_ClassSmall Then Call WRMPS.ErrView("·此分类已经排在最上面", 0): Exit Sub
Conn.Execute ("Update WM_LabelSort set WM_ClassID=0 Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_ClassID=" & WM_ClassID - 1 & TypeSql)
Conn.Execute ("Update WM_LabelSort set WM_ClassID=WM_ClassID-1 Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_ClassID=" & WM_ClassID & TypeSql)
Conn.Execute ("Update WM_LabelSort set WM_ClassID=" & WM_ClassID & " Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_ClassID=0"&TypeSql)
ElseIf WRMPS.CheckStr(Request("Taxis"), 0) = "Down" Then
If WM_ClassID >= WM_ClassBig Then Call WRMPS.ErrView("·此分类已经排在最下面", 0): Exit Sub
Conn.Execute ("Update WM_LabelSort set WM_ClassID=0 Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_ClassID=" & WM_ClassID + 1 & TypeSql)
Conn.Execute ("Update WM_LabelSort set WM_ClassID=WM_ClassID+1 Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_ClassID=" & WM_ClassID & TypeSql)
Conn.Execute ("Update WM_LabelSort set WM_ClassID=" & WM_ClassID & " Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_ClassID=0"&TypeSql)
End If
Case Else '无限级分类
Rso.Open "Select WM_Taxis From WM_LabelSort Where WM_ParentID=" & Parent &" and WM_SkinDir = '"&WR_Setting(5)&"'"&TypeSql&" Order By WM_ClassID Desc,WM_Taxis Desc", Conn, 1, 1
If Not Rso.Eof Then
WM_ClassBig = Rso(0)
End If
Rso.Close
Rso.Open "Select WM_Taxis From WM_LabelSort Where WM_ParentID=" & Parent &" and WM_SkinDir = '"&WR_Setting(5)&"'"&TypeSql&" Order By WM_ClassID,WM_Taxis", Conn, 1, 1
If Not Rso.Eof Then
WM_ClassSmall = Rso(0)
End If
Rso.Close
If WRMPS.CheckStr(Request("Taxis"), 0) = "Up" Then
If WM_Taxis <= WM_ClassSmall Then Call WRMPS.ErrView("·此分类已经排在最上面", 0): Exit Sub
Conn.Execute ("Update WM_LabelSort set WM_Taxis=0 Where WM_ParentID=" & Parent & " and WM_SkinDir = '"&WR_Setting(5)&"' and WM_Taxis=" & WM_Taxis - 1 & TypeSql)
Conn.Execute ("Update WM_LabelSort set WM_Taxis=WM_Taxis-1 Where WM_ParentID=" & Parent & " and WM_SkinDir = '"&WR_Setting(5)&"' and WM_Taxis=" & WM_Taxis & TypeSql)
Conn.Execute ("Update WM_LabelSort set WM_Taxis=" & WM_Taxis & " Where WM_ParentID=" & Parent & " and WM_SkinDir = '"&WR_Setting(5)&"' and WM_Taxis=0"&TypeSql)
ElseIf WRMPS.CheckStr(Request("Taxis"), 0) = "Down" Then
If WM_Taxis >= WM_ClassBig Then Call WRMPS.ErrView("·此分类已经排在最下面", 0): Exit Sub
Conn.Execute ("Update WM_LabelSort set WM_Taxis=0 Where WM_ParentID=" & Parent & " and WM_SkinDir = '"&WR_Setting(5)&"' and WM_Taxis=" & WM_Taxis + 1 & TypeSql)
Conn.Execute ("Update WM_LabelSort set WM_Taxis=WM_Taxis+1 Where WM_ParentID=" & Parent & " and WM_SkinDir = '"&WR_Setting(5)&"' and WM_Taxis=" & WM_Taxis & TypeSql)
Conn.Execute ("Update WM_LabelSort set WM_Taxis=" & WM_Taxis & " Where WM_ParentID=" & Parent & " and WM_SkinDir = '"&WR_Setting(5)&"' and WM_Taxis=0"&TypeSql)
End If
End Select
End If
Response.Redirect "?Action=Taxis&eID="&eID&"&eType=" & eType & ""
End Select
Set Rso = Nothing
Set Rs = Nothing
Call DBConnEnd()
Call ClassEnd()
Response.write Content
Call GetBottom()
End Sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -