Example #1
0
        public async Task <IActionResult> CreateRoute([FromBody] CreateRouteDto routeDto)
        {
            var route = _mapper.Map <Route>(routeDto);
            await _routeService.CreateRouteAsync(route, CurrentUserId);

            return(Ok());
        }
Example #2
0
        public async Task <ActionResult> CreateOrUpadateRoute(EditRouteViewModel route)
        {
            if (route.RouteId == default(int))
            {
                await _routeService.CreateRouteAsync(route.Name, route.CarId, route.DepartureParkingId, route.ArrivalParkingId);
            }
            else
            {
                await _routeService.UpadeRouteAsync(route.RouteId, route.Name, route.CarId, route.DepartureParkingId, route.ArrivalParkingId);
            }

            var routes = await _routeViewModelService.GetAllRouteAsync();

            return(RedirectToAction("MyRoutes"));
        }
Example #3
0
 public async Task <CreateRouteResponseModel> CreateRoute(CreateRouteRequestModel createRouteRequest)
 {
     return(await _routeService.CreateRouteAsync(createRouteRequest));
 }