Ejemplo n.º 1
0
        public IActionResult ChangeVehicle([FromForm] ChangeVehicleViewModel data)
        {
            var route   = routeService.GetById(data.RouteId);
            var vehicle = vehicleService.GetById(data.VehicleId);

            routeService.ChangeVehicle(route, vehicle);

            return(PartialView("_ChangeVehiclePartial", data));
        }
Ejemplo n.º 2
0
        public IActionResult ChangeVehicle([FromRoute] string id)
        {
            string RouteId = id;

            try
            {
                ChangeVehicleViewModel newRouteViewModel = new ChangeVehicleViewModel()
                {
                    RouteId = RouteId,
                    //VehicleId = vehicleId,
                    VehicleList = GetVehicleList()
                };

                return(PartialView("_ChangeVehiclePartial", newRouteViewModel));
            }

            catch (Exception e)
            {
                logger.LogError("Failed to load information for Route {@Exception}", e.Message);
                logger.LogDebug("Failed to load information for Route {@ExceptionMessage}", e);
                return(BadRequest(e.Message));
            }
        }