📄 template.inc.bak
字号:
<%
'#############################################################################################
'#
'# 文件名 : template.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 TemplateMaintain()
'-------------------------------------------------------
'Declares
'-------------------------------------------------------
Dim sNameOld, sNameNew, sAction, sSQL, sError,id,sDeptNew,sTimeNew,sStartNew,sEndNew,sTypeNew
Dim sName,sType,sAuthor
Dim tid
'-------------------------------------------------------
'Get parameters
'--------------------------------------------------------
tid=GetParam("tid")
sAction = GetParam("formAction")
sAction = LCase(sAction)
'---------------------------------------------------------
' Operate according to sAction
'---------------------------------------------------------
select case sAction
case "addtype"
'------------------------------------------
' add ---- insert
'------------------------------------------
sName = GetParam("newname")
sType = GetParam("newtype")
sAuthor = GetParam("newauthor")
sSQL = "insert into t_flow_template (template_name,template_type,template_author_id) " & _
" values ( " & _
ToSQL(sName,"Text") & "," & _
ToSQL(sType,"Number") & "," & _
ToSQL(sAuthor,"Number") & "" & _
" ) "
case "updtype"
'------------------------------
' upd --- modify
'------------------------------
sName = GetParam("newname")
sType = GetParam("newtype")
sAuthor = GetParam("newauthor")
sSQL = "update T_Flow_Template set " & _
" template_name=" & ToSQL(sName,"Text") & "," & _
" template_type=" & ToSQL(sType,"Number") & "," & _
" template_author_id=" & ToSQL(sAuthor,"Number") & "" & _
" where template_id=" & ToSQL(tid, "Number")
' response.write (sSQL)
' response.end
case "deltype"
'-------------------------------
' del --- delete
'-------------------------------
sSQL = "select count(*) num from t_template_step where template_id=" & ToSQL(tid,"Number")
dim crs : set crs = New CRecordset
dim rs : set rs = crs.open(dbLocal,sSQL)
dim num
while not rs.EOF
num = crs.GetValue("num")
rs.movenext
wend
rs.close()
If num>0 Then
Response.Write "<script language=""javascript"">alert('对不起,流程模板步骤不为空,不能删除流程模板!')</script>"
Exit Sub
End If
sSQL="select count(*) num from t_flow where flow_template_id = " & ToSQL(tid,"Number")
set rs=crs.open(dbLocal,sSQL)
while not rs.EOF
num = crs.GetValue("num")
rs.movenext
wend
crs.close()
If num>0 Then
Response.Write "<script language=""javascript"">alert('对不起,流程模板下还有流程,不能删除流程模板!')</script>"
Exit Sub
End If
sSQL = "delete from T_Flow_Template where template_id =" & ToSQL(tid, "Number")
end select
sError = ExecuteSQL(dbLocal, sSQL)
'-----------------------------------------
' 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
Dim sName,sType,sAuthor
Dim tid
'---------------------------------------------------
' get parameters
'---------------------------------------------------
tid = GetParam("tid")
'---------------------------------------------------
' 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(tid) then
' --------------------------------
' add
'---------------------------------
' sType = 0
sName = ""
sAuthor = GetEmpSerial
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_Flow_Template where template_id=" & ToSQL(tid, "Number")
dim rs : set rs = crs.open(dbLocal,sSQL)
while not rs.EOF
sName = crs.GetValue("template_name")
sType = crs.GetValue("template_type")
sAuthor = crs.GetValue("template_author_id")
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>" & _
" " & _
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -