Beispiel #1
0
 protected override void Validation()
 {
     _Reimburse = _DalReimburse.GetReimburseByReimburseID(_ReimburseID);
     if (_Reimburse == null)
     {
         BllUtility.ThrowException(BllExceptionConst._Reimburse_Not_Exist);
     }
     else if (_Reimburse.ReimburseStatus == ReimburseStatusEnum.Added)
     {
         BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Added);
     }
     else if (_Reimburse.ReimburseStatus == ReimburseStatusEnum.Reimbursed)
     {
         BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Reimbursed);
     }
     else if (_Reimburse.ReimburseStatus == ReimburseStatusEnum.Return)
     {
         BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Return);
     }
     //else if (_Reimburse.ReimburseStatus == ReimburseStatusEnum.Auditing)
     //{
     //    BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Auditing);
     //}
     //else if (_Reimburse.ReimburseStatus == ReimburseStatusEnum.Reimbursing)
     //{
     //    BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Reimbursing);
     //}
 }
 protected override void ExcuteSelf()
 {
     try
     {
         //_EmployeeReimburse = _DalReimburse.GetEmployeeReimburseByEmployeeID(_EmployeeID);
         //if (_EmployeeReimburse.Reimburses == null)
         //{
         //    BllUtility.ThrowException(BllExceptionConst._Reimburse_Not_Exist);
         //}
         for (var i = 0; i < _ReimburseID.Count; i++)
         {
             HRMISModel.Reimburse reimburseToUpdate = _DalReimburse.GetReimburseByReimburseID(_ReimburseID[i].ReimburseID);
             if (!ValidationEach(reimburseToUpdate))
             {
                 continue;
             }
             ReimburseDA.UpdateReimburseStatus(_ReimburseID[i].ReimburseID, ReimburseStatusEnum.Return);
             ReimburseFlowDA.Insert(new ReimburseFlow(_Operator, DateTime.Now, ReimburseStatusEnum.Return), _ReimburseID[i].ReimburseID);
         }
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
 }
Beispiel #3
0
        protected override void ExcuteSelf()
        {
            try
            {
                //_EmployeeReimburse = _DalReimburse.GetEmployeeReimburseByEmployeeID(_EmployeeID);
                //if (_EmployeeReimburse.Reimburses == null)
                //{
                //    BllUtility.ThrowException(BllExceptionConst._Reimburse_Not_Exist);
                //}
                for (int i = 0; i < _ReimburseID.Count; i++)
                {
                    HRMISModel.Reimburse reimburseToUpdate = _DalReimburse.GetReimburseByReimburseID(_ReimburseID[i].ReimburseID);
                    if (!ValidationEach(reimburseToUpdate))
                    {
                        continue;
                    }

                    using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
                    {
                        ReimburseDA.UpdateReimburseStatus(_ReimburseID[i].ReimburseID, ReimburseStatusEnum.WaitAudit);
                        ReimburseFlowDA.Insert(new ReimburseFlow(_Operator, DateTime.Now, ReimburseStatusEnum.WaitAudit), _ReimburseID[i].ReimburseID);
                        ts.Complete();
                    }
                }
            }
            catch
            {
                BllUtility.ThrowException(BllExceptionConst._DbError);
            }
        }
 protected override void Validation()
 {
     //验证报销单已存在
     _OldRimburse = _DalReimburse.GetReimburseByReimburseID(_Reimburse.ReimburseID);
     if (_OldRimburse == null)
     {
         BllUtility.ThrowException(BllExceptionConst._Reimburse_Not_Exist);
     }
 }
        protected override void Validation()
        {
            _Reimburse = _DalReimburse.GetReimburseByReimburseID(_ReimburseID);
            if (_Reimburse == null)
            {
                BllUtility.ThrowException(BllExceptionConst._Reimburse_Not_Exist);
            }
            else if (_Reimburse.ReimburseStatus == ReimburseStatusEnum.Added)
            {
                BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Added);
            }
            else if (_Reimburse.ReimburseStatus == ReimburseStatusEnum.Reimbursed)
            {
                BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Reimbursed);
            }
            else if (_Reimburse.ReimburseStatus == ReimburseStatusEnum.Return)
            {
                BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Return);
            }
            //else if (_Reimburse.ReimburseStatus == ReimburseStatusEnum.Auditing)
            //{
            //    BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Auditing);
            //}
            else if (_Reimburse.ReimburseStatus == ReimburseStatusEnum.Reimbursing)
            {
                BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Reimbursing);
            }
            var exchangeRate = ExchangeRateLogic.GetExchangeRateByCondition(_Reimburse.ExchangeRateID, new DateTime(_BillingTime.Year, _BillingTime.Month, 1));

            if (exchangeRate == null)
            {
                throw new ApplicationException("此月份尚未添加汇率");
            }
            else
            {
                _ExchangeRateID = exchangeRate.PKID;
            }
        }
 protected override void Validation()
 {
     _Reimburse = _DalReimburse.GetReimburseByReimburseID(_ReimburseID);
     if (_Reimburse == null)
     {
         BllUtility.ThrowException(BllExceptionConst._Reimburse_Not_Exist);
     }
     if (_Reimburse.ReimburseStatus == ReimburseStatusEnum.Interrupt)
     {
         BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Interruptted);
     }
     if (_Reimburse.ReimburseStatus == ReimburseStatusEnum.Reimbursed)
     {
         BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Reimbursed);
     }
 }
        protected override void ExcuteSelf()
        {
            //修改报销单的基本信息
            try
            {
                HRMISModel.Reimburse reimburseToUpdate = _DalReimburse.GetReimburseByReimburseID(_Reimburse.ReimburseID);
                //List<ReimburseFlow> reimburseFlows = _DalReimburse.GetReimburseByReimburseID(_Reimburse.ReimburseID).ReimburseFlows;
                using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
                {
                    //_EmployeeReimburse.RemoveReimburseByReimburseID(_Reimburse.ReimburseID);

                    if (reimburseToUpdate.ReimburseFlows != null)
                    {
                        _Reimburse.ReimburseFlows = reimburseToUpdate.ReimburseFlows;
                    }
                    else
                    {
                        _Reimburse.ReimburseFlows = new List <ReimburseFlow>();
                    }
                    if (_Reimburse.ReimburseStatus == ReimburseStatusEnum.Reimbursing)
                    {
                        _Reimburse.ReimburseFlows.Add(
                            new ReimburseFlow(new Employee {
                            Account = new Account {
                                Id = _EmployeeID
                            }
                        }, DateTime.Now, _Reimburse.ReimburseStatus));
                    }
                    else
                    {
                        _Reimburse.ReimburseStatus = reimburseToUpdate.ReimburseStatus;
                    }
                    //_EmployeeReimburse.Reimburses.Add(_Reimburse);
                    _DalReimburse.UpdateEmployeeReimburse(_Reimburse);

                    ts.Complete();
                }
            }
            catch
            {
                BllUtility.ThrowException(BllExceptionConst._DbError);
            }
        }
Beispiel #8
0
 protected override void Validation()
 {
     _Reimburse = _DalReimburse.GetReimburseByReimburseID(_ReimburseID);
     if (_Reimburse == null)
     {
         BllUtility.ThrowException(BllExceptionConst._Reimburse_Not_Exist);
     }
     else
     {
         _Reimburse.PaperCount   = _PaperCount;
         _Reimburse.Destinations = _Destinations;
         //_Reimburse.CustomerID = _CustomerID;
         _Reimburse.ProjectName      = _ProjectName;
         _Reimburse.ConsumeDateFrom  = _ConsumeDateFrom;
         _Reimburse.ConsumeDateTo    = _ConsumeDateTo;
         _Reimburse.OutCityAllowance = _OutCityAllowance;
         _Reimburse.OutCityDays      = _OutCityDays;
         _Reimburse.Remark           = _Remark;
     }
 }
 /// <summary>
 ///
 /// </summary>
 public ReimburseSendMail(int reimburseID)
 {
     _Reimburse = _IReimburse.GetReimburseByReimburseID(reimburseID);
 }
Beispiel #10
0
 /// <summary>
 /// 根据pkid找报销
 /// </summary>
 public Model.Reimburse GetReimburseByPkid(int id)
 {
     return(_DalReimburse.GetReimburseByReimburseID(id));
 }