예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            ProductOrder productOrder = ProductOrderDB.GetProductOrderById(id);

            ProductOrderDB.DeleteProductOrder(productOrder);
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "OrderId,ProductId")] ProductOrder productOrder)
 {
     if (ModelState.IsValid)
     {
         ProductOrderDB.UpdateProductOrder(productOrder);
         return(RedirectToAction("Index"));
     }
     ViewBag.ProductId = new SelectList(db.Miniatures, "MiniId", "Name", productOrder.ProductId);
     ViewBag.OrderId   = new SelectList(db.Orders, "OrderId", "OrderId", productOrder.OrderId);
     return(View(productOrder));
 }
예제 #3
0
        // GET: ProductOrders/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ProductOrder productOrder = ProductOrderDB.GetProductOrderById(id);

            if (productOrder == null)
            {
                return(HttpNotFound());
            }
            return(View(productOrder));
        }
예제 #4
0
        // GET: ProductOrders/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ProductOrder productOrder = ProductOrderDB.GetProductOrderById(id);

            if (productOrder == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ProductId = new SelectList(db.Miniatures, "MiniId", "Name", productOrder.ProductId);
            ViewBag.OrderId   = new SelectList(db.Orders, "OrderId", "OrderId", productOrder.OrderId);
            return(View(productOrder));
        }