public ActionResult EditPatient(int id) { NewPatient patient = new Dataaccess().Update(id); if (patient == null) { return RedirectToAction("Show"); } return View(patient); }
public ActionResult PatientDelete(int id) { NewPatient patient1= new Dataaccess().Update(id); if(patient1 == null) { return RedirectToAction("Show"); } else { return View(patient1); } }
public ActionResult PatientDelete(NewPatient patient) { int k1 = new Dataaccess().Delete(patient.Id); if (k1 == 1) { TempData["ErrorMessage"] = "Patient Deleted"; return RedirectToAction("Show", patient); } else { return View(); } }
public ActionResult EditPatient(NewPatient patient1) { if (ModelState.IsValid) { int k = new Dataaccess().Edit(patient1); if (k == 1) { TempData["ErrorMessage"] = "Edit Successfully"; return RedirectToAction("Show",patient1); } else return View(patient1); } return View(); }
public ActionResult Show() { List<NewPatient> patients = new Dataaccess().SelectPatient(); return View(new Patientviewmodel(){Patients = patients} ); }
public ActionResult PatientDetails(int id) { List<NewPatient> patients = new Dataaccess().Fetch(id); return PartialView(new Patientviewmodel(){Patients = patients}); }