// GET: Patients/Edit/5 public async Task <IActionResult> Edit(int?id) { if (id == null) { return(NotFound()); } PatientViewModel patient = await PatientsHelper.GetPatientByIdAsync((int)id); if (patient == null) { return(NotFound()); } return(View(patient)); }
// GET: Patients/Delete/5 public async Task <IActionResult> Delete(int?id, bool?saveChangesError = false) { if (id == null) { return(NotFound()); } PatientViewModel patient = await PatientsHelper.GetPatientByIdAsync((int)id); if (patient == null) { return(NotFound()); } if (saveChangesError.GetValueOrDefault()) { ViewData["ErrorMessage"] = "Delete failed. Try again, and if the problem persists " + "see your system administrator."; } return(View(patient)); }