📄 announceaddsave.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<!--#include file="../../Conn.asp"-->
<!--#include file="../../SysCls/KS_CommonCls.asp"-->
<!--#include file="../../SysCls/KS_RefreshFunctionCls.asp"-->
<!--#include file="../Inc/Session.asp"-->
<%
'===================================================================================================================
'软件名称:科汛网站管理系统
'当前版本:科汛网站管理系统 V2.2 SP2 Free
'Copyright (C) 2006-2008 Kesion.Com All rights reserved.
'产品咨询QQ:9537636,41904294
'技术支持QQ:111394,54004407
'程序版权:科汛网络
'程序开发:科汛网络开发组(总策划:林文仲)
'E-Mail :kesioncms@hotmail.com webmaster@kesion.com
'官方网站:http://www.kesion.com
'演示站点:http://test.kesion.com
'郑重声明:
' ①、免费版本请在程序首页保留版权信息,并做上本站LOGO友情连接,商业版本无此要求;
' ②、任何个人或组织不得在授权允许的情况下删除、修改、拷贝本软件及其他副本上一切关于版权的信息;
' ③、科汛网络保留此软件的法律追究权利
'===================================================================================================================
Dim KSCls
Set KSCls = New AnnounceAddSave
KSCls.Execute()
Set KSCls = Nothing
Class AnnounceAddSave
Private KSCMS
Private Sub Class_Initialize()
Set KSCMS=New CommonCls
End Sub
Private Sub Class_Terminate()
Call KSCMS.CloseConn()
Set KSCMS=Nothing
End Sub
Sub Execute()
Dim AnnounceID, RSObj, SqlStr, Title, Author, AddDate, Content, NewestTF
Dim Action, Page, RSCheck
Set RSObj = Server.CreateObject("Adodb.RecordSet")
Action = Request.Form("Action")
AnnounceID = Request("AnnounceID")
Title = Replace(Replace(Request.Form("Title"), """", ""), "'", "")
Author = Replace(Replace(Request.Form("Author"), """", ""), "'", "")
AddDate = Replace(Replace(Request.Form("AddDate"), """", ""), "'", "")
Content = Replace(Request.Form("Content"), "'", "")
NewestTF = Request.Form("NewestTF")
If NewestTF = "" Then NewestTF = 0
If Title = "" Then Call KSCMS.AlertHistory("公告标题不能为空!", -1)
If Author = "" Then Call KSCMS.AlertHistory("公告作者不能为空!", -1)
If AddDate = "" Then Call KSCMS.AlertHistory("公告添加日期不能为空!", -1)
If Content = "" Then Call KSCMS.AlertHistory("公告内容不能为空!", -1)
Set RSObj = Server.CreateObject("Adodb.Recordset")
If Action = "Add" Then
RSObj.Open "Select ID From KS_Announce Where Title='" & Title & "'", Conn, 1, 1
If Not RSObj.EOF Then
RSObj.Close
Set RSObj = Nothing
Response.Write ("<script>alert('对不起,标题已存在!');history.back(-1);</script>")
Exit Sub
Else
RSObj.Close
RSObj.Open "SELECT * FROM KS_Announce Where (ID is Null)", Conn, 1, 3
RSObj.AddNew
RSObj("Title") = Title
RSObj("Author") = Author
RSObj("AddDate") = AddDate
RSObj("Content") = KSCMS.ReplaceInnerLink(Content)
RSObj("NewestTF") = NewestTF
RSObj.Update
If NewestTF = 1 Then
Conn.Execute ("UpDate KS_Announce Set NewestTF=0 Where Title<>'" & Title & "'")
End If
RSObj.Close
End If
Set RSObj = Nothing
Response.Write ("<script> if (confirm('公告添加成功!继续添加吗?')) {location.href='AnnounceAdd.asp';}else{location.href='Announce_Main.asp';parent.frames['BottomFrame'].location.href='../split.asp?ButtonSymbol=AnnounceList&OpStr=常规管理 >> <font color=red>公告管理中心</font>';}</script>")
ElseIf Action = "Edit" Then
Page = Request.Form("Page")
RSObj.Open "Select ID FROM KS_Announce Where Title='" & Title & "' And ID<>" & AnnounceID, Conn, 1, 1
If Not RSObj.EOF Then
RSObj.Close
Set RSObj = Nothing
Response.Write ("<script>alert('对不起,标题已存在!');history.back(-1);</script>")
Exit Sub
Else
RSObj.Close
SqlStr = "SELECT * FROM KS_Announce Where ID=" & AnnounceID
RSObj.Open SqlStr, Conn, 1, 3
RSObj("Title") = Title
RSObj("Author") = Author
RSObj("AddDate") = AddDate
RSObj("Content") = Content
RSObj("NewestTF") = NewestTF
RSObj.Update
If NewestTF = 1 Then
Conn.Execute ("UpDate KS_Announce Set NewestTF=0 Where ID<>" & RSObj("ID"))
End If
RSObj.Close
Set RSObj = Nothing
End If
Response.Write ("<script>alert('公告修改成功!');location.href='Announce_Main.asp?Page=" & Page & "';parent.frames['BottomFrame'].location.href='../split.asp?ButtonSymbol=AnnounceList&OpStr=常规管理 >> <font color=red>公告管理中心</font>';</script>")
End If
End Sub
End Class
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -