/// <summary> /// 获取活动未完成审批的活动节点 /// </summary> /// <returns></returns> public static string GetActiveNode(string InstanceID) { try { string ActiveNodeStr = ""; DataTable dtActiveNode = CDataHelper.GetDataTable("select distinct node_id from " + CTableName.FlowChartReceiver + " where instance_id='" + InstanceID + "' and approval_status='" + EApprovalStatus.Active.ToString() + "'"); if (dtActiveNode != null) { for (int i = 0; i < dtActiveNode.Rows.Count; i++) { ActiveNodeStr += dtActiveNode.Rows[i][0].ToString() + ";"; } if (ActiveNodeStr.Length > 0) { ActiveNodeStr = ActiveNodeStr.Substring(0, ActiveNodeStr.Length - 1); } } return(ActiveNodeStr); } catch (Exception ex) { CLog.PutDownErrInfo("获取活动节点操作异常。实例ID:" + InstanceID + ",异常信息:" + ex.Message.ToString()); throw ex; } }
public DataTable getDataTable(string strSql) { try { return(CDataHelper.GetDataTable(strSql)); } catch (Exception ex) { CLog.PutDownErrInfo("通过SQL语句获取人员信息操作异常。SQL语句:" + strSql + ",异常信息:" + ex.Message.ToString()); throw ex; } }
public DataTable GetInstanceAllDataTable() { try { string strsql = "SELECT f.flowchart_name,i.[flowchart_id],i.[flowchart_version],i.[instance_id],i.[cre_date] ,u.user_name,i.[cre_man],i.[instance_status],i.[instance_message] FROM [kailifon].[dbo].[a_flowchart_instance] as i left join " + CTableName.FlowChart + " as f on(f.flowchart_id=i.flowchart_id) left join a_user as u on (i.cre_man=u.user_id) "; return(CDataHelper.GetDataTable(strsql)); } catch (Exception ex) { CLog.PutDownErrInfo("获取工作流实例操作异常。异常信息:" + ex.Message.ToString()); throw ex; } }
public DataTable getroleuser(string strRoleNameList) { try { string strRoles = GetItemArray(strRoleNameList); string strSql = @"select user_id,user_name,'" + GetUserType.ByRole + "' as GetUserType from view_workflow_role_users where role_name in (" + strRoles + ")"; DataTable dtUser = CDataHelper.GetDataTable(strSql); return(dtUser); } catch (Exception ex) { CLog.PutDownErrInfo("通过角色获取人员信息操作异常。角色名称列表:" + strRoleNameList + ",异常信息:" + ex.Message.ToString()); throw ex; } }
public DataTable getdepartmentuser(string strDepartmenNameList) { try { string strDepartments = GetItemArray(strDepartmenNameList); string strSql = @"select user_id,user_name,'" + GetUserType.ByDepartment + "' as GetUserType from view_workflow_department_users where department_name in (" + strDepartments + ")"; DataTable dtUser = CDataHelper.GetDataTable(strSql); return(dtUser); } catch (Exception ex) { CLog.PutDownErrInfo("通过部门获取人员信息操作异常。部门名称列表:" + strDepartmenNameList + ",异常信息:" + ex.Message.ToString()); throw ex; } }
public DataTable getuser(string strUserList) { try { string strUsers = GetItemArray(strUserList); string strSql = "select user_id,user_name,'" + GetUserType.ByID + "' as GetUserType from view_workflow_users where user_id in (" + strUsers + ")"; DataTable dtUser = CDataHelper.GetDataTable(strSql); return(dtUser); } catch (Exception ex) { CLog.PutDownErrInfo("通过人员ID获取人员信息操作异常。人员ID列表:" + strUserList + ",异常信息:" + ex.Message.ToString()); throw ex; } }
/// <summary> /// 获取流程实例的流转路径 /// </summary> /// <param name="InstanceID"></param> /// <returns></returns> public static string GetInstanceFlowHistory(string InstanceID) { try { string strHistory = null; DataTable dtHistory = CDataHelper.GetDataTable("select node_id,next_node_id from " + CTableName.FlowChartHistory + " where instance_id='" + InstanceID + "' order by ID asc"); if (dtHistory != null) { if (dtHistory.Rows.Count > 0) { struWFJoin[] FlowHistory = new struWFJoin[dtHistory.Rows.Count]; for (int i = 0; i < dtHistory.Rows.Count; i++) { string NodeID = dtHistory.Rows[i]["node_id"].ToString(); string NextNodeID = dtHistory.Rows[i]["next_node_id"].ToString(); string SourcePoint = null; string TargetPoint = null; string Line = null; DataTable dtLine = CDataHelper.GetDataTable("select top 1 sourcepoint,targetpoint,line_id from " + CTableName.FlowChartLine + " where node_id='" + NodeID + "' and next_node_id='" + NextNodeID + "'"); if (dtLine != null) { if (dtLine.Rows.Count > 0) { SourcePoint = dtLine.Rows[0]["sourcepoint"].ToString(); TargetPoint = dtLine.Rows[0]["targetpoint"].ToString(); Line = dtLine.Rows[0]["line_id"].ToString(); } } FlowHistory[i] = new struWFJoin(NodeID, NextNodeID, SourcePoint, TargetPoint, Line); } strHistory = JsonConvert.SerializeObject(FlowHistory); } } return(strHistory); } catch (Exception ex) { CLog.PutDownErrInfo("获取工作流实例流转历史操作异常。实例ID:,异常信息:" + ex.Message.ToString()); throw ex; } }
public string GetData(string strSql) { try { string data = null; DataTable dt = CDataHelper.GetDataTable(strSql); if (dt != null) { if (dt.Rows.Count > 0) { data = dt.Rows[0][0].ToString(); } } return(data); } catch (Exception ex) { CLog.PutDownErrInfo("通过SQL语句获取数据操作异常。SQL语句:" + strSql + ",异常信息:" + ex.Message.ToString()); throw ex; } }
/// <summary> /// 获取工作流实例 /// </summary> /// <param name="strsql"></param> /// <returns></returns> public static string GetInstance(string strsql) { try { string strInstance = null; DataTable dtInstance = CDataHelper.GetDataTable(strsql); if (dtInstance != null) { if (dtInstance.Rows.Count > 0) { struInstance[] struInst = new struInstance[dtInstance.Rows.Count]; for (int i = 0; i < dtInstance.Rows.Count; i++) { string FlowName = dtInstance.Rows[i]["flowchart_name"].ToString(); string FlowID = dtInstance.Rows[i]["flowchart_id"].ToString(); string FlowVersion = dtInstance.Rows[i]["flowchart_version"].ToString(); string InstanceID = dtInstance.Rows[i]["instance_id"].ToString(); string CreateDate = dtInstance.Rows[i]["cre_date"].ToString(); string CreateManName = dtInstance.Rows[i]["user_name"].ToString(); string CreateManID = dtInstance.Rows[i]["cre_man"].ToString(); string EInstanceStatus = dtInstance.Rows[i]["instance_status"].ToString(); string InstanceMessage = dtInstance.Rows[i]["instance_message"].ToString(); struInst[i] = new struInstance(FlowName, FlowID, FlowVersion, InstanceID, CreateDate, CreateManName, CreateManID, EInstanceStatus, InstanceMessage); } strInstance = JsonConvert.SerializeObject(struInst); } } return(strInstance); } catch (Exception ex) { CLog.PutDownErrInfo("获取工作流实例操作异常。SQL语句:" + strsql + ",异常信息:" + ex.Message.ToString()); throw ex; } }