Ejemplo n.º 1
0
        private OrderModel GetTableModel(Int32 tableId) {
            OrderModel model = new OrderModel();
            try {
                model.Referer = "Tables";
                if (Request.UrlReferrer != null && Request.UrlReferrer.LocalPath.IndexOf("Order/Monitor") > -1) {
                    model.Referer = "Monitor";
                }
                model.Categories = _categoryService.GetCategories(SessionData.customer.id, Common.CategoryType.Menu);
                model.Table = _orderService.GetTable(tableId);
                model.TableOrder = _orderService.GetTableOrder(tableId);
                model.TableId = model.Table.id;
                model.Table.Name = model.Table.Name;

                if (model.TableOrder != null && model.TableOrder.Checks != null) {
                    model.Checks = new List<Models.Check>();
                    foreach (Services.Check checkItem in model.TableOrder.Checks) {
                        Models.Check check = new Models.Check();
                        check.id = checkItem.id;
                        check.Price = 0;
                        check.Status = (Common.CheckStatus)checkItem.Status;
                        check.Type = (Common.CheckType)checkItem.Type;
                        check.CheckMenuItems = new List<CheckMenuItem>();
                        model.Checks.Add(check);
                    }
                }

                model.Menu = GetMenus();

                return model;
            }
            catch (Exception ex) {
                base.Log(ex);
            }
            finally {
            }
            return null;
        }
Ejemplo n.º 2
0
 public String GetCurrentMenu(Int32 id) {
     OrderModel model;
     try {
         model = new OrderModel();
         model.Categories = _categoryService.GetMenuCategories(SessionData.customer.id, Common.CategoryType.Menu, id);
         return RenderViewToString(this.ControllerContext, "_OrderMenuPartial", model);
     }
     catch (Exception ex) {
         base.Log(ex);
     }
     finally {
     }
     return null;
 }