📄 infomgr1.inc
字号:
<%
'#############################################################################################
'#
'# 文件名 : infomgr1.inc
'#
'#
'# 创建人 : zhouyun
'# 日 期 : 2002-05-13
'#
'# 修改历史 : ****年**月**日 ****** 修改内容:**********************************************
'#
'# 功能描述 : 公文信息管理函数文件
'# 版 本 :
'#
'# Copyright(c) 2001-2002 上海阿尔卡特网络支援系统有限公司
'#
'#############################################################################################
'*********************************************************************************************
' Name : InfoMaintain
' Function : Insert, Modify, Delete According to the Post Action
' In : No
' Out : No
' Return : No
' Comment : No
'
'---------------------------------------------------------------------------------------------
Sub InfoMaintain()
'-------------------------------------------------------
'Declares
'-------------------------------------------------------
Dim sNameOld, sNameNew, sAction, sSQL, sError,id,sDeptNew,sTimeNew,sStartNew,sEndNew,sTypeNew
Dim sDocType, sDocSubject, sDocNumber, sDocUrgent, sDocSecret, sDocPages, sDocKeywords, sDocReports, sDocSends, sDocSender,sDocSentDate,sDocRegman,sDocRegDate
'-------------------------------------------------------
'Get parameters
'--------------------------------------------------------
id=GetParam("id")
sAction = GetParam("formAction")
sAction = LCase(sAction)
'---------------------------------------------------------
' Operate according to sAction
'---------------------------------------------------------
select case sAction
case "addtype"
'------------------------------------------
' add ---- insert
'------------------------------------------
sDocType = GetParam("newtype")
sDocSubject = GetParam("newsubject")
sDocNumber = GetParam("newnumber")
sDocUrgent = GetParam("newurgent")
sDocSecret = GetParam("newsecret")
sDocPages = GetParam("newpages")
sDocKeywords = GetParam("newkeywords")
sDocReports = GetParam("newreports")
sDocSends = GetParam("newsends")
sDocSender = GetParam("newsender")
sDocSentDate = GetParam("newsentdate")
sDocRegman = GetParam("newregman")
sDocRegDate = GetParam("newregdate")
sSQL = "insert into T_Document (doc_type_id, doc_subject, doc_number, doc_urge_level, doc_secret_level, doc_pages, doc_keyword, " & _
" doc_report_person, doc_send_person, doc_sender, doc_sent_date, doc_reg_person, doc_reg_date) values(" & _
ToSQL(sDocType,"Number") & "," & ToSQL(sDocSubject,"Text") & "," & ToSQL(sDocNumber,"Text") & "," & _
ToSQL(sDocUrgent,"Number") & "," &ToSQL(sDocSecret,"Number") & "," & ToSQL(sDocPages,"Number") & "," & _
ToSQL(sDocKeywords,"Text") & "," & ToSQL(sDocReports,"Text") & "," & ToSQL(sDocSends,"Text") & "," & _
ToSQL(sDocSender,"Text") & "," & ToSQL(sDocSentDate,"Text") & "," & ToSQL(sDocRegman,"Text") & "," & _
ToSQL(sDocRegDate,"Text") & _
")"
' response.write (sSQL)
' response.end
case "updtype"
'------------------------------
' upd --- modify
'------------------------------
sDocType = GetParam("newtype")
sDocSubject = GetParam("newsubject")
sDocNumber = GetParam("newnumber")
sDocUrgent = GetParam("newurgent")
sDocSecret = GetParam("newsecret")
sDocPages = GetParam("newpages")
sDocKeywords = GetParam("newkeywords")
sDocReports = GetParam("newreports")
sDocSends = GetParam("newsends")
sDocSender = GetParam("newsender")
sDocSentDate = GetParam("newsentdate")
sDocRegman = GetParam("newregman")
sDocRegDate = GetParam("newregdate")
sSQL = "update T_Document set doc_type_id=" & ToSQL(sDocType,"Number") & "," & _
" doc_subject=" & ToSQL(sDocSubject,"Text") & "," & _
" doc_number="& ToSQL(sDocNumber,"Text") & "," & _
" doc_urge_level=" & ToSQL(sDocUrgent,"Number") & "," & _
" doc_secret_level="&ToSQL(sDocSecret,"Number") & "," & _
" doc_pages=" & ToSQL(sDocPages,"Number") & "," & _
" doc_keyword=" & ToSQL(sDocKeywords,"Text") & "," & _
" doc_report_person=" & ToSQL(sDocReports,"Text") & "," & _
" doc_send_person=" & ToSQL(sDocSends,"Text") & "," & _
" doc_sender=" & ToSQL(sDocSender,"Text") & "," & _
" doc_sent_date=" & ToSQL(sDocSentDate,"Text") & "," & _
" doc_reg_person="& ToSQL(sDocRegman,"Text") & "," & _
" doc_reg_date=" & ToSQL(sDocRegDate,"Text") & _
" where doc_id=" & ToSQL(id, "Number")
' sSQL = "update T_Rule_Info set name=" & ToSQL(sNameNew, "Text") & ", dept=" & ToSQL(sDeptNew,"Text") & ", settime=" & ToSQL(sTimeNew,"Text") & _
' ", starttime=" & ToSQL(sStartNew,"Text") & ", endtime=" &ToSQL(sEndNew,"Text") & ", type=" & ToSQL(sTypeNew,"Text") & " where sn =" & ToSQL(id, "Number")
case "deltype"
'-------------------------------
' del --- delete
'-------------------------------
sSQL = "delete from T_Document where doc_id =" & ToSQL(id, "Number")
end select
sError = ExecuteSQL(dbLocal, sSQL)
response.redirect "infomgr1.asp"
'-----------------------------------------
' error handling
'-----------------------------------------
if sError <> "" then
if sAction = "addtype" then
Response.Write "<script language=""javascript"">alert('对不起,制度名称已存在,不能重复新增!')</script>"
exit sub
end if
if sAction = "deltype" then
Response.Write "<script language=""javascript"">alert('对不起,制度名称下存在制度,不能删除该名称!')</script>"
exit sub
end if
Response.Write "<script language=""javascript"">alert('对不起,操作中发生错误,请查阅帮助文件!')</script>"
end if
End Sub
'***************************************************************************************************
'***************************************************************************************************
' Name : TableAdd
' Function : Form Table to Implement Insert, Modify, Delete According to the Post Action
' In : No
' Out : No
' Return : Table Add, Modify, Delete
' Comment : No
'
'---------------------------------------------------------------------------------------------------
Function TableAdd()
'---------------------------------------------------
' declares
'---------------------------------------------------
Dim sNameText,sFormName, sTemp,id,sDeptText,sTimeText,sStartText,sEndText,sTypeText
Dim sDocType, sDocSubject, sDocNumber, sDocUrgent, sDocSecret, sDocPages, sDocKeywords, sDocReports, sDocSends, sDocSender,sDocSentDate,sDocRegman,sDocRegDate,sDocPath
'---------------------------------------------------
' get parameters
'---------------------------------------------------
id = GetParam("id")
'---------------------------------------------------
' construct a table contains all buttons
'---------------------------------------------------
sTemp = "<td width=300><table width=300 cellspacing=0 cellpadding=0 border=0><tr><td width=300 align=center>"
'---------------------------------------------------
' show buttons
'---------------------------------------------------
if IsEmpty(id) then
' --------------------------------
' add
'---------------------------------
' sDocType =
sDocSubject = ""
sDocNumber = ""
' sDocUrgent = crs.GetValue("doc_urge_level")
' sDocSecret = crs.GetValue("doc_secret_level")
sDocPages = ""
sDocKeywords = ""
sDocReports = ""
sDocSends = ""
sDocSender = ""
sDocSentDate = date
sDocRegman = GetEmpSerial
sDocRegDate = date
' sTemp = sTemp & _
' "<span id=btnAdd style=""cursor:hand"" title=""制度信息,点击新增按钮""><img border=0 src=""../images/button/add.gif"" style=""vertical-align:bottom""></span>" & _
' " " & _
' "<span id=btnClear style=""cursor:hand"" title=""清空""><img border=0 src=""../images/button/clear.gif"" style=""vertical-align:bottom""></span>"
'
else
'----------------------------------
' upd and del
'----------------------------------
dim crs : set crs = New CRecordset
dim sSQL : sSQL = "select * from t_document,t_doc_type,t_doc_urgent,t_doc_secret ,v_user_account" & _
" where secret_level=doc_secret_level and type_id=doc_type_id and urgent_level=doc_urge_level and account_id=doc_reg_person " & _
" and doc_id=" & ToSQL(id, "Number")
dim rs : set rs = crs.open(dbLocal,sSQL)
while not rs.EOF
sDocType = crs.GetValue("type_desc")
sDocSubject = crs.GetValue("doc_subject")
sDocNumber = crs.GetValue("doc_number")
sDocUrgent = crs.GetValue("urgent_desc")
sDocSecret = crs.GetValue("secret_desc")
sDocPages = crs.GetValue("doc_pages")
sDocKeywords = crs.GetValue("doc_keyword")
sDocReports = crs.GetValue("doc_report_person")
sDocSends = crs.GetValue("doc_send_person")
sDocSender = crs.GetValue("doc_sender")
sDocSentDate = crs.GetValue("doc_sent_date")
sDocRegman = crs.GetValue("account_name")
sDocRegDate = crs.GetValue("doc_reg_date")
sDocPath = crs.GetValue("doc_path")
rs.movenext
wend
rs.close()
dim sql : sql = "select * from t_doc_attachment where doc_id=" & ToSQL(id,"Number")
set rs = crs.open(dbLocal,sql)
dim sAttachSubject,sAttachPath,sl
sl = ""
while not rs.eof
sAttachSubject = crs.GetValue("attach_subject")
sAttachPath = crs.GetValue("attach_path")
If sAttachPath = "" Then
sAttachPath = sAttachSubject & "(附件文件还未上传)<br>"
Else
sAttachPath= "<img src='../images/bg/ar-g.gif' ><a href='" & sAttachPath & "' target=_blank style=""color:blue"">"&sAttachSubject&"</a><br>"
End If
If sl = "" Then
sl= sl & sAttachPath
Else
sl = sl & " " & sAttachPath
End If
rs.movenext
wend
' response.write("sl=" & sl)
If sl = "" Then
sl = "(暂无附件)"
End If
If sDocPath = "" Then
sDocPath = "(公文文件还未上传)"
Else
sDocPath= "<img src='../images/bg/ar-g.gif' ><a href='" & sDocPath & "' target=_blank style=""color:blue"">"&sDocSubject&"</a>"
End If
' sTemp = sTemp & _
' "<span id=btnMod style=""cursor:hand"" title=""修改制度名称,点击更新按钮""><img border=0 src=""../images/button/update.gif"" style=""vertical-align:bottom""></span>" & _
' " " & _
' "<span id=btnDel style=""cursor:hand"" title=""点击删除按钮删除制度名称""><img border=0 src=""../images/button/delete.gif"" style=""vertical-align:bottom""></span>" & _
' " " & _
' "<span id=btnRes style=""cursor:hand"" title=""重置""><img border=0 src=""../images/button/reset.gif"" style=""vertical-align:bottom""></span>" & _
' " " & _
' "<span id=btnCancel style=""cursor:hand"" title=""取消""><img border=0 src=""../images/button/cancel.gif"" style=""vertical-align:bottom""></span>"
end if
sTemp = sTemp & "</td></tr></table></td>"
'----------------------------------------------------
' draw add table and return
'----------------------------------------------------
TableAdd = _
TableTitle("公文信息", 600, "", "") & _
"<table cellspacing=20 cellpadding=0 width=600 align=center border=0>" & _
"<form name=frmInfoMgr method=post action=""infomgr1.asp"">" & _
"<tr height=60 valign=center>" & _
" <td width=600 align=left colspan=3 style=""font-size:20;font-family:宋体;font-weight:550;color:blue"">" & _
" <span id=sType ><I>公文类型:</I>"& sDocType &"</span>" & _
" <BR><I>公文主题</I>:"& sDocSubject & _
" <BR><I>公文字号</I>:" & sDocNumber & _
" <BR><I>紧急程度</I>:" &sDocUrgent & _
" <BR><I>秘密程度</I>:"& sDocSecret & _
" <BR><I>公文页数</I>:" & sDocPages & _
" <BR><I>关 键 字</I>:" & sDocKeywords & "" & _
" <BR><I>抄报人员</I>:" & sDocReports & "" & _
" <BR><I>抄送人员</I>:" & sDocSends & "" & _
" <BR><I>发文单位</I>:" & sDocSender & "" & _
"<BR><I>印发日期</I>:" & sDocSentDate & "" & _
" <BR><I>登 记 人</I>:" &sDocRegman & _
"<BR><I>登记日期</I>:" &sDocRegDate & _
"<BR><I>公文内容</I>:"&sDocPath&"" & _
"<BR><I>附件内容</I>:"& sl &"" & _
" <input type=hidden name=id value='" & id & "'>" & _
" <input type=hidden name=formAction>" & _
" </td>" & _
" </tr>" & _
"<tr height=40 align=center>" & _
sTemp & _
"</tr>" & _
"</form>" & _
"</table>"
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -