📄 basparam_list.asp
字号:
<!--#include file="../global/inc/CheckSession.asp"-->
<!--#include file="../global/inc/global.inc.asp"-->
<%
Rem 新闻
Dim cmd, oDict, oTemplate
'全局变量
Dim strSQL,BasicId,ClassId,thisurl
'获取搜索字段开始
ClassId = Request("ClassId")
Key = Request("Key")
'获取搜索字段结束
'BasicType 为总分类id号
Dim BasicType:BasicType = Request.QueryString("BasicType")
'Response.Write(BasicType)
'Response.End()
'输出类名
ClassName = ReturnBasicName(BasicType)
'设置名称
Sub SetBasicName()
dict("#FatherBasicNameId#") = BasicType
dict("#FatherBasicName#") = ClassName
oDict("template") = oTemplate.ReplaceMacros(oDict("template"),dict)
End Sub
Set oDict = Server.CreateObject("Scripting.Dictionary")
set dict = server.CreateObject("scripting.dictionary")
'类实例化
Set oTemplate = New Cls_Template
'获取动作参数
cmd = Request("cmd")
select case cmd
case "delete"
Delete
case "save"
Save
case "add"
Add
'列表操作
case "News_EditDel"
News_EditDel
end select
oDict("template") = oTemplate.Load(server.MapPath("BasParam_List.asp"))
oDict("template") = oTemplate.GetPart(oDict("template"),chr(60) & "!--body-->",chr(60) & "!--//body-->")
'处理信息
select case cmd
case "edit"
ShowEdit
case "new"
ShowNew
case else
ShowList
end select
'显示内容
SetBasicName
Response.Write oDict("template")
'销毁对象
Set oDict = Nothing
Set oTemplate = Nothing
Response.End
'----------------------------------------------------------
'页面相关处理函数说明
'
'
'
'
'__________________________________________________________
function Add()
dim oRs,sql
Dim BasicId,ValidFlag,ClassId,Addtime,BasicName,Keyword,Content
ValidFlag = Request.Form("ValidFlag")
BasicName = Request.Form("BasicName")
BasicName = Request.Form("BasicName")
For i = 1 To Request.Form("Content").Count
Content = Content & Request.Form("Content")(i)
Next
oConn_Start
sql = "Select * From Sm_BasicParam Order by BasicId Desc"
Set oRs = Server.CreateObject("Adodb.RecordSet")
oRs.Open sql,oConn,1,3
oRs.Addnew
oRs("ValidFlag") = ValidFlag
oRs("BasicName") = BasicName
oRs("BasicType") = BasicType
oRs("Content") = Content
oRs.Update
oRs.close
Set oRs = Nothing
oConn_Close
response.Redirect "BasParam_List.asp?BasicType="&BasicType
end function
function Save()
dim sql,oRs
BasicId = Request("BasicId")
ValidFlag = Request.Form("ValidFlag")
BasicName = Request.Form("BasicName")
BasicName = FormatString(BasicName)
For i = 1 To Request.Form("Content").Count
Content = Content & Request.Form("Content")(i)
Next
'数据操作
sql = "select * From Sm_BasicParam Where BasicId= "&Clng(BasicId)
oConn_Start
set oRs = Server.CreateObject("Adodb.RecordSet")
oRs.open sql,oConn,1,3
If oRs.Eof Then
oRs.Close
Set oRs = Nothing
oConn_Close
InfoErrorWrite("系统中找不到该项目")
Else
oRs("ValidFlag") = ValidFlag
oRs("BasicName") = BasicName
oRs("Content") = Content
oRs.Update
End If
oRs.close
Set oRs = Nothing
oConn_Close
response.Redirect "BasParam_List.asp?BasicType="&BasicType
end function
function Delete()
dim BasicId,sql
BasicId = cint(Request("BasicId"))
oConn_Start
sql = "Delete From Sm_BasicParam Where BasicId = "&BasicId
oConn.execute sql
oConn_Close
response.Redirect("BasParam_List.asp?BasicType="&BasicType)
end function
'________________________________________________
'删除新闻
Sub DeleteClass(id)
strSQL="delete from [Sm_BasicParam] where BasicId="&cstr(id)
'DELSQL(id)
'response.Write(strSql)
'response.End()
Oconn.execute strSQL
End sub
'修改新闻
Sub ModifyClass(id)
Dim BasicName,ValidFlag,ClassId
BasicName=Request.Form("BasicName"&id)
ValidFlag = Request.Form("ValidFlag"&id)
sql="Update [Sm_BasicParam] set BasicName='"&BasicName&"',ValidFlag="&ValidFlag&" Where BasicId="&id
'response.write sql
'response.End()
oConn.execute sql
End Sub
'循环操作数据函数
Sub News_EditDel
oConn_Start
if not isempty(request("selAnnounce")) then
dim idlist,act
idlist=request("selAnnounce")
act=Request.Form("act")
'response.Write(idlist&act)
'response.End()
dim idarr '定义储存数组
dim id
if act="删 除" then
if instr(idlist,",")>0 then
idArr=split(idlist)
for i = 0 to ubound(idarr)
id=clng(idarr(i))
call DeleteClass(id)
next
else
call DeleteClass(clng(idlist))
end if
elseif act="修 改" then
if instr(idlist,",")>0 then
idArr=split(idlist)
for i = 0 to ubound(idarr)
id=clng(idarr(i))
call ModifyClass(id)
next
else
call ModifyClass(clng(idlist))
end if
end if
else
call InfoErrorWrite("至少应该选择一项信息才能操作")
end if
oConn_Close
Call InfoErrorDisplay("修改成功","BasParam_List.asp?BasicType="&BasicType)
End Sub
'关于显示的操作函数
function ShowEdit()
dim id,oRs,sql,BasicId
dim body,dict
BasicId = cint(Request("BasicId"))
body = oTemplate.GetPart(oDict("template"),"<!--edit-->","<!--//edit-->")
set dict = server.CreateObject("scripting.dictionary")
oConn_Start
sql = "select * from Sm_BasicParam where BasicId = " & BasicId
Set oRs = oConn.Execute(sql)
if oRs.eof then
Set oRs = Nothing
oConn_Close
InfoErrorWrite("系统出错找不到该项")
end if
dict("#cmd#") = "save"
If oRs("ValidFlag")=1 then
dict("#check1#") = " checked"
Else
dict("#check2#") = " checked"
End If
dict("#BasicName#") = Null2Space(oRs("BasicName"))
dict("#BasicId#") = oRs("BasicId")
dict("#Content#") = Null2Space(Server.HTMLEncode(oRs("Content")&""))
dict("#input#") = "修改"&ClassName
oRs.close
set oRs = nothing
body = oTemplate.ReplaceMacros(body,dict)
oDict("template") = oTemplate.ReplacePart(oDict("template"),"<!--list-->","<!--//list-->",body)
oConn_Close
set dict = nothing
end function
function ShowNew()
dim id,sql
dim body,dict
body = oTemplate.GetPart(oDict("template"),"<!--edit-->","<!--//edit-->")
set dict = server.CreateObject("scripting.dictionary")
dict("#cmd#") = "add"
dict("#BasicId#") = ""
oConn_Start
dict("#options#") = selectTreeList(0,0,0,BasicType)
oConn_Close
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -