public IList <WF_STEP_INST> GetSteps(string instId, string sort, string order) { var steps = context.WF_STEP_INST.Where <WF_STEP_INST>(m => m.SI_WI_ID == instId); foreach (var step in steps) { step.SI_RECEIVE_ID = string.IsNullOrEmpty(step.SI_RECEIVE_ID) ? "" : Ataw_Users.Get(step.SI_RECEIVE_ID).NickName; step.SI_PROCESS_ID = string.IsNullOrEmpty(step.SI_PROCESS_ID) ? "" : Ataw_Users.Get(step.SI_PROCESS_ID).NickName; } if (order.ToUpper() == "DESC") { return(steps.OrderByDescending <WF_STEP_INST>(sort).ToList()); } else { return(steps.OrderBy <WF_STEP_INST>(sort).ToList()); } }
public WF_WORKFLOW_INST GetWorkFlowInst(string id) { WF_WORKFLOW_INST workFlowInst = null; if (!string.IsNullOrEmpty(id)) { workFlowInst = context.WF_WORKFLOW_INST.FirstOrDefault <WF_WORKFLOW_INST>(m => m.WI_ID == id); workFlowInst.WI_CREATE_USER = string.IsNullOrEmpty(workFlowInst.WI_CREATE_USER) ? "" : Ataw_Users.Get(workFlowInst.WI_CREATE_USER).NickName; } return(workFlowInst); }
public IList <WF_APPROVE_HISTORY> GetApproveHistory(string instId, string sort, string order) { var approves = context.WF_APPROVE_HISTORY.Where <WF_APPROVE_HISTORY>(m => m.AH_WORKFLOW_ID == instId); foreach (var approve in approves) { approve.AH_OPERATOR = string.IsNullOrEmpty(approve.AH_OPERATOR) ? "" : Ataw_Users.Get(approve.AH_OPERATOR).NickName; } if (order.ToUpper() == "DESC") { approves = approves.OrderByDescending <WF_APPROVE_HISTORY>(sort); } else { approves = approves.OrderBy <WF_APPROVE_HISTORY>(sort); } return(approves.ToList()); }