📄 fun.asp
字号:
<%
'******************
'取得用户姓名
'******************
Function GetUserName(UserId)
if trim(UserId)="" then
exit Function
end if
'从员工表中提取用户姓名
set rec=server.createobject("adodb.recordset")
strsql="select Name from User where UserId='" & UserId & "'"
rec.open strsql,conn,1,1
If Not rec.Eof Then
GetUserName=rec("Name")
Else
GetUserName=""
End IF
rec.close
End Function
'******************
'取得刚刚添加工作流的编号
'******************
Function GetEFlowId(UserId)
set rsEFlow=server.CreateObject("ADODB.recordset")
strSQL="select Id from EFlowDefine where CreateUser='"&UserId&"' order by Id Desc"
rsEFlow.Open strSQL,conn,1,1
If Not rsEFlow.eof Then
GetEFlowId=rsEFlow("Id")
ELse
GetEFlowId=0
End If
rsEFlow.close
End Function
'******************
'判断流程步骤中是否有未选择的项
'******************
Sub CheckEFlowSteps(AllSteps)
If AllSteps>0 Then
for i=1 to AllSteps
ZZID=Request("carBrand"&i&"")
ZWID=Request("carType"&i&"")
If ZZID="请选择组织" Then
response.write "<script language=JavaScript>{window.alert('工作流步骤:第"&i&"步的“组织选项”未做选择!');window.history.go(-1)}</script>"
End If
If ZWID="请选择职位" Then
response.write "<script language=JavaScript>{window.alert('工作流步骤:第"&i&"步的“职位选项”未做选择!');window.history.go(-1)}</script>"
response.end
End If
Next
End If
End Sub
'******************
'将工作流流程保存进流程列表
'******************
Sub UpdateEFlowSteps(EFlowId,AllSteps)
If AllSteps>0 Then
for i=1 to AllSteps
ZZID=Request("carBrand"&i&"")
ZWID=Request("carType"&i&"")
If ZZID<>"" and ZWID<>"" Then
strSQL="insert into EFlowSteps (EflowDefineId,Steps,AllSteps,ZZID,ZWID) values("&EFlowId&","&i&","&AllSteps&",'"&ZZID&"','"&ZWID&"')"
conn.execute strsql
End IF
Next
End If
End Sub
'******************
'删除对应的工作流的工作流步骤
'******************
Sub DelEFlowSteps(EFlowId)
strSQL="delete from EFlowSteps where EflowDefineId="&EFlowId&""
conn.Execute strsql
End Sub
'******************
'取得组织名称
'******************
Function GetZZName(ZZID)
if trim(ZZID)="" then
exit Function
end if
'从组织表中提取组织名称
set rec=server.createobject("adodb.recordset")
strsql="select Name from Organise where Id=" & ZZID & ""
rec.open strsql,conn,1,1
If Not rec.Eof Then
GetZZName=rec("Name")
Else
GetZZName=""
End IF
rec.close
End Function
'******************
'取得职务名称
'******************
Function GetZWName(ZWID)
if trim(ZWID)="" then
exit Function
end if
If left(ZWID,1)="Z" Then
'从职务表中提取职务名称
ZWID=Int(Mid(ZWID,2))
set rec=server.createobject("adodb.recordset")
strsql="select Name from Business where Id=" & ZWID & ""
rec.open strsql,conn,1,1
If Not rec.Eof Then
GetZWName=rec("Name")
Else
GetZWName=""
End IF
rec.close
ElseIf left(ZWID,1)="U" Then
'从用户表中提取职务名称
ZWID=Int(Mid(ZWID,2))
set rec=server.createobject("adodb.recordset")
strsql="select Name,UserId from User where Id=" & ZWID & ""
rec.open strsql,conn,1,1
If Not rec.Eof Then
GetZWName=rec("Name")
Else
GetZWName=""
End IF
rec.close
End If
End Function
'******************
'判断此职务是否有对应的人员
'******************
Function CheckZWUser(ZWID)
if trim(ZWID)="" then
exit Function
end if
'从人员表中根据职务判断是否有此人
ZWID=Int(Mid(ZWID,2))
set rec=server.createobject("adodb.recordset")
strsql="select Name from User where ZWId=" & ZWID & ""
rec.open strsql,conn,1,1
If Not rec.Eof Then
CheckZWUser=rec("Name")
Else
CheckZWUser=""
End IF
rec.close
End Function
'******************
'取得字段名称
'******************
Function GetFieldName(FieldId)
if trim(FieldId)="" then
exit Function
end if
'从字段表中提取字段名称
set rec=server.createobject("adodb.recordset")
strsql="select FieldName from EFlowField where Id=" & FieldId & ""
rec.open strsql,conn,1,1
If Not rec.Eof Then
GetFieldName=rec("FieldName")
Else
GetFieldName=""
End IF
rec.close
End Function
'******************
'取得职务名称
'******************
Function GetZWName2(ZWID)
if trim(ZWID)="" then
exit Function
end if
'从职务表中提取职务名称
ZWID=Int(ZWID)
set rec=server.createobject("adodb.recordset")
strsql="select Name from Business where Id=" & ZWID & ""
rec.open strsql,conn,1,1
If Not rec.Eof Then
GetZWName2=rec("Name")
Else
GetZWName2=""
End IF
rec.close
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -