/// <summary> /// 获取单个详细工作流根据流程详细编号 /// </summary> /// <param name="WFID">工作流详细编号</param> /// <returns></returns> public case_workflowdetails GetSingle(string WFDID) { Entities db = new Entities(); case_workflowdetails model = db.case_workflowdetails.SingleOrDefault(a => a.wfdid == WFDID); return(model); }
/// <summary> /// 活动流程 /// </summary> /// <param name="WFID">流程ID</param> /// <param name="WFSID">实例编号</param> /// <returns></returns> public Casr_WorkFlowClass ProcessIndex(string WFID, string WFDID)//, string WFSID, string WFSAID) { Casr_WorkFlowClass workflow = new Casr_WorkFlowClass(); List <nextwfdidname> list = new List <nextwfdidname>(); if (!string.IsNullOrEmpty(WFID)) { IList <case_workflowdetails> wfdList = new Case_WorkFlowDetailsDAL().GetList().Where(a => a.wfid == WFID).ToList();//获取当前流程所有环节 if (wfdList == null && wfdList.Count() <= 0) { workflow.WorkFlowState = 2; return(workflow); } #region 获取下一步流程 //下一步流程编号集合 格式为:【,流程编号,流程编号,流程编号,】 string nextWFDIDS = string.Empty; case_workflowdetails wfdModel = new Case_WorkFlowDetailsDAL().GetSingle(WFDID); if (wfdModel != null) { nextWFDIDS = wfdModel.nextid; } else { workflow.WorkFlowState = 2; return(workflow); } workflow.wfdname = wfdModel.wfdname; workflow.wfdid = wfdModel.wfdid; if (!string.IsNullOrEmpty(nextWFDIDS)) { #region 一步的所有流程 //下一步流程 格式为:【;流程编号,流程名称,是否有下一个流程;流程编号,流程名称,是否有下一个流程;流程编号,流程名称,是否有下一个流程;】 string[] nextWFDIDS_split = nextWFDIDS.Split(','); foreach (string NEXTID in nextWFDIDS_split) { nextwfdidname nextmodel = new nextwfdidname(); if (!string.IsNullOrEmpty(NEXTID)) { //string temp = ""; string WFDNAME = string.Empty; case_workflowdetails wfdMpdel = wfdList.FirstOrDefault(a => a.wfdid == NEXTID); if (wfdMpdel == null || string.IsNullOrEmpty(wfdMpdel.wfdname)) { workflow.WorkFlowState = 2; return(workflow); } else { WFDNAME = wfdMpdel.wfdname; } nextmodel.nextid = NEXTID; nextmodel.wfdname = wfdMpdel.wfdname; nextmodel.nextroleid = wfdMpdel.nextroleid; nextmodel.nextunitid = wfdMpdel.nextunitid; list.Add(nextmodel); } } workflow.nextwfdidname = list;//下一步流程 #endregion } #endregion } return(workflow); }