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