public ActionResult Edit(RegistrarsDataModel registrarsRepository)
        {
            if (_RegistrarsService.GetById(registrarsRepository.Id) == null)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _RegistrarsService.EditRegistrar(registrarsRepository);
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RegistrarsRepositoryExists(registrarsRepository.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(registrarsRepository));
        }
Ejemplo n.º 2
0
        public ActionResult Edit(RegistrarsDataModel registrarsRepository)
        {
            if (_RegistrarsService.GetById(registrarsRepository.Id) == null)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                _RegistrarsService.EditRegistrar(registrarsRepository);



                return(RedirectToAction(nameof(Index)));
            }
            return(View(registrarsRepository));
        }