Exemple #1
0
        public ActionResult ViewOrderStatus(int id)
        {
            order order = im.find(id);
            Session["ORDER"] = order;

            OrderVM orderVM = new OrderVM(order);
            if (order != null)
            {
                foreach (order_item oi in order.order_item)
                {
                    menu_item mi = Util.Order.OrderUtil.filterMenuItem(oi);
                    side si = Util.Order.OrderUtil.filterSide(oi);
                    OrderItemVM orderItemVM = new OrderItemVM(oi, mi, si);
                    orderVM.addItem(orderItemVM);
                }
            }

            return View("OrderUserDetails", orderVM);
        }
Exemple #2
0
        /*public ViewResult RetrieveOrderItems()
        {
            var orders = db.orders.Include(o => o.order_status).Include(o => o.user).Include(o => o.waiter).OrderBy(o => o.table_id).ThenBy(o => o.timestamp);

            return View();
        }  */
        public ActionResult Editing(int id)
        {
            order order = im.find(id);
            Session["ORDER"] = order;

            order.order_status = (int)OrderStatusHelper.OrderStatusEnum.EDITING;
            db.SaveChanges();

            OrderVM orderVM = new OrderVM(order);
            if (order != null)
            {
                foreach (order_item oi in order.order_item)
                {
                    menu_item mi = Util.Order.OrderUtil.filterMenuItem(oi);
                    side si = Util.Order.OrderUtil.filterSide(oi);
                    OrderItemVM orderItemVM = new OrderItemVM(oi, mi, si);
                    orderVM.addItem(orderItemVM);
                }
            }

            return View("ViewFromSession",orderVM);
        }
Exemple #3
0
        public ViewResult ViewFromSession()
        {
            order order = (order)Session["ORDER"];
            if (order == null)
            {
                user authUser = Util.User.UserUtil.getAuthenticatedUser(Request);
                if (authUser == null) return View("ViewFromSession", new OrderVM()); // failure
                order = Util.Session.SessionUtil.getOpenOrder(authUser);
            }

            OrderVM orderVM = new OrderVM(order);
            if (order != null)
            {
                foreach (order_item oi in order.order_item)
                {
                    menu_item mi = Util.Order.OrderUtil.filterMenuItem(oi);
                    side si = Util.Order.OrderUtil.filterSide(oi);
                    OrderItemVM orderItemVM = new OrderItemVM(oi, mi, si);
                    orderVM.addItem(orderItemVM);
                }
            }

            return View(orderVM);
        }
Exemple #4
0
 public void addItem(OrderItemVM item)
 {
     orderItemVMs.Add(item);
 }