Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            DrugAbuse drugAbuse = db.DrugAbuses.Find(id);

            db.DrugAbuses.Remove(drugAbuse);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 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));
 }
Ejemplo n.º 3
0
        public ActionResult Create([Bind(Include = "DrugAbuseID,DrugAbuseType")] DrugAbuse drugAbuse)
        {
            if (ModelState.IsValid)
            {
                db.DrugAbuses.Add(drugAbuse);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(drugAbuse));
        }
Ejemplo n.º 4
0
        // 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));
        }