public ActionResult DeleteConfirmed(long id) { applied_treatments applied_treatments = db.applied_treatments.Find(id); db.applied_treatments.Remove(applied_treatments); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "AppliedTreatments_ID,Patient_ID,GlobalTreatment_ID,Date,Effect")] applied_treatments applied_treatments) { if (ModelState.IsValid) { db.Entry(applied_treatments).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.GlobalTreatment_ID = new SelectList(db.treatments, "GlobalTreatment_ID", "Treatment_Name", applied_treatments.GlobalTreatment_ID); ViewBag.Patient_ID = new SelectList(db.patients, "patients_ID", "First_Name", applied_treatments.Patient_ID); return(View(applied_treatments)); }
// GET: applied_treatments/Details/5 public ActionResult Details(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } applied_treatments applied_treatments = db.applied_treatments.Find(id); if (applied_treatments == null) { return(HttpNotFound()); } return(View(applied_treatments)); }
// GET: applied_treatments/Edit/5 public ActionResult Edit(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } applied_treatments applied_treatments = db.applied_treatments.Find(id); if (applied_treatments == null) { return(HttpNotFound()); } ViewBag.GlobalTreatment_ID = new SelectList(db.treatments, "GlobalTreatment_ID", "Treatment_Name", applied_treatments.GlobalTreatment_ID); ViewBag.Patient_ID = new SelectList(db.patients, "patients_ID", "First_Name", applied_treatments.Patient_ID); return(View(applied_treatments)); }