Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            HackySack hackySack = db.hackySacks.Find(id);

            db.hackySacks.Remove(hackySack);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "ID,Color,FillBeads,Type,Price,Quantity")] HackySack hackySack)
 {
     if (ModelState.IsValid)
     {
         db.Entry(hackySack).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(hackySack));
 }
Example #3
0
        public ActionResult Create([Bind(Include = "ID,Color,FillBeads,Type,Price,Quantity")] HackySack hackySack)
        {
            if (ModelState.IsValid)
            {
                db.hackySacks.Add(hackySack);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(hackySack));
        }
Example #4
0
        // GET: HackySacks/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HackySack hackySack = db.hackySacks.Find(id);

            if (hackySack == null)
            {
                return(HttpNotFound());
            }
            return(View(hackySack));
        }