Ejemplo n.º 1
0
 /// <summary>
 /// 新增请假单
 /// </summary>
 protected override void ExcuteSelf()
 {
     if (_IfSubmit)
     {
         foreach (LeaveRequestItem item in _LeaveRequest.LeaveRequestItems)
         {
             item.Status = RequestStatus.Submit;
         }
         DiyStep currentStep = _LeaveRequest.DiyProcess.FindFirstStep();
         DiyStep nextStep    = _LeaveRequest.DiyProcess.FindSecondStep();
         _LeaveRequest.PKID = _DalLeaveRequest.InsertLeaveRequest(_LeaveRequest, nextStep.DiyStepID);
         _LeaveRequest      = _DalLeaveRequest.GetLeaveRequestByPKID(_LeaveRequest.PKID);
         foreach (LeaveRequestItem item in _LeaveRequest.LeaveRequestItems)
         {
             _DalLeaveRequestFlow.InsertLeaveRequestFlow(PrepareLeaveRequestFlow(item));
         }
         new LeaveRequestMailAndPhoneDelegate().SubmitOperation(_LeaveRequest.PKID, _LeaveRequest.MailCC ?? new List <Account>(),
                                                                currentStep.MailAccount, nextStep);
     }
     else
     {
         foreach (LeaveRequestItem item in _LeaveRequest.LeaveRequestItems)
         {
             item.Status = RequestStatus.New;
         }
         DiyStep nextStep = _LeaveRequest.DiyProcess.FindFirstStep();
         _LeaveRequest.PKID = _DalLeaveRequest.InsertLeaveRequest(_LeaveRequest, nextStep.DiyStepID);
     }
 }