Exemple #1
0
        private void AddCancelOrder(Order order)
        {
            List <Item>  processedItem         = new List <Item>();
            List <Item>  processedExistingItem = new List <Item>();
            List <Order> sourceOrders          = TotalOrders.Where(s => s.TableTabName == order.TableTabName).ToList();

            foreach (var sourceOrder in sourceOrders)
            {
                foreach (var newItem in order.Items)
                {
                    var existingItem = sourceOrder.Items.FirstOrDefault(s => s.OrderItemPosKey == newItem.OrderItemPosKey && !processedItem.Contains(s) &&
                                                                        !processedExistingItem.Contains(s));
                    if (existingItem != null)
                    {
                        processedExistingItem.Add(existingItem);
                        processedItem.Add(newItem);
                        if (!existingItem.DisplayAttributes.IsOriginalItem)
                        {
                            UpdateTransferProperty(existingItem);
                        }
                        existingItem.OrderStatus = OrderStatus.Canceled;
                        DbOrderItem.ItemBumped(existingItem.OrderItemKey, DateTime.Now);
                        DbOrderItem.UpdateOrderItemStatus(existingItem.OrderItemKey, OrderStatus.Canceled);
                    }
                }
            }
            order.Items.RemoveAll(s => processedItem.Contains(s));
            if (order.Items.Count > 0)
            {
                AddCreditOrder(order);
            }
        }
Exemple #2
0
 private void StartItem(Item item)
 {
     item.OrderStatus = OrderStatus.Started;
     item.SCourseGroup.OrderStatus       = OrderStatus.Started;
     item.CourseGroup.OrderStatus        = OrderStatus.Started;
     item.SCourseGroup.Order.OrderStatus = OrderStatus.Started;
     DbOrderItem.UpdateOrderItemStatus(item.OrderItemKey, OrderStatus.Started);
 }
Exemple #3
0
        private void UpdateItemTerminalKey(Item inItem)
        {
            // set item status to normal
            DbOrderItem.UpdateOrderItemStatus(inItem.OrderItemKey, OrderStatus.Normal);

            // update terminalKey for the item
            DbOrderItem.UpdateOrderItemTerminalKey(inItem.OrderItemKey, _outputTerminal.TerminalId);
        }
Exemple #4
0
        public void ChangeOrderStatus(Order order, OrderStatus inOrderStatus)
        {
            if (order != null)
            {
                // Set the orders status
                order.OrderStatus = inOrderStatus;

                foreach (Group group in order.DisplayGroups)
                {
                    foreach (Item item in group.Items)
                    {
                        DbOrderItem.UpdateOrderItemStatus(item.OrderItemKey, inOrderStatus);
                    }
                }
            }
        }
Exemple #5
0
        public void ChangeItemStatus(Item item, OrderStatus inStatus)
        {
            if (inStatus != OrderStatus.Canceled)
            {
                item.OrderStatus = inStatus;
                if (item.OrderItemKey > 0)
                {
                    DbOrderItem.UpdateOrderItemStatus(item.OrderItemKey, inStatus);
                }

                var group = ChefmateController.Instance.CurrentSettings.GroupType == GroupType.ServingCourse ? item.SCourseGroup : item.CourseGroup;
                if (group != null)
                {
                    CheckStatus(group);
                }
            }
        }