public static void CreateNew(NewEqRequestModel model) { try { var flowDefine = FlowBAL.GetFlowDefine("NEWEQ"); model.CurrentFlowIndex = 0; var nextStep = FlowBAL.MoveToNextFlowStep(model.CurrentFlowIndex.Value, flowDefine); if (nextStep != null) { model.CurrentFlowIndex = nextStep.Index; model.Assignee = nextStep.Owner; model.IsComplete = false; } else { model.IsComplete = true; } FlowDAL.CreateNewEqRequest(model); } catch (Exception ex) { throw ex; } }
public static NewEqRequestModel GetSingleNEWEQRequestByTickeyNo(string ticketNO) { try { return(FlowDAL.GetSingleNEWEQRequestByTickeyNo(ticketNO)); } catch (Exception ex) { throw ex; } }
public static void ApproveNewEQRequest(string ticketID, string currentUser, string strComments) { try { var flowDefine = GetFlowDefine("NEWEQ"); var ticket = FlowDAL.GetSingleNEWEQRequestByTickeyNo(ticketID); var currentStep = flowDefine.Steps.SingleOrDefault(a => a.Index == ticket.CurrentFlowIndex); var nextStep = MoveToNextFlowStep(currentStep.Index, flowDefine); if (currentStep.Owner.Equals(ticket.Assignee)) { if (nextStep == null) { var ticketComplete = new NewEqRequestModel() { ID = ticketID, Assignee = null, CurrentFlowIndex = null, IsComplete = true, Comments = strComments, LastModifyBy = currentUser, LastModifyTime = DateTime.Now }; FlowDAL.ApproveNEWEQRequest(ticketComplete); } else { var ticketUpdate = new NewEqRequestModel() { ID = ticketID, Assignee = nextStep.Owner, CurrentFlowIndex = nextStep.Index, IsComplete = false, Comments = strComments, LastModifyBy = currentUser, LastModifyTime = DateTime.Now }; FlowDAL.ApproveNEWEQRequest(ticketUpdate); } } else { throw new Exception("审批人信息不正确!"); } } catch (Exception) { throw; } }
public static List <TicketSummaryModel> GetTicketCreateByMe(string user, int page, int perpage) { return(FlowDAL.GetTicketCreateByMe(user, page, perpage)); }
public static List <TicketSummaryModel> GetTicketNeedMyApprove(string user, int page, int perpage) { return(FlowDAL.GetTicketNeedMyApprove(user, page, perpage)); }
public static FlowDefineModel GetFlowDefine(string flowType) { return(FlowDAL.GetFlowDefine(flowType)); }