Exemplo n.º 1
0
        public IActionResult AddCar([FromForm] AddCarViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            adminsService.AddCar(model.CarType, model.CivSeries,
                                 model.BodySeries, model.CarMileage,
                                 model.YearOfManufacture, model.ItpValability, model.OwnerFirstName,
                                 model.OwnerLastName, model.OwnerCNP);
            return(Redirect(Url.Action("Index", "Admins")));
        }