public ActionResult DeleteConfirmed(int id) { SampleAssay sampleAssay = db.SampleAssays.Find(id); db.SampleAssays.Remove(sampleAssay); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "SampleID,AssayID,Comment")] SampleAssay sampleAssay) { if (ModelState.IsValid) { db.Entry(sampleAssay).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AssayID = new SelectList(db.Assays, "AssayID", "Desc", sampleAssay.AssayID); ViewBag.SampleID = new SelectList(db.Samples, "SampleID", "SampleID", sampleAssay.SampleID); return(View(sampleAssay)); }
// GET: SampleAssays/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SampleAssay sampleAssay = db.SampleAssays.Find(id); if (sampleAssay == null) { return(HttpNotFound()); } return(View(sampleAssay)); }
// GET: SampleAssays/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SampleAssay sampleAssay = db.SampleAssays.Find(id); if (sampleAssay == null) { return(HttpNotFound()); } ViewBag.AssayID = new SelectList(db.Assays, "AssayID", "Desc", sampleAssay.AssayID); ViewBag.SampleID = new SelectList(db.Samples, "SampleID", "SampleID", sampleAssay.SampleID); return(View(sampleAssay)); }