Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Order order = OrdersDB.GetOrderById(id);

            OrdersDB.DeleteOrder(order);
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        // GET: Orders/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Order order = OrdersDB.GetOrderById(id);

            if (order == null)
            {
                return(HttpNotFound());
            }
            return(View(order));
        }
Exemplo n.º 3
0
        // GET: Orders/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Order order = OrdersDB.GetOrderById(id);

            if (order == null)
            {
                return(HttpNotFound());
            }
            ViewBag.BuyerId  = new SelectList(db.Users, "PersonId", "Name", order.BuyerId);
            ViewBag.SellerId = new SelectList(db.Users, "PersonId", "Name", order.SellerId);
            return(View(order));
        }