public ActionResult Datos(FormCollection collection) { try { personaModel persona = new personaModel(); persona = (personaModel)Session["personaLogedIn" + Session.SessionID]; int oldDNI = persona.dni; long oldId = persona.id; persona.nombre = Request.Form["nombre"]; persona.apellido = Request.Form["apellido"]; persona.dni = int.Parse(Request.Form["dni"]); persona.fechaNacimiento = DateTime.ParseExact(Request.Form["fechaNacimiento"], "dd/MM/yyyy", null); persona.user.mail = Request.Form["user.mail"]; persona.user.password = Request.Form["user.password"]; persona.user.profile = Request.Form["user.profile"]; personaService pServ = new personaService(); userService uServ = new userService(); if ((pServ.updatePersonaByIdAndDNI(persona, oldDNI, oldId) == true) && (uServ.updateUsuarioByID(persona.user))) { return(RedirectToAction("ModificacionOK")); } else { return(View()); } } catch { return(View()); } }