📄 admin_sort_annex.aspx.vb
字号:
Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Data
Imports System.Configuration
Imports flyangel.article.twotipclass
Public Class admin_sort_annex
Inherits System.Web.UI.Page
Protected WithEvents return_type As System.Web.UI.WebControls.HyperLink
Protected WithEvents annex_button As System.Web.UI.WebControls.Button
Protected WithEvents delete_list As System.Web.UI.WebControls.DropDownList
Protected WithEvents annex_List As System.Web.UI.WebControls.DropDownList
Protected WithEvents addzhuanti_error_message As System.Web.UI.WebControls.Label
#Region " Web 窗体设计器生成的代码 "
'该调用是 Web 窗体设计器所必需的。
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: 此方法调用是 Web 窗体设计器所必需的
'不要使用代码编辑器修改它。
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
If Session("KEY") <> "super" Then
Response.Redirect("index.aspx")
Response.End()
End If
Dim sorttype As String = "typeid<>0 order by nclassid Asc"
Dim dpfly As iArticleClass = HowToUsingFlyangel.iArticleClass(ConfigurationSettings.AppSettings("AssemblyFilePath"))
dpfly.SetDBConnstring = ConfigurationSettings.AppSettings("ConnstringA")
dpfly.SetLogXmlDocument = ConfigurationSettings.AppSettings("logxml")
dpfly.Addarticle_Sort(delete_list, "class_type")
dpfly.Addarticle_Sort(annex_List, "class_type")
'修改或删除时错误提示代码
Dim _temp_message As String
_temp_message = Request.QueryString("message")
If _temp_message <> "" Then
addzhuanti_error_message.Text = _temp_message
End If
'修改或删除时错误提示代码
End Sub
Private Sub annex_button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles annex_button.Click
If Session("KEY") <> "super" And Session("KEY") <> "check" And Session("KEY") <> "normal" Then
Response.Redirect("index.aspx")
Response.End()
End If
Dim sort_old_select, sort_new_select, message As String
sort_old_select = Request.Form("delete_list")
sort_new_select = Request.Form("annex_List")
message = "不可知错误发生,请与管理员联系!"
If sort_old_select = "" Or sort_new_select = "" Then
message = "你不能选择'全部栏目'作为目的栏目或被合并栏目!"
Response.Redirect("admin_sort_annex.aspx?message=" & message)
Exit Sub
End If
If sort_old_select = sort_new_select Then
message = "你不能选择相同的栏目让它们进行合并操作!"
Response.Redirect("admin_sort_annex.aspx?message=" & message)
Exit Sub
End If
If InStr(sort_old_select.ToLower, "Nclassid=") <> 0 Or InStr(sort_old_select.ToLower, "nclassid=") <> 0 Then
message = "要合并的栏目…" & sort_old_select & "…是一级栏目,请更换栏目名称!"
Response.Redirect("admin_sort_annex.aspx?message=" & message)
Exit Sub
End If
If InStr(sort_old_select.ToLower, "typeid") <> 0 And InStr(sort_new_select.ToLower, "typeid") <> 0 Then
Dim dpfly As iArticleClass = HowToUsingFlyangel.iArticleClass(ConfigurationSettings.AppSettings("AssemblyFilePath"))
dpfly.SetDBConnstring = ConfigurationSettings.AppSettings("ConnstringA")
dpfly.SetLogXmlDocument = ConfigurationSettings.AppSettings("logxml")
Dim _typename, _typename_old As String
Dim _nclassid As Integer
_typename_old = dpfly.Select_filed_from_Type((sort_old_select.ToLower.Replace("typeid=", "")), "type")
_typename = dpfly.Select_filed_from_Type((sort_new_select.ToLower.Replace("typeid=", "")), "type")
_nclassid = dpfly.Select_filed_from_Type((sort_new_select.ToLower.Replace("typeid=", "")), "nclassid")
If _typename_old = "" Then
message = "要合并的栏目…" & _typename_old & "…并不存在,请更换栏目名称!"
Response.Redirect("admin_sort_annex.aspx?message=" & message)
Exit Sub
End If
If _typename = "" Then
message = "合并到的目的栏目…" & _typename & "…并不存在,请更换栏目名称!"
Response.Redirect("admin_sort_annex.aspx?message=" & message)
Exit Sub
End If
Dim updatastring As String = "update article set " & sort_new_select & " ,nclassid=" & _nclassid & ",typename='" & _typename & "' WHERE " & sort_old_select & ""
Dim deletestring As String = "delete from type where " & sort_old_select & ""
If dpfly.OneSelect_doDBRecoder(updatastring) Then
message = "已经成功将栏目…" & _typename_old & "…合并到二级栏目…" & _typename & "…中!"
If dpfly.OneSelect_doDBRecoder(deletestring) Then
Dim dplog As iSystemClass = HowToUsingFlyangel.iSystemClass(ConfigurationSettings.AppSettings("AssemblyFilePath"))
dplog.SetLogXmlSchema = ConfigurationSettings.AppSettings("logxsd")
dplog.SetLogXmlDocument = ConfigurationSettings.AppSettings("logxml")
dplog.Log_Add_cache("合并栏目", Session("trueName"), message, Request.UserHostAddress)
Else
message += "但未将文章所属的栏目更新,请检查系统!"
End If
Else
message = "合并栏目失败,请重新修改!"
End If
End If
Response.Redirect("admin_sort_annex.aspx?message=" & message)
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -