public ActionResult DeleteConfirmed(int id)
        {
            orderDetail orderDetail = db.orderDetails.Find(id);

            db.orderDetails.Remove(orderDetail);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "orderDetail_ID,orderID,itemID,quantity")] orderDetail orderDetail)
 {
     if (ModelState.IsValid)
     {
         db.Entry(orderDetail).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.itemID  = new SelectList(db.items, "itemId", "snackType", orderDetail.itemID);
     ViewBag.orderID = new SelectList(db.orders, "orderId", "orderStatus", orderDetail.orderID);
     return(View(orderDetail));
 }
        // GET: orderDetails/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            orderDetail orderDetail = db.orderDetails.Find(id);

            if (orderDetail == null)
            {
                return(HttpNotFound());
            }
            return(View(orderDetail));
        }
        // GET: orderDetails/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            orderDetail orderDetail = db.orderDetails.Find(id);

            if (orderDetail == null)
            {
                return(HttpNotFound());
            }
            ViewBag.itemID  = new SelectList(db.items, "itemId", "snackType", orderDetail.itemID);
            ViewBag.orderID = new SelectList(db.orders, "orderId", "orderStatus", orderDetail.orderID);
            return(View(orderDetail));
        }