public int AddDeliveryReport(DeliveryReportDTO dto) { int id = 0; try { log.Debug(DeliveryReportDTO.FormatDeliveryReportDTO(dto)); R_DeliveryReport t = DeliveryReportDTO.ConvertDTOtoEntity(dto); // add id = Repository.AddDeliveryReport(t); dto.DeliveryReportId = id; log.Debug("result: 'success', id: " + id); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } return(id); }
public void DeleteDeliveryReport(DeliveryReportDTO dto) { try { log.Debug(DeliveryReportDTO.FormatDeliveryReportDTO(dto)); R_DeliveryReport t = DeliveryReportDTO.ConvertDTOtoEntity(dto); // delete Repository.DeleteDeliveryReport(t); dto.IsDeleted = t.IsDeleted; log.Debug("result: 'success'"); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } }
public void UpdateDeliveryReport(DeliveryReportDTO dto) { try { //Requires.NotNull(t); //Requires.PropertyNotNegative(t, "DeliveryReportId"); log.Debug(DeliveryReportDTO.FormatDeliveryReportDTO(dto)); R_DeliveryReport t = DeliveryReportDTO.ConvertDTOtoEntity(dto); // update Repository.UpdateDeliveryReport(t); log.Debug("result: 'success'"); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } }