public int AddPlannedRoute(PlannedRouteDTO dto) { int id = 0; try { log.Debug(PlannedRouteDTO.FormatPlannedRouteDTO(dto)); R_PlannedRoute t = PlannedRouteDTO.ConvertDTOtoEntity(dto); // add id = Repository.AddPlannedRoute(t); dto.PlannedRouteId = id; log.Debug("result: 'success', id: " + id); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } return(id); }
public void DeletePlannedRoute(PlannedRouteDTO dto) { try { log.Debug(PlannedRouteDTO.FormatPlannedRouteDTO(dto)); R_PlannedRoute t = PlannedRouteDTO.ConvertDTOtoEntity(dto); // delete Repository.DeletePlannedRoute(t); dto.IsDeleted = t.IsDeleted; log.Debug("result: 'success'"); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } }
public void UpdatePlannedRoute(PlannedRouteDTO dto) { try { //Requires.NotNull(t); //Requires.PropertyNotNegative(t, "PlannedRouteId"); log.Debug(PlannedRouteDTO.FormatPlannedRouteDTO(dto)); R_PlannedRoute t = PlannedRouteDTO.ConvertDTOtoEntity(dto); // update Repository.UpdatePlannedRoute(t); log.Debug("result: 'success'"); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } }