Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            DiscountCodeForItem discountCodeForItem = db.DiscountCodeForItems.Find(id);

            db.DiscountCodeForItems.Remove(discountCodeForItem);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "Item_idItem,DiscountCode_idDiscountCode,discount")] DiscountCodeForItem discountCodeForItem)
 {
     if (ModelState.IsValid)
     {
         db.Entry(discountCodeForItem).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DiscountCode_idDiscountCode = new SelectList(db.DiscountCodes, "idDiscountCode", "code", discountCodeForItem.DiscountCode_idDiscountCode);
     ViewBag.Item_idItem = new SelectList(db.Items, "idItem", "name", discountCodeForItem.Item_idItem);
     return(View(discountCodeForItem));
 }
Exemple #3
0
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DiscountCodeForItem discountCodeForItem = db.DiscountCodeForItems.Find(id);

            if (discountCodeForItem == null)
            {
                return(HttpNotFound());
            }
            return(View(discountCodeForItem));
        }
Exemple #4
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DiscountCodeForItem discountCodeForItem = db.DiscountCodeForItems.Find(id);

            if (discountCodeForItem == null)
            {
                return(HttpNotFound());
            }
            ViewBag.DiscountCode_idDiscountCode = new SelectList(db.DiscountCodes, "idDiscountCode", "code", discountCodeForItem.DiscountCode_idDiscountCode);
            ViewBag.Item_idItem = new SelectList(db.Items, "idItem", "name", discountCodeForItem.Item_idItem);
            return(View(discountCodeForItem));
        }