Ejemplo n.º 1
0
        public ActionResult AddOrUpdateCar(CarViewModel car)
        {
            if (ModelState.IsValid)
            {
                int currentCarId = car.Id;

                int newCarId = _driverService.AddOrUpdateCar(car, User.Identity.GetUserId());

                if (currentCarId == 0 && newCarId != 0)
                {
                    return(PartialView("~/Views/Settings/_carDetails.cshtml", car));
                }
            }

            return(PartialView("~/Views/Settings/_addNewCar.cshtml", car));
        }