public int AddBeneficiary(BeneficiaryDTO dto) { int id = 0; try { log.Debug(BeneficiaryDTO.FormatBeneficiaryDTO(dto)); R_Beneficiary t = BeneficiaryDTO.ConvertDTOtoEntity(dto); // add id = Repository.AddBeneficiary(t); dto.BeneficiaryId = id; log.Debug("result: 'success', id: " + id); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } return(id); }
public void DeleteBeneficiary(BeneficiaryDTO dto) { try { log.Debug(BeneficiaryDTO.FormatBeneficiaryDTO(dto)); R_Beneficiary t = BeneficiaryDTO.ConvertDTOtoEntity(dto); // delete Repository.DeleteBeneficiary(t); dto.IsDeleted = t.IsDeleted; log.Debug("result: 'success'"); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } }
public void UpdateBeneficiary(BeneficiaryDTO dto) { try { //Requires.NotNull(t); //Requires.PropertyNotNegative(t, "BeneficiaryId"); log.Debug(BeneficiaryDTO.FormatBeneficiaryDTO(dto)); R_Beneficiary t = BeneficiaryDTO.ConvertDTOtoEntity(dto); // update Repository.UpdateBeneficiary(t); log.Debug("result: 'success'"); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } }