コード例 #1
0
        public ActionResult New()
        {
            var foodLists      = BizLogic.GetFoodList();
            var orderViewModel = new ViewModels.OrderFormViewModel
            {
                Order     = new Order_View(),
                FoodLists = foodLists
            };

            return(View("New", orderViewModel));
        }
コード例 #2
0
        public ActionResult EditOrder(int orderid)
        {
            Order      o  = BizLogic.GetOrderbyOrderID(orderid);
            Order_View ov = new Order_View();

            ov.OrderId  = o.OrderId;
            ov.UserName = o.UserName;
            ov.FoodID   = o.FoodID;
            ov.Size     = o.Size;
            ov.Chilli   = o.Chilli == "Y";
            ov.MoreSalt = o.MoreSalt == "Y";
            ov.Pepper   = o.Pepper == "Y";
            var foodLists      = BizLogic.GetFoodList();
            var orderViewModel = new ViewModels.OrderFormViewModel
            {
                Order     = ov,
                FoodLists = foodLists
            };

            return(View("New", orderViewModel));
        }