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

📄 state.inc

📁 物业管理和办公自动化系统
💻 INC
📖 第 1 页 / 共 2 页
字号:
	Dim iCounter		: iCounter = 1
	Dim iPrevPage, iNextPage
	
	'-----------------------------------
	' 获取数据库连接
	'------------------------------------
	dim crs	: set crs = New CRecordset
	dim rs	: set rs = crs.open(dbLocal,sSQL)
	Dim sName,sType,sAuthor,sTemplateId

	'--------------------------------------------------
	' 如果未到记录尾,将记录定位到你翻到的页面的第一个记录,否则显示空行
	'--------------------------------------------------
	if Not rs.EOF then	
		rs.Move (iCurrentPage - 1) * iRecordsPerPage
	end if
	'--------------------------------------------------
	' write the record list table
	'--------------------------------------------------
	while not rs.EOF and iCounter <= iRecordsPerPage
			sName			= crs.GetValue("flow_name")
			sType			= crs.GetValue("stat_name")
			sTemplateId		= crs.GetValue("flow_id")

		sTemp = sTemp & "<tr valign=center>" & _
				"<td class=tdlist  width=180 title='" & sName & "' style=""cursor:hand"" onclick=""javascript:location.href='../flowmgr/flow.asp?fid=" & sTemplateId & "';""><img src=""../images/bg/ar-g.gif"" width=8 height=8>&nbsp;"  & ToHtml(Bref(sName,25)) & "&nbsp;</td>" & _
				"<td class=tdlist  align=center width=120 title='" & sType & "' style=""cursor:hand"" onclick=""javascript:location.href='../flowmgr/state.asp?fid=" & sTemplateId & "';"" >"  & sType & "&nbsp;</td>" & _
				"</tr>"
		iCounter = iCounter + 1
		rs.movenext
	wend
	crs.Close()

	'--------------------------------------------------
	' 填补空白行
	'--------------------------------------------------
	sTemp = sTemp & WhiteRows(iCols, iCounter, iRecordsPerPage)

	'--------------------------------------------------
	' 首页、前页、后页、尾页等分页信息
	'--------------------------------------------------
	sTemp = sTemp & "<tr><td class=tdlist colspan=" & iCols & " align=right>" & _
				Paginate(sFileName, sFormParams, sSortParams, iCurrentPage, iTotalPages) & _
				"&nbsp;</td></tr>"
	'--------------------------------------------------
	' Returns
	'--------------------------------------------------
	TableRecords = sTemp

End Function
'***************************************************************************************************

'***************************************************************************************************
'	Name		: TableLink
'	Function	: Table Show the Search records detail
'	In		: No
'	Out		: No
'	Return		: Table of record detail
'	Comment		: No
'
'---------------------------------------------------------------------------------------------------

Function TableLink()

	'-----------------------------------------------------
	' declares and get parameter
	'-----------------------------------------------------

	Dim fid : fid = GetParam("fid")
	Dim path 
	Dim links 

	'-----------------------------------------------------
	' Connect to Database
	'-----------------------------------------------------
'	dim crs	: set crs = New CRecordset
'	dim sSQL : sSQL = "select doc_path from T_Document where doc_id=" & ToSQL(id, "Number")
'	dim rs	: set rs = crs.open(dbLocal,sSQL)
'	
'	path		= crs.GetValue("doc_path")
'
'	crs.Close()
'
	'--------------------------------------------------
	' Construct the link string
	'--------------------------------------------------
    
	If IsEmpty(fid) Then
		'------------------------------------------
		' hide the Browse and Upload links
		'------------------------------------------
		links = ""
	Else
		'------------------------------------------
		' show the Browse and Upload links
		'------------------------------------------
		links = _
		"		&nbsp;&nbsp;&nbsp;" & _
		"		<img src=""../images/goto.gif"" >&nbsp;<a href='flow_step.asp?fid=" & fid & "'>流程步骤管理</a>" 

'		If path <> "" Then
'			links = links &	"		&nbsp;&nbsp;&nbsp;" & _
'			"		<img src=""../images/goto.gif"" >&nbsp;<a href='" & path & "'>公文文件阅读</a>"  
'		End If
	End If

	'--------------------------------------------------
	' Return the table of links
	'--------------------------------------------------
	TableLink = _
		"<table width=600 cellspacing=0 cellpadding=0 border=0 align=left>" & _
		"<tr height=10>" & _ 
		"	<td width=600><img src=""../images/bg/line.gif"" width=600 height=3></td>" & _
		"</tr>" & _
		"<tr height=20 align=left>" & _
		"	<td width=600 align=left>&nbsp;" & _
		"		<img src=""../images/goto.gif"" >&nbsp;<a href=""template.asp"">流程模板管理</a>" & _
		"		&nbsp;&nbsp;&nbsp;" & _
		"		<img src=""../images/goto.gif"" >&nbsp;<a href=""sign.asp"">审批管理</a>" & _
				links & _
		"	</td>" & _
		"</tr>" & _
		"</table>"
End Function
'***************************************************************************************************


Sub FlowStateChange(flowId,opCode)
	dim s
	dim crs 

	dim rs
	dim stat
	dim sError
	set crs=New CRecordset
	s="select flow_stat from t_flow where flow_id=" & flowId
	set rs=crs.open(dbLocal,s)
	'1-运行 2-暂停 3-终止 4-完成
	'1-启动流程 2-暂停流程 3-终止流程 4-结束流程
	stat=crs.GetValue("flow_stat")
'	response.write stat
	rs.Close()
	Select Case opCode
		Case 1
			'1-启动流程 2->1
			if stat=2 Then
				s="update t_flow set flow_stat=1 where flow_id=" & flowId
				sError=ExecuteSQL(dbLocal,s)
				s="select cur_step from t_cur_step where flow_id=" & flowId
				set rs=crs.open(dbLocal,s)
				if CInt(crs.GetValue("cur_step"))=0 Then
					s="update t_cur_step set cur_step=cur_step+1 where flow_id=" & flowId
					 sError=ExecuteSQL(dbLocal,s)
				End If
			Else
				ErrorDisplay("当前状态不能启动流程")
				exit sub
			End If
		Case 2
			'2-暂停流程 1->2
			if stat=1 Then
				s="update t_flow set flow_stat=2 where flow_id=" & flowId
				 sError=ExecuteSQL(dbLocal,s)
			Else
				ErrorDisplay("当前状态不能暂停流程")
				exit sub
			End If
		Case 3
			'3-终止流程 1,2->3
			if stat=1 Or stat=2 Then
				s="update t_flow set flow_stat=3 where flow_id=" & flowId
				 sError=ExecuteSQL(dbLocal,s)
				'special for meeting
				MeetingEnd1 flowId,1
			Else
				ErrorDisplay("当前状态不能终止流程")
				exit sub
			End If
		Case 4
			'4-结束流程
			if stat=1 Then
				s="update t_flow set flow_stat=4 where flow_id=" & flowId
				 sError=ExecuteSQL(dbLocal,s)
				'special for meeting
				MeetingEnd1 flowId,1
			Else
				ErrorDisplay("当前状态不能结束流程")
				exit sub
			End If
		Case Else
			ErrorDisplay("无法修改流程状态")
			exit sub
	End Select
End Sub

sub ErrorDisplay(s)
		Response.Write "<script language=""javascript"">alert('" & s & "')</script>"
end sub

Sub MeetingEnd(fid)
	Dim tempid
	Dim str
	dim crs
	dim rs
	dim strSQL
	dim sError
	set crs=New CRecordset
	tempid=fid	

	strSQL="select flow_file from t_flow where flow_id=" & tempid
	set rs=crs.open(dbLocal,strSQL)
	'response.write(strSQL)
	str=Rs("flow_file")
	'DBEndQuery
	'pos1=Instr(str,"mtype=0")
	pos1=Instr(str,"meetingdetail.asp")
	If pos1>0 Then
		strSQL="update T_MeetingPrepare set meeting_status=2 , Isconfirmed=1 , Approve_flow=" & tempid & " where meeting_serial=" & GetSubject(str) & ""
		'response.write(strSQL)
		'response.end
		sError=ExecuteSQL(dbLocal, strSQL)
		If sError<>"" Then
			Response.Write "<script language=""javascript"">alert('更新会议记录出错!')</script>"
			
			Exit sub
		End If
		Exit Sub
	End If
	pos2=Instr(str,"mtype=1")
	If pos2>0 Then
		strSQL="update T_meetingprepare set meeting_status=7 , Isconfirmed=1 , Approve_flow=" & tempid & " where meeting_serial=" & GetSubject(str) & ""
		sError=ExecuteSQL(dbLocal, strSQL)
		If sError<>"" Then
			Response.Write "<script language=""javascript"">alert('更新会议记录出错!')</script>"
			
			Exit sub
		End If
		Exit Sub
	End If
End Sub

'==========================================================================
Sub MeetingEnd1(fid,mode)
'--------------------------------------------------------------------------
' parameters:
'	fid	--	flow_id
'	mode	--	1 -> normal
'			0 -> abnormal
'--------------------------------------------------------------------------
	Dim tempid
	Dim str
	dim pos,pos1,pos2,ms
	tempid=fid	
	dim crs
	dim rs
	dim strSQL
	dim sError
	'---------------------------------------------------------------
	' initial database connection
	'---------------------------------------------------------------
	set crs=new CRecordset
	
	strSQL="select flow_file from t_flow where flow_id=" & tempid
	set rs = crs.open(dbLocal,strSQL)

	str=""
	If not rs.eof Then
		str=rs("flow_file")
	End if

	dim p : p=Instr(str,"?meetingserial=")

	If cint(p) < 0 then
	'	response.write "<script language=javascript>alert('会议的文件路径不正确')</script>"
	'	It's not a meeting
		exit sub
	End if

	'DBEndQuery
	'pos1=Instr(str,"mtype=0")
	pos=Instr(str,"=")
	ms=right(str,len(str)-pos)
'	response.write("ms=" & ms)
'	response.end
	
	pos1=Instr(str,"meetingdetail.asp")
	If pos1>0 Then
		strSQL="update T_MeetingPrepare set meeting_status=2 , Isconfirmed=" & Cint(mode) & " , Approve_flow=" & tempid & " where meeting_serial=" & ms
		'response.write(strSQL)
		'response.end
		sError=ExecuteSQL(dbLocal, strSQL)
		If sError <> "" Then
			Response.Write "<script language=""javascript"">alert('更新会议记录出错!')</script>"
			
			Exit sub
		End If
		Exit Sub
	End If
	'pos2=Instr(str,"mtype=1")
	pos2=Instr(str,"summarydetail.asp")
	If pos2>0 Then
		strSQL="update T_meetingprepare set meeting_status=7 , Isconfirmed=" & Cint(mode) & ", Approve_flow=" & tempid & " where meeting_serial=" & ms
		sError=ExecuteSQL(dbLocal, strSQL)
		If sError <> "" Then
			Response.Write "<script language=""javascript"">alert('更新会议记录出错!')</script>"
			Exit Sub
		End If
		Exit Sub
	End If
End Sub

Sub MeetingStart(se)
    Dim tempid
	Dim str
	dim sError
	dim strSQL
	strSQL="update T_MeetingPrepare set meeting_status=6 where meeting_serial=" & se
		'response.write(strSQL)
		'response.end
	sError=ExecuteSQL(dbLocal, strSQL)
	If sError <> "" Then
		Response.Write "<script language=""javascript"">alert('新建流程时更新会议记录出错!')</script>"
		Exit Sub
	End If
End Sub

Sub ME1(fid,mode)
End Sub
	
%>

⌨️ 快捷键说明

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