public async Task <IActionResult> Edit(int id, [Bind("Id,Nombres,Apellidos")] PersonaNatural personaNatural) { if (id != personaNatural.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(personaNatural); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PersonaNaturalExists(personaNatural.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(personaNatural)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,NumeroDocumento,FechaCreacion")] Persona persona) { if (id != persona.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(persona); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PersonaExists(persona.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(persona)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Direccion,Ciudad")] Localizacion localizacion) { if (id != localizacion.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(localizacion); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LocalizacionExists(localizacion.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(localizacion)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre")] TipoDocumento tipoDocumento) { if (id != tipoDocumento.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tipoDocumento); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TipoDocumentoExists(tipoDocumento.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tipoDocumento)); }