public int AddContributionChannel(ContributionChannelDTO dto) { int id = 0; try { log.Debug(ContributionChannelDTO.FormatContributionChannelDTO(dto)); R_ContributionChannel t = ContributionChannelDTO.ConvertDTOtoEntity(dto); // add id = Repository.AddContributionChannel(t); dto.ContributionChannelId = id; log.Debug("result: 'success', id: " + id); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } return(id); }
public void DeleteContributionChannel(ContributionChannelDTO dto) { try { log.Debug(ContributionChannelDTO.FormatContributionChannelDTO(dto)); R_ContributionChannel t = ContributionChannelDTO.ConvertDTOtoEntity(dto); // delete Repository.DeleteContributionChannel(t); dto.IsDeleted = t.IsDeleted; log.Debug("result: 'success'"); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } }
public void UpdateContributionChannel(ContributionChannelDTO dto) { try { //Requires.NotNull(t); //Requires.PropertyNotNegative(t, "ContributionChannelId"); log.Debug(ContributionChannelDTO.FormatContributionChannelDTO(dto)); R_ContributionChannel t = ContributionChannelDTO.ConvertDTOtoEntity(dto); // update Repository.UpdateContributionChannel(t); log.Debug("result: 'success'"); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } }