public IActionResult AddImagesToRoad(EditRoadViewModel model) { var road = this.roadsService.GetRoadById(model.Id); if (model.NewImages == null) { return(RedirectToAction("Error")); } var images = this.roadsService.AddImagesToRoad(model.NewImages, road.Id); return(this.Redirect($"/Roads/Home/EditRoadPictures/{road.Id}")); }
public IActionResult EditRoad(EditRoadViewModel model) { var road = this.roadsService.GetRoadById(model.Id); if (road == null) { return(NotFound()); } var result = this.roadsService.Edit(model.Id, model.RoadName, model.StartingPoint, model.EndPoint, model.RoadLength, model.Description, model.Video, model.CoverPhoto, model.ViewRating, model.SurfaceRating, model.PleasureRating); return(this.RedirectToAction("Index", "Home")); }