public async Task <IActionResult> Edit(long?Id, [Bind("PacienteId, Nome, Cpf, Idade, Email, Sexo, Endereco, Cep, Telefone")] Paciente paciente) { if (Id != paciente.PacienteId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(paciente); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PacienteExists(paciente.PacienteId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(paciente)); }
public async Task <IActionResult> Edit(long?Id, [Bind("MedicoId, Nome, Crm, Especialidade ")] Medico medico) { if (Id != medico.MedicoId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(medico); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MedicoExists(medico.MedicoId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(medico)); }
public async Task <IActionResult> Edit(long?Id, [Bind("ConsultaId, Horário, Dia, Sintomas, Cpf, MedicoEsp")] Consulta consulta) { if (Id != consulta.ConsultaId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(consulta); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ConsultaExists(consulta.ConsultaId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(consulta)); }