예제 #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));
        }
예제 #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));
            }
        }