Пример #1
0
        public ActionResult AddOwner(OwnerViewModel ownerModel, int[] selectedCar)
        {
            OwnerDTO owner = ownerModel.Owner;

            if (ModelState.IsValid)
            {
                _ownerService.AddOrUpdateOwnerDto(owner, selectedCar);
                return(RedirectToAction(MethodName.OwnersList));
            }
            ViewBag.ListCar = _carService.GetCarsDtoList();
            return(View(MethodName.AddOrUpdateOwner, ownerModel));
        }