public async Task <IActionResult> Edit(int id, [Bind("Id,TablaPacienteId,TablaProfesionalId,Fecha_atencion,Fecha_acabar,Observaciones,Fecha_registro")] TablaCitasPaciente tablaCitasPaciente) { if (id != tablaCitasPaciente.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tablaCitasPaciente); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TablaCitasPacienteExists(tablaCitasPaciente.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tablaCitasPaciente)); }
public async Task <IActionResult> Create([Bind("Id,TablaPacienteId,TablaProfesionalId,Fecha_atencion,Fecha_acabar,Observaciones,Fecha_registro")] TablaCitasPaciente tablaCitasPaciente) { if (ModelState.IsValid) { _context.Add(tablaCitasPaciente); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(tablaCitasPaciente)); }