public ActionResult DeleteConfirmed(int id) { Order order = OrdersDB.GetOrderById(id); OrdersDB.DeleteOrder(order); return(RedirectToAction("Index")); }
// 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)); }
// 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)); }