public ActionResult <RoutePatchDTO> GetById([FromRoute] int id) // To do zmiany { RoutePatchDTO rs = new RoutePatchDTO(); var route = _RouteService.GetById(id); var stops = _StopToRouteService.GetById(id); //should return all rs.Id = route.Id; rs.Name = route.Name; rs.Stops = stops; return(Ok(rs)); }
private List <SelectListItem> GetOrderListFromRoute(string id) { var route = routeService.GetById(id); var routes = route.RouteEntries; // var orders = orderService.GetAllOrders(); List <SelectListItem> orderNames = new List <SelectListItem>(); foreach (var order in routes) { orderNames.Add(new SelectListItem(order.Order.DeliveryAddress.PostalCode, order.Id.ToString())); } return(orderNames); }
public ActionResult <List <Ride> > GetAll() { var r = _rideService.GetAll(); var rides = r.Select(x => new Ride { Id = x.Id, Price = x.Price, Route = _routeService.GetById(x.RouteId), RouteId = x.RouteId, StartTime = x.StartTime, Train = _trainService.GetById(x.TrainId), TrainId = x.TrainId, IsEveryDayRide = x.IsEveryDayRide }).ToList(); return(Ok(rides)); }
public UpdateRouteWindow(int existingRouteId) { InitializeComponent(); countryService = new CountryService(); routeService = new RouteService(); this.existingRoute = routeService.GetById(existingRouteId); InitializeInitialFields(); PrepopulateRouteInformation(existingRoute); }
public IActionResult AssignRoute([FromForm] AssignRouteViewModel data) { var userId = userManager.GetUserId(User); var dispatcherDb = dispatcherService.GetByUserId(userId); if (ModelState.IsValid) { var driver = driverService.GetByUserId(data.DriverId); var route = routeService.GetById(data.RouteId); dispatcherService.ConnectDriverToRoute(route, driver, dispatcherDb); } return(PartialView("_AssignRoutePartial", data)); }
public RouteModel GetById(int id) { return(_service.GetById(id)); }