Пример #1
0
        private KitchenModel GetKitchenModel()
        {
            KitchenModel             model  = new KitchenModel();
            List <Models.TableOrder> tables = new List <Models.TableOrder>();

            Models.TableOrder          order;
            List <Services.TableOrder> alltables = new List <Services.TableOrder>();

            Services.Table table;
            try {
                alltables = _orderService.GetKitchenOrders();
                foreach (Services.TableOrder tab in alltables)
                {
                    order           = new Models.TableOrder();
                    table           = _orderService.GetTable(tab.TableId);
                    order.TableName = table.Name;
                    order.Order     = tab;
                    tables.Add(order);
                }
                model.Tables = tables;
                return(model);
            }
            catch (Exception ex) {
                base.Log(ex);
            }
            finally {
            }

            return(null);
        }
Пример #2
0
        private MonitorFloorModel GetMonitorModel(Int32?id)
        {
            MonitorFloorModel        model  = new MonitorFloorModel();
            List <Models.TableOrder> tables = new List <Models.TableOrder>();

            Models.TableOrder          order;
            List <Services.TableOrder> alltables = new List <Services.TableOrder>();

            Services.Floor floor;
            Services.Table table;
            try {
                id           = id.HasValue ? id.Value : 0;
                model.Floors = _floorService.GetFloors(SessionData.customer.id);
                if (id == 0)
                {
                    floor      = new Services.Floor();
                    floor.id   = 0;
                    floor.Name = Resources.Resource.COMMON_ALL;
                }
                else
                {
                    floor = _floorService.GetFloor(id.Value);
                    if (floor == null && model.Floors.Count > 0)
                    {
                        floor = model.Floors[0];
                    }
                }
                model.Floor = new Models.MonitorFloor();
                if (floor != null)
                {
                    SessionData.floor = floor;
                    model.Floor.id    = floor.id;
                    model.Floor.Name  = floor.Name;
                    alltables         = _orderService.GetTableOrdersByFloorId(model.Floor.id, SessionData.customer.id);
                    if (alltables != null)
                    {
                        foreach (Services.TableOrder tab in alltables)
                        {
                            order           = new Models.TableOrder();
                            table           = _orderService.GetTable(tab.TableId);
                            order.TableName = table.Name;
                            order.Order     = tab;
                            tables.Add(order);
                        }
                    }
                    model.Floor.Tables = tables;
                    model.Inventory    = _orderService.LatestInventory(SessionData.customer.id);
                    model.Sales        = _orderService.LatestSale(SessionData.customer.id);
                }
                return(model);
            }
            catch (Exception ex) {
                base.Log(ex);
            }
            finally {
            }

            return(null);
        }
Пример #3
0
        private MonitorFloorModel GetMonitorModel(Int32? id) {
            MonitorFloorModel model = new MonitorFloorModel();
            List<Models.TableOrder> tables = new List<Models.TableOrder>();
            Models.TableOrder order;
            List<Services.TableOrder> alltables = new List<Services.TableOrder>();
            Services.Floor floor;
            Services.Table table;
            try {
                id = id.HasValue ? id.Value : 0;
                model.Floors = _floorService.GetFloors(SessionData.customer.id);
                if (id == 0) {
                    floor = new Services.Floor();
                    floor.id = 0;
                    floor.Name = "All";
                }
                else {
                    floor = _floorService.GetFloor(id.Value);
                    if (floor == null && model.Floors.Count > 0) {
                        floor = model.Floors[0];
                    }
                }
                model.Floor = new Models.MonitorFloor();
                if (floor != null) {
                    SessionData.floor = floor;
                    model.Floor.id = floor.id;
                    model.Floor.Name = floor.Name;
                    alltables = _orderService.GetTableOrdersByFloorId(model.Floor.id);
                    if (alltables != null) {
                        foreach (Services.TableOrder tab in alltables) {
                            order = new Models.TableOrder();
                            table = _orderService.GetTable(tab.TableId);
                            order.TableName = table.Name;
                            order.Order = tab;
                            tables.Add(order);
                        }
                    }
                    model.Floor.Tables = tables;
                }
                return model;
            }
            catch (Exception ex) {
                base.Log(ex);
            }
            finally {
            }

            return null;
        }
Пример #4
0
        private KitchenModel GetKitchenModel() {
            KitchenModel model = new KitchenModel();
            List<Models.TableOrder> tables = new List<Models.TableOrder>();
            Models.TableOrder order;
            List<Services.TableOrder> alltables = new List<Services.TableOrder>();
            Services.Table table;
            try {
                alltables = _orderService.GetKitchenOrders();
                foreach (Services.TableOrder tab in alltables) {
                    order = new Models.TableOrder();
                    table = _orderService.GetTable(tab.TableId);
                    order.TableName = table.Name;
                    order.Order = tab;
                    tables.Add(order);
                }
                model.Tables = tables;
                return model;
            }
            catch (Exception ex) {
                base.Log(ex);
            }
            finally {
            }

            return null;
        }