Ejemplo n.º 1
0
 public ActionResult EditProf(UserDTO user)
 {
     if (ModelState.IsValid)
     {
         DatAcessService.CreateUser(user);
         return(RedirectToAction("Index", "PersCAb"));
     }
     return(View(user));
 }
Ejemplo n.º 2
0
        public ActionResult EditUser(UserDTO user)
        {
            if (ModelState.IsValid)
            {
                DatAcessService.CreateUser(user);
                return(RedirectToAction("UserIndex", "UserManag", new { res = "changed" }));
            }
            var errors = ModelState.Where(x => x.Value.Errors.Any())
                         .Select(x => new { x.Key, x.Value.Errors });

            return(View(user));
        }