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); } } }
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); } } }