Example #1
0
        /// <summary>
        ///
        /// </summary>
        protected override void Validation()
        {
            _LeaveRequest = _DalLeaveRequest.GetLeaveRequestByPKID(_LeaveRequestID);
            //判断请假信息是否为空
            if (_LeaveRequest == null)
            {
                HrmisUtility.ThrowException(HrmisUtility._LeaveRequest_Not_Exist);
            }

            //判断该账号是否有请假流程
            _LeaveRequest.DiyProcess =
                _DalEmployeeDiyProcess.GetDiyProcessByProcessTypeAndAccountID(ProcessType.LeaveRequest, _LeaveRequest.Account.Id);
            if (_LeaveRequest.DiyProcess == null)
            {
                HrmisUtility.ThrowException(HrmisUtility._No_LeaveRequest_DiyProcess);
            }

            _LeaveRequestItem = _DalLeaveRequest.GetLeaveRequestItemByPKID(_LeaveRequestItemID);
            if (_LeaveRequestItem == null)
            {
                HrmisUtility.ThrowException(HrmisUtility._LeaveRequest_Not_Exist);
            }
            //如果请假信息状态不是取消或提交状态,不能取消
            if (!RequestStatus.CanCancelStatus(_LeaveRequestItem.Status))
            {
                HrmisUtility.ThrowException(HrmisUtility._LeaveRequest_Partial_CanNot_BeCancled);
            }
        }
 /// <summary>
 ///
 /// </summary>
 public LeaveRequestOverPhone(int leaveRequestID, LeaveRequestItem item, int nowAccountID)
 {
     _LeaveRequest         = _DalLeaveRequest.GetLeaveRequestByPKID(leaveRequestID);
     _LeaveRequest.Account = _AccountBll.GetAccountById(_LeaveRequest.Account.Id);
     _LeaveRequestItem     = _DalLeaveRequest.GetLeaveRequestItemByPKID(item.LeaveRequestItemID);
     _NowAccount           = nowAccountID;
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="leaveRequestID"></param>
 /// <param name="diyProcessAccountlist"></param>
 /// <param name="nextStep"></param>
 public LeaveRequestCancelMail(int leaveRequestID, List <Account> diyProcessAccountlist, DiyStep nextStep)
 {
     _LeaveRequest          = _DalLeaveRequest.GetLeaveRequestByPKID(leaveRequestID);
     _LeaveRequest.Account  = _AccountBll.GetAccountById(_LeaveRequest.Account.Id);
     _NextStep              = nextStep;
     _DiyProcessAccountlist = diyProcessAccountlist;
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="leaveRequestID"></param>
 /// <param name="item"></param>
 /// <param name="nextStep"></param>
 public LeaveRequestCancelPhone(int leaveRequestID, LeaveRequestItem item, DiyStep nextStep)
 {
     _LeaveRequest         = _DalLeaveRequest.GetLeaveRequestByPKID(leaveRequestID);
     _LeaveRequest.Account = _AccountBll.GetAccountById(_LeaveRequest.Account.Id);
     _LeaveRequestItem     = item;
     _NextStep             = nextStep;
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="leaveRequestID"></param>
 /// <param name="hrAccount"></param>
 /// <param name="currentStep"></param>
 public LeaveRequestOverMail(int leaveRequestID, List <Account> hrAccount, DiyStep currentStep)
 {
     _LeaveRequest         = _DalLeaveRequest.GetLeaveRequestByPKID(leaveRequestID);
     _LeaveRequest.Account = _AccountBll.GetAccountById(_LeaveRequest.Account.Id);
     _HRAccount            = hrAccount;
     _CurrentStep          = currentStep;
 }
Example #6
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);
     }
 }
Example #7
0
 /// <summary>
 ///
 /// </summary>
 protected override void Validation()
 {
     _LeaveRequest = _DalLeaveRequest.GetLeaveRequestByPKID(_LeaveRequestID);
     //判断请假信息是否为空
     if (_LeaveRequest == null)
     {
         HrmisUtility.ThrowException(HrmisUtility._LeaveRequest_Not_Exist);
     }
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="leaveRequestID"></param>
 /// <param name="cclist"></param>
 /// <param name="diyProcesslist"></param>
 /// <param name="nextStep"></param>
 public LeaveRequestSubmitMail(int leaveRequestID, List <Account> cclist, List <Account> diyProcesslist,
                               DiyStep nextStep)
 {
     _LeaveRequest         = _DalLeaveRequest.GetLeaveRequestByPKID(leaveRequestID);
     _LeaveRequest.Account = _AccountBll.GetAccountById(_LeaveRequest.Account.Id);
     _CCList         = cclist;
     _DiyProcesslist = diyProcesslist;
     _NextStep       = nextStep;
 }
Example #9
0
        /// <summary>
        /// 根据PKID获得的请假信息
        /// </summary>
        /// <param name="pkid"></param>
        /// <returns></returns>
        public LeaveRequest GetLeaveRequestByPKID(int pkid)
        {
            LeaveRequest iRet = _DalLeaveRequest.GetLeaveRequestByPKID(pkid);

            if (iRet != null && iRet.Account != null)
            {
                iRet.Account = _IAccountBll.GetAccountById(iRet.Account.Id);
            }
            return(iRet);
        }
Example #10
0
        protected override void Validation()
        {
            _LeaveRequest = _DalLeaveRequest.GetLeaveRequestByPKID(_LeaveRequestID);
            //判断请假信息是否为空
            if (_LeaveRequest == null)
            {
                ResultMessage = HrmisUtility._LeaveRequest_Not_Exist;
                HrmisUtility.ThrowException(HrmisUtility._LeaveRequest_Not_Exist);
            }

            //判断该账号是否有请假流程
            _LeaveRequest.DiyProcess =
                _DalEmployeeDiyProcess.GetDiyProcessByProcessTypeAndAccountID(ProcessType.LeaveRequest, _LeaveRequest.Account.Id);
            if (_LeaveRequest.DiyProcess == null)
            {
                HrmisUtility.ThrowException(HrmisUtility._No_LeaveRequest_DiyProcess);
            }
        }
        /// <summary>
        ///
        /// </summary>
        protected override void Validation()
        {
            _LeaveRequest = _DalLeaveRequest.GetLeaveRequestByPKID(_LeaveRequestID);
            //判断请假信息是否为空
            if (_LeaveRequest == null)
            {
                HrmisUtility.ThrowException(HrmisUtility._LeaveRequest_Not_Exist);
            }

            //判断该账号是否有请假流程
            _LeaveRequest.DiyProcess =
                _DalEmployeeDiyProcess.GetDiyProcessByProcessTypeAndAccountID(ProcessType.LeaveRequest, _LeaveRequest.Account.Id);
            if (_LeaveRequest.DiyProcess == null)
            {
                HrmisUtility.ThrowException(HrmisUtility._No_LeaveRequest_DiyProcess);
            }

            //如果请假信息状态不是提交或取消请假状态,不能审批
            foreach (LeaveRequestItem item in _LeaveRequest.LeaveRequestItems)
            {
                if (item.LeaveRequestItemID == _LeaveRequestItemID)
                {
                    _LeaveRequestItem = item;
                    if (!RequestStatus.CanApproveStatus(item.Status))
                    {
                        HrmisUtility.ThrowException(HrmisUtility._LeaveRequest_Partial_CanNot_BeApproved);
                    }
                    item.CurrentStep.OperatorID =
                        new GetLeaveRequest().ChangeOperatorToEmployee(_LeaveRequest, item.CurrentStep);

                    if (item.CurrentStep.OperatorID != _OperatorID)
                    {
                        HrmisUtility.ThrowException(HrmisUtility._No_Auth_To_Approve);
                    }
                }
            }
        }
Example #12
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="leaveRequestID"></param>
 /// <param name="nextStep"></param>
 public LeaveRequestSubmitPhone(int leaveRequestID, DiyStep nextStep)
 {
     _LeaveRequest         = _DalLeaveRequest.GetLeaveRequestByPKID(leaveRequestID);
     _LeaveRequest.Account = _AccountBll.GetAccountById(_LeaveRequest.Account.Id);
     _NextStep             = nextStep;
 }
Example #13
0
 /// <summary>
 ///
 /// </summary>
 public LeaveRequestConfirmPhone(int leaveRequestID)
 {
     _LeaveRequest         = _DalLeaveRequest.GetLeaveRequestByPKID(leaveRequestID);
     _LeaveRequest.Account = _AccountBll.GetAccountById(_LeaveRequest.Account.Id);
 }
Example #14
0
 /// <summary>
 /// 修改请假单
 /// </summary>
 public UpdateLeaveRequest(LeaveRequest leaveRequest, bool ifSubmit)
 {
     _LeaveRequest    = leaveRequest;
     _IfSubmit        = ifSubmit;
     _OldLeaveRequest = _DalLeaveRequest.GetLeaveRequestByPKID(_LeaveRequest.PKID);
 }
Example #15
0
 /// <summary>
 ///
 /// </summary>
 public LeaveRequestConfirmMail(int leaveRequestID)
 {
     //_LeaveRequestItem = item;
     _LeaveRequest         = _DalLeaveRequest.GetLeaveRequestByPKID(leaveRequestID);
     _LeaveRequest.Account = _AccountBll.GetAccountById(_LeaveRequest.Account.Id);
 }