public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,SexoPaciente,PrematuroPaciente")] Calendario calendario) { if (id != calendario.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(calendario); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CalendarioExists(calendario.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(calendario)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,Apellido,Dni,FechaNacimiento,Sexo,Prematuro,Peso,Domicilio,TutorId,CalendarioId")] Paciente paciente) { if (id != paciente.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(paciente); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PacienteExists(paciente.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CalendarioId"] = new SelectList(_context.Calendarios, "Id", "Nombre", paciente.CalendarioId); ViewData["TutorId"] = new SelectList(_context.Tutores, "Id", "Apellido", paciente.TutorId); return(View(paciente)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,Apellido,Email")] Tutor tutor) { if (id != tutor.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tutor); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TutorExists(tutor.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tutor)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,PeriodoAplicación,Beneficios")] Vacuna vacuna) { if (id != vacuna.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(vacuna); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VacunaExists(vacuna.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(vacuna)); }