📄 flow.inc.bak
字号:
<%
'#############################################################################################
'#
'# 文件名 : flow.inc
'#
'#
'# 创建人 : zhouyun
'# 日 期 : 2002-05-13
'#
'# 修改历史 : ****年**月**日 ****** 修改内容:**********************************************
'#
'# 功能描述 : 流程函数文件
'# 版 本 :
'#
'# Copyright(c) 2001-2002 上海阿尔卡特网络支援系统有限公司
'#
'#############################################################################################
'*********************************************************************************************
' Name : FlowMaintain
' Function : Insert, Modify, Delete According to the Post Action
' In : No
' Out : No
' Return : No
' Comment : No
'
'---------------------------------------------------------------------------------------------
Sub FlowMaintain()
'-------------------------------------------------------
'Declares
'-------------------------------------------------------
Dim sNameOld, sNameNew, sAction, sSQL, sError,id,sDeptNew,sTimeNew,sStartNew,sEndNew,sTypeNew
Dim sName,sTemplate,sAuthor,sMethod,sFile
Dim tid
Dim fid
dim crs,rs
'-------------------------------------------------------
'Get parameters
'--------------------------------------------------------
' tid = GetParam("tid")
fid = GetParam("fid")
sAction = GetParam("formAction")
sAction = LCase(sAction)
'---------------------------------------------------------
' Operate according to sAction
'---------------------------------------------------------
select case sAction
case "addtype"
'------------------------------------------
' add ---- insert
'------------------------------------------
sName = GetParam("newname")
sTemplate = GetParam("newtemplate")
sAuthor = GetParam("newauthor")
sMethod = GetParam("newmethod")
sFile = GetParam("newfile")
If cint(sTemplate)=-1 Then
Response.Write "<script language=""javascript"">alert('对不起,无法创建流程,请先到流程模板管理中创建新模板!')</script>"
exit sub
End If
set crs = New CRecordset
sSQL= "select count(*) num from t_template_step where template_id=" & sTemplate
set rs = crs.open(dbLocal,sSQL)
dim n :n=rs("num")
rs.close()
If cint(n)=0 Then
Response.Write "<script language=""javascript"">alert('对不起,你所选定的流程模板没有步骤信息,无法新建流程!')</script>"
exit sub
End If
sSQL = "proc_submitflow " & _
ToSQL(sName,"Text") & "," & _
ToSQL(sTemplate,"Number") & "," & _
ToSQL(sAuthor,"Number") & "," & _
ToSQL(sFile,"Text") & "," & ToSQL(sMethod,"Text")
sError = ExecuteSQL(dbLocal, sSQL)
if sError <> "" then
Response.Write "<script language=""javascript"">alert('对不起,新建流程不成功!')</script>"
exit sub
end if
Response.Write "<script language=""javascript"">alert('成功创建流程;选中该流程,点击流程步骤管理可以管理流程步骤信息!')</script>"
sSQL="select step_op_person from t_template_step where step_no=1 and template_id = "& sTemplate
set rs = crs.open(dbLocal,sSQL)
dim op : op = rs("step_op_person")
crs.Close()
call CommonSendMsg(MSG_APPROVE,"","请审批流程","流程名称:"&sName,GetEmpSerial,op)
case "updtype"
'------------------------------
' upd --- modify
'------------------------------
sName = GetParam("newname")
sTemplate = GetParam("newtemplate")
sAuthor = GetParam("newauthor")
sMethod = GetParam("newmethod")
sFile = GetParam("newfile")
dim s1 : s1= "select flow_stat from t_flow where flow_id=" & GetParam("fid")
set crs = New CRecordset
set rs = crs.open(dbLocal,s1)
dim cur1
if Not rs.EOF then
cur1=crs.GetValue("flow_stat")
end if
crs.Close()
' response.write("cur= "&cur)
' response.end
if CInt(cur1) <> 2 then
Response.Write "<script language=""javascript"">alert('流程暂停时才可更新流程!')</script>"
exit sub
end if
sSQL = "update T_Flow set " & _
" flow_name=" & ToSQL(sName,"Text") & "," & _
" flow_template_id=" & ToSQL(sTemplate,"Number") & "," & _
" flow_author_id=" & ToSQL(sAuthor,"Number") & "," & _
" flow_file=" & ToSQL(sFile,"Text") & "," & _
" flow_urge_way=" & ToSQL(sMethod,"Text") & "" & _
" where flow_id=" & ToSQL(fid, "Number")
sError = ExecuteSQL(dbLocal, sSQL)
case "deltype"
'-------------------------------
' del --- delete
'-------------------------------
dim s : s= "select flow_stat from t_flow where flow_id=" & GetParam("fid")
set crs = New CRecordset
set rs = crs.open(dbLocal,s)
dim cur
if Not rs.EOF then
cur=crs.GetValue("flow_stat")
end if
crs.Close()
' response.write("cur= "&cur)
' response.end
if CInt(cur) < 3 then
Response.Write "<script language=""javascript"">alert('流程没有结束,没有终止,无法删除流程!')</script>"
exit sub
end if
sSQL = "delete from T_Flow where flow_id =" & ToSQL(fid, "Number")
sError = ExecuteSQL(dbLocal, sSQL)
if sError <> "" then
Response.Write "<script language=""javascript"">alert('对不起,操作中发生错误,请查阅帮助文件!')</script>"
exit sub
end if
end select
'-----------------------------------------
' 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,sStatus,sAuthor,sTemplate,sMethod,sFile,iTemplate
Dim fid
'---------------------------------------------------
' get parameters
'---------------------------------------------------
fid = GetParam("fid")
'---------------------------------------------------
' 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(fid) then
' --------------------------------
' add
'---------------------------------
' sType = 0
sName = ""
sAuthor = GetEmpSerial
sFile = ""
iTemplate = 0
sTemp = sTemp & ""
dim ssstemp: ssstemp= _
"<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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -