Пример #1
0
        public bool UpdateClaimRejectReason(ClaimRejectReasonVM claimRejectReasonVM)
        {
            using (var dbTransaction = unitOfWork.dbContext.Database.BeginTransaction())
            {
                try
                {
                    tblClaimRejectReason claimRejectReason = unitOfWork.TblClaimRejectReasonRepository.GetByID(claimRejectReasonVM.ClaimRejectReasonID);
                    claimRejectReason.ClaimRejectReason = claimRejectReasonVM.ClaimRejectReason;
                    claimRejectReason.ModifiedDate      = DateTime.Now;
                    claimRejectReason.ModifiedBy        = claimRejectReasonVM.ModifiedBy;
                    unitOfWork.TblClaimRejectReasonRepository.Update(claimRejectReason);
                    unitOfWork.Save();

                    //Complete the Transaction
                    dbTransaction.Commit();
                    return(true);
                }
                catch (Exception ex)
                {
                    //Roll back the Transaction
                    dbTransaction.Rollback();
                    return(false);
                }
            }
        }
Пример #2
0
        public bool DeleteClaimRejectReason(int claimRejectReasonID)
        {
            using (var dbTransaction = unitOfWork.dbContext.Database.BeginTransaction())
            {
                try
                {
                    tblClaimRejectReason claimRejectReason = unitOfWork.TblClaimRejectReasonRepository.GetByID(claimRejectReasonID);
                    unitOfWork.TblClaimRejectReasonRepository.Delete(claimRejectReason);
                    unitOfWork.Save();

                    //Complete the Transaction
                    dbTransaction.Commit();
                    return(true);
                }
                catch (Exception ex)
                {
                    //Roll back the Transaction
                    dbTransaction.Rollback();
                    return(false);
                }
            }
        }