📄 template_step.inc.bak
字号:
<%
'#############################################################################################
'#
'# 文件名 : template_step.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 StepMaintain()
'-------------------------------------------------------
'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
Dim tid,sid
Dim sNo,sLeader,sOperation,sDesc
'-------------------------------------------------------
'Get parameters
'--------------------------------------------------------
tid=GetParam("tid")
sid=GetParam("sid")
sAction = GetParam("formAction")
sAction = LCase(sAction)
'---------------------------------------------------------
' Operate according to sAction
'---------------------------------------------------------
select case sAction
case "addtype"
'------------------------------------------
' add ---- insert
'------------------------------------------
sNo = GetParam("newno")
sLeader = GetParam("newleader")
sOperation = GetParam("newoperation")
sDesc = GetParam("newdesc")
sSQL = "update t_template_step set step_no=step_no+1 where template_id=" & ToSQL(tid,"Number") & " and step_no >" & ToSQL(sNo,"Number")
' response.write (sSQL)
sError = ExecuteSQL(dbLocal, sSQL)
If sError<>"" Then
Response.Write "<script language=""javascript"">alert('对不起,新增流程步骤--更新步骤出错!')</script>"
exit sub
Else
sNo = sNo + 1
sSQL = "insert into t_template_step (step_no,step_op_id,step_op_person,step_desc,template_id) values(" & _
ToSQL(sNo,"Number") & "," & ToSQL(sOperation,"Number") & "," & ToSQL(sLeader,"Number") & "," & _
ToSQL(sDesc,"Text") & "," & ToSQL(tid,"Number") & _
")"
' response.write (sSQL)
' response.end
End If
sError = ExecuteSQL(dbLocal, sSQL)
If sError<>"" Then
Response.Write "<script language=""javascript"">alert('对不起,新增流程步骤出错!')</script>"
exit sub
End If
case "updtype"
'------------------------------
' upd --- modify
'------------------------------
sNo = GetParam("newno")
sLeader = GetParam("newleader")
sOperation = GetParam("newoperation")
sDesc = GetParam("newdesc")
sSQL = "update t_template_step set step_op_id=" & ToSQL(sOperation,"Number") & "," & _
" step_op_person=" & ToSQL(sLeader,"Number") & "," & _
" step_desc="& ToSQL(sDesc,"Text") & _
" where step_id=" & sid
' response.write(sSQL)
' response.end
sError = ExecuteSQL(dbLocal, sSQL)
If sError<>"" Then
Response.Write "<script language=""javascript"">alert('对不起,更新流程步骤出错!')</script>"
exit sub
End If
case "deltype"
'-------------------------------
' del --- delete
'-------------------------------
sNo = GetParam("newno")
sSQL = "delete from t_template_step where step_id=" & sid
sError = ExecuteSQL(dbLocal, sSQL)
If sError<>"" Then
Response.Write "<script language=""javascript"">alert('对不起,删除流程步骤出错!')</script>"
exit sub
Else
sSQL = "update t_template_step set step_no=step_no-1 where template_id=" & ToSQL(tid,"Number") & " and step_no >" & ToSQL(sNo,"Number")
sError = ExecuteSQL(dbLocal, sSQL)
If sError<>"" Then
Response.Write "<script language=""javascript"">alert('对不起,删除流程步骤--更新步骤出错!')</script>"
exit sub
End If
End If
end select
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 tid,sid
Dim sNo,sLeader,sOperation,sDesc
Dim NoField
dim crs,rs,sSQL
'---------------------------------------------------
' get parameters
'---------------------------------------------------
tid = GetParam("tid")
sid = GetParam("sid")
'---------------------------------------------------
' 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(sid) then
' --------------------------------
' add
'---------------------------------
sNo = ""
sLeader = ""
sOperation = ""
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>"
'------------------------------------------
' store steps in c
'------------------------------------------
set crs = New CRecordset
sSQL = "select count(*) num from t_template_step where template_id=" & ToSQL(tid,"Number")
set rs = crs.open(dbLocal,sSQL)
dim c
while not rs.EOF
c = crs.GetValue("num")
rs.movenext
wend
crs.Close()
'------------------------------------------
' Construct NoField
'------------------------------------------
NoField= " 序 号:<select name=""newno"" style=""width:130px"">" & _
" <option value=0 selected>0</option>"
If CInt(c)>0 Then
NoField = NoField & SelectOptions(dbLocal,"t_template_step","step_no","step_no",""," template_id=" & tid & " order by step_no asc")
End If
NoField = NoField &" </select>"
else
'----------------------------------
' upd and del
'----------------------------------
set crs = New CRecordset
sSQL = "select * from t_template_step where template_id=" & ToSQL(tid, "Number") & " and step_id=" & ToSQL(sid,"Number")
set rs = crs.open(dbLocal,sSQL)
while not rs.EOF
sNo = crs.GetValue("step_no")
sLeader = crs.GetValue("step_op_person")
sOperation = crs.GetValue("step_op_id")
sDesc = crs.GetValue("step_desc")
rs.movenext
wend
crs.Close()
''get sNameText end
If sNo="" Then
response.redirect "template_step.asp?tid=" & tid
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -