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; } }