public ActionResult DeleteConfirmed(int id) { Assay assay = db.Assays.Find(id); db.Assays.Remove(assay); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "AssayID,AssayName,AssayProtocol,EstimatedDaysToComplete")] Assay assay) { if (ModelState.IsValid) { db.Entry(assay).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(assay)); }
public ActionResult Create([Bind(Include = "AssayID,AssayName,AssayProtocol,EstimatedDaysToComplete")] Assay assay) { if (ModelState.IsValid) { db.Assays.Add(assay); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(assay)); }
// GET: Assays/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Assay assay = db.Assays.Find(id); if (assay == null) { return(HttpNotFound()); } return(View(assay)); }