public ActionResult DeleteConfirmed(int id) { PatientsInfo patientsInfo = db.PatientsInfoes.Find(id); db.PatientsInfoes.Remove(patientsInfo); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "PatientID,Firstname,Lastname,DateOfBirth,AddressID,DocID")] PatientsInfo patientsInfo) { if (ModelState.IsValid) { db.Entry(patientsInfo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AddressID = new SelectList(db.Addresses, "AddressID", "Street", patientsInfo.AddressID); ViewBag.DocID = new SelectList(db.Doctors, "DoctID", "Firstname", patientsInfo.DocID); return(View(patientsInfo)); }
// GET: PatientsInfoes/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PatientsInfo patientsInfo = db.PatientsInfoes.Find(id); if (patientsInfo == null) { return(HttpNotFound()); } return(View(patientsInfo)); }
// GET: PatientsInfoes/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PatientsInfo patientsInfo = db.PatientsInfoes.Find(id); if (patientsInfo == null) { return(HttpNotFound()); } ViewBag.AddressID = new SelectList(db.Addresses, "AddressID", "Street", patientsInfo.AddressID); ViewBag.DocID = new SelectList(db.Doctors, "DoctID", "Firstname", patientsInfo.DocID); return(View(patientsInfo)); }