public async Task <IActionResult> Edit(int id, [Bind("Id,TipoTurno,FechaTurno")] Turno turno) { if (id != turno.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(turno); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TurnoExists(turno.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["PacienteID"] = new SelectList(_context.pacientes, "ID", "Apellido", turno.PacienteID); return(View(turno)); }
public async Task<IActionResult> Edit(int id, [Bind("ID,Nombre,Apellido,Direccion,Dni,Telefono,Mail")] 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)); } return View(paciente); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Mail,Pass")] Admin admin) { if (id != admin.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(admin); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AdminExists(admin.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(admin)); }