📄 news_regist.asp
字号:
<!--#include file="../Include/TimeOut.asp"-->
<%'身份校验
modulecode="0301"%>
<!--#include file="../Include/ModuleUserCheck.asp"-->
<!--#include file="../Include/online.asp"-->
<%
'接收传来的变量
srtsql=Request.QueryString ("strsql")
oldnewstitle=Request.QueryString ("newstitle")
oldSendDate=Request.QueryString ("oldSendDate")
edit=Request.QueryString ("edit")
page=Cstr(Request.QueryString ("page"))
dim newsTitle,newsType,DepartCode,getername,geterCode,YesYear,YesMonth,Yesday,Contents,edit
newsTitle=""
newsType=""
DepartCode=""
getername=""
geterCode=""
'YesDate=""
'SendDate=""
Contents=""
'接收表单数据
newsTitle=Request.form("NewsTitle")
newsType=trim(request("NewsType"))
DepartCode=trim(request("DepartCode"))
geterCode=trim(request("GeterCode"))
yesYear=cstr(request("Yesyear"))
yesMonth=cstr(request("YesMonth"))
yesDay=cstr(request("YesDay"))
YesDate=cdate(Yesmonth&","&yesday&","&yesyear)'注意,好一番修改
'转换格式为HTML格式
Contents=request("Contents")
'Contents=replace(Contents,chr(10),"<br>")
'系统自动添加部分
SendDate=date
senderName=session("userName")
senderCode=session("userCode")
'处理修改页面部分
if edit="edit" then
newstitle=Request.Form("newstitle")
senddate=Request("oldSendDate")
strsql="update XT_TD_usermessage set 消息题名="+"'"+Newstitle+"'"+",发送类别="+"'"+newstype+"'"+",发送日期="+"'"+Cstr(date)+"'"+",有效日期="+"'"+Cstr(yesdate)+"'"+",用户编码="+"'"+geterercode+"'"+",部门编码="+"'"+departcode+"'"+",发送人编码="+"'"+sendercode+"'"+",发送人姓名="+"'"+sendername+"'"+",消息内容="+"'"+contents+"'"+" where 消息题名="+"'"+oldnewstitle+"' and 发送日期='"+CStr(senddate)+"'"
conn.Execute strsql,1
Response.Write "已修改成功!<br>"
Response.Write "<a href=news_EditList.asp?strsql="+server.URLEncode ( Request.QueryString("strsql"))+"&page="+Cstr(page)+">按此返回列表</a>"
else
set rst2=server.CreateObject ("ADODB.recordset")
StrSQL="select * from XT_TD_UserMessage where 消息题名='"+newstitle+"'and 发送日期='"+Cstr(senddate)+"'"
rst2.CursorType =3
rst2.CursorLocation =3
rst2.LockType =2
rst2.Open strsql,strconn
if not rst2.EOF then
Response.Write "这个条消息已经存在."
Response.Write "<a href=news_Edit.asp?strsql="+server.URLEncode ( Request.QueryString("strsql"))+"&page="+Cstr(page)+">请重新上传!</a> "
Response.End
else
'消息写入数据库
StrSQL="insert into XT_TD_usermessage(消息题名,发送类别,发送日期,有效日期,用户编码,部门编码,发送人编码,发送人姓名,消息内容) values ('"&newstitle&"','"&newstype&"','"&date&"','"&yesdate&"','"&getercode&"','"&departcode&"','"&sendercode&"','"&sendername&"','"&contents&"')"
conn.Execute StrSQL
conn.close
set conn=nothing
Response.Write ExpertName&"您已上传成功!<br>"
Response.Write "<a href=news_Edit_addfj.asp?newstitle="&newstitle&"&senddate="&date&"&strsql="+server.URLEncode ( Request.QueryString("strsql"))+"&page="+Cstr(page)+">按此添加附件</a><br>"
Response.Write "<a href=news_EditList.asp?strsql="+server.URLEncode ( Request.QueryString("strsql"))+"&page="+Cstr(page)+">按此返回列表</a>"
'querySQL="select * from XT_VD_usermessage where 发送人编码='"&session("usercode")&"'"
'Response.Redirect "news_EditList.asp?strsql="+server.URLEncode (Request.QueryString ("strsql"))+"&page="+Cstr(page)
end if
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -