// logging helper public static string FormatPlannedRouteDTO(PlannedRouteDTO plannedRouteDTO) { if (plannedRouteDTO == null) { // null return("plannedRouteDTO: null"); } else { // output values return("plannedRouteDTO: \n" + "{ \n" + " PlannedRouteId: " + "'" + plannedRouteDTO.PlannedRouteId + "'" + ", \n" + " Name: " + (plannedRouteDTO.Name != null ? "'" + plannedRouteDTO.Name + "'" : "null") + ", \n" + " RouteTypeId: " + (plannedRouteDTO.RouteTypeId != null ? "'" + plannedRouteDTO.RouteTypeId + "'" : "null") + ", \n" + " TransportTypeId: " + (plannedRouteDTO.TransportTypeId != null ? "'" + plannedRouteDTO.TransportTypeId + "'" : "null") + ", \n" + " Description: " + (plannedRouteDTO.Description != null ? "'" + plannedRouteDTO.Description + "'" : "null") + ", \n" + " StartHour: " + (plannedRouteDTO.StartHour != null ? "'" + plannedRouteDTO.StartHour + "'" : "null") + ", \n" + " EstimatedDuration: " + (plannedRouteDTO.EstimatedDuration != null ? "'" + plannedRouteDTO.EstimatedDuration + "'" : "null") + ", \n" + " TotalDistance: " + (plannedRouteDTO.TotalDistance != null ? "'" + plannedRouteDTO.TotalDistance + "'" : "null") + ", \n" + " RouteDayOfTheWeek: " + (plannedRouteDTO.RouteDayOfTheWeek != null ? "'" + plannedRouteDTO.RouteDayOfTheWeek + "'" : "null") + ", \n" + " Active: " + "'" + plannedRouteDTO.Active + "'" + ", \n" + " IsDeleted: " + "'" + plannedRouteDTO.IsDeleted + "'" + ", \n" + " CreateBy: " + (plannedRouteDTO.CreateBy != null ? "'" + plannedRouteDTO.CreateBy + "'" : "null") + ", \n" + " CreateOn: " + (plannedRouteDTO.CreateOn != null ? "'" + plannedRouteDTO.CreateOn + "'" : "null") + ", \n" + " UpdateBy: " + (plannedRouteDTO.UpdateBy != null ? "'" + plannedRouteDTO.UpdateBy + "'" : "null") + ", \n" + " UpdateOn: " + (plannedRouteDTO.UpdateOn != null ? "'" + plannedRouteDTO.UpdateOn + "'" : "null") + " \n" + "} \n"); } }
public static R_PlannedRoute ConvertDTOtoEntity(PlannedRouteDTO dto) { R_PlannedRoute plannedRoute = new R_PlannedRoute(); plannedRoute.PlannedRouteId = dto.PlannedRouteId; plannedRoute.Name = dto.Name; plannedRoute.RouteTypeId = dto.RouteTypeId; plannedRoute.TransportTypeId = dto.TransportTypeId; plannedRoute.Description = dto.Description; plannedRoute.StartHour = dto.StartHour; plannedRoute.EstimatedDuration = dto.EstimatedDuration; plannedRoute.TotalDistance = dto.TotalDistance; plannedRoute.RouteDayOfTheWeek = dto.RouteDayOfTheWeek; plannedRoute.Active = dto.Active; plannedRoute.IsDeleted = dto.IsDeleted; plannedRoute.CreateBy = dto.CreateBy; plannedRoute.CreateOn = dto.CreateOn; plannedRoute.UpdateBy = dto.UpdateBy; plannedRoute.UpdateOn = dto.UpdateOn; return(plannedRoute); }