Example #1
0
        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));
        }