⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 infomgr.inc

📁 物业管理和办公自动化系统
💻 INC
📖 第 1 页 / 共 2 页
字号:
<%
'#############################################################################################
'#
'#	文件名	 : infomgr.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 "infomgr.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>" & _
			"&nbsp;" & _
			"<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>" & _
			"&nbsp;" & _
			"<span id=btnDel style=""cursor:hand"" title=""点击删除按钮删除制度名称""><img border=0 src=""../images/button/delete.gif"" style=""vertical-align:bottom""></span>" & _
			"&nbsp;" & _
			"<span id=btnRes style=""cursor:hand"" title=""重置""><img border=0 src=""../images/button/reset.gif"" style=""vertical-align:bottom""></span>" & _
			"&nbsp;" & _
			"<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("公文信息", 300, "", "") & _
		"<table cellspacing=20 cellpadding=0 width=300 align=left border=0>" & _

		"<form name=frmInfoMgr method=post action=""infomgr.asp"">"  & _
		
		"<tr height=60px valign=center>" & _
		"	<td width=300 align=left colspan=3 height=60>" & _
		"		<span id=sType >公文类型:<select name=""newtype"" style=""width:210px"">" & _
					                SelectOptions(dbLocal,"t_doc_type","type_id","type_desc",sDocType,"") & _
		"			 </select></span>" & _
		"		<BR>公文主题:<input type=text name=newsubject value='" & sDocSubject & "'  maxlength=128 size=34 style=""text-align:left;border-width:0 0 1 0;text-shadow:black;color:blue;"" >" & _
		"		<BR>公文字号:<input type=text name=newnumber value='" & sDocNumber & "'  maxlength=50 size=34 style=""border-width:0 0 1 0;text-shadow:black;color:blue;"">" & _
		"		<BR>紧急程度:<select name=""newurgent"" style=""width:210px"">" & _
					                SelectOptions(dbLocal,"t_doc_urgent","urgent_level","urgent_desc",sDocUrgent,"") & _
		"			 </select>" & _
		"		<BR>秘密程度:<select name=""newsecret"" style=""width:210px"">" & _
					                SelectOptions(dbLocal,"t_doc_secret","secret_level","secret_desc",sDocSecret,"") & _
		"			 </select>" & _
		"		<BR>公文页数:<input type=text name=newpages value='" & sDocPages & "'  maxlength=50 size=34 style=""border-width:0 0 1 0;text-shadow:black;color:blue;"">" & _
		"		<BR>关 键 字:<input type=text name=newkeywords value='" & sDocKeywords & "'  maxlength=128 size=34 style=""border-width:0 0 1 0;text-shadow:black;color:blue;"">" & _
		"		<BR>抄报人员:<input type=text name=newreports value='" & sDocReports & "'  maxlength=128 size=34 style=""border-width:0 0 1 0;text-shadow:black;color:blue;"">" & _
		"		<BR>抄送人员:<input type=text name=newsends value='" & sDocSends & "'  maxlength=128 size=34 style=""border-width:0 0 1 0;text-shadow:black;color:blue;"">" & _
		"		<BR><input type=label name=newcompany value=""发文单位:"" style=""border:0;width=60""><input type=text name=newsender value='" & sDocSender & "'  maxlength=128 size=34 style=""border-width:0 0 1 0;text-shadow:black;color:blue;"">" & _
		"<BR>印发日期"   & DrawCal("", sDocSentDate, "newsentdate", "dateimg1")  & "" & _
		"		<BR>登 记 人:<select name=""newregman"" style=""width:210px"">" & _
					                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>" & _
		"<tr height=10><td colspan=3 width=300>&nbsp;</td></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
'
'---------------------------------------------------------------------------------------------------

Function TableHeader()
	sFileName = "infomgr.asp"
	TableHeader = _
		TableTitle("系统现有的公文列表", 300, "", "#0040a0") & _

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -