Example #1
0
        public ActionResult Create([Bind(Include = "OrderId,BuyerId,SellerId")] Order order)
        {
            if (ModelState.IsValid)
            {
                OrdersDB.AddOrderToDB(order);
                return(RedirectToAction("Index"));
            }

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