📄 infomgr1.inc.bak
字号:
<%
'#############################################################################################
'#
'# 文件名 : 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
'---------------------------------------------------
' 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 where doc_id=" & ToSQL(id, "Number")
dim rs : set rs = crs.open(dbLocal,sSQL)
while not rs.EOF
sDocType = crs.GetValue("doc_type_id")
sDocSubject = crs.GetValue("doc_subject")
sDocNumber = crs.GetValue("doc_number")
sDocUrgent = crs.GetValue("doc_urge_level")
sDocSecret = crs.GetValue("doc_secret_level")
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("doc_reg_person")
sDocRegDate = crs.GetValue("doc_reg_date")
rs.movenext
wend
crs.Close()
''get sNameText end
' 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("公文信息", 400, "", "") & _
"<table cellspacing=20 cellpadding=0 width=300 align=center border=0>" & _
"<form name=frmInfoMgr method=post action=""infomgr1.asp"">" & _
"<tr height=60 valign=center>" & _
" <td width=600 align=left colspan=3>" & _
" <span id=sType >公文类型:<select name=""newtype"" style=""width:86px"">" & _
SelectOptions(dbLocal,"t_doc_type","type_id","type_desc",sDocType,"") & _
" </select></span>" & _
" <BR>公文主题:<input type=text name=newsubject value='" & sDocSubject & "' maxlength=128>" & _
" <BR>公文字号:<input type=text name=newnumber value='" & sDocNumber & "' maxlength=50>" & _
" <BR>紧急程度:<select name=""newurgent"" style=""width:86px"">" & _
SelectOptions(dbLocal,"t_doc_urgent","urgent_level","urgent_desc",sDocUrgent,"") & _
" </select>" & _
" <BR>秘密程度:<select name=""newsecret"" style=""width:86px"">" & _
SelectOptions(dbLocal,"t_doc_secret","secret_level","secret_desc",sDocSecret,"") & _
" </select>" & _
" <BR>公文页数:<input type=text name=newpages value='" & sDocPages & "' maxlength=50>" & _
" <BR>关 键 字:<input type=text name=newkeywords value='" & sDocKeywords & "' maxlength=128>" & _
" <BR>抄报人员:<input type=text name=newreports value='" & sDocReports & "' maxlength=128>" & _
" <BR>抄送人员:<input type=text name=newsends value='" & sDocSends & "' maxlength=128>" & _
" <BR><input type=label name=newcompany value=""发文单位:"" style=""border:no""><input type=text name=newsender value='" & sDocSender & "' maxlength=128>" & _
"<BR>印发日期" & DrawCal("", sDocSentDate, "newsentdate", "dateimg1") & "" & _
" <BR>登 记 人:<select name=""newregman"" style=""width:86px"">" & _
SelectOptions(dbLocal,"v_user_account","account_id","account_name",sDocRegman,"") & _
" </select>" & _
"<BR>登记日期" & DrawCal("", sDocRegDate, "newregdate", "dateimg3") & "" & _
" <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
'***************************************************************************************************
'***************************************************************************************************
' Name : TableHeader
' Function : Table head for Record Table
' In : No
' Out : No
' Return : Table head of table record
' Comment : No
'
'---------------------------------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -