コード例 #1
0
 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);
     }
 }
コード例 #2
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);
            }
        }