예제 #1
0
        private void AddTransferOrder(Order order)
        {
            order.FilterOrders(CurrentSettings.GroupType, CurrentSettings.OrderInfoDisplay);
            List <Order> sourceOrders = TotalOrders.Where(s => s.TableTabName == order.SourceTableName).ToList();

            order.DisplayAttributes.SourceTabTableText = order.SourceTableName;
            var destinationOrders = TotalOrders.FirstOrDefault(s => s.TableTabName == order.TableTabName);

            if (destinationOrders != null)
            {
                ProcessTransferWhenDestinationExist(sourceOrders, order, destinationOrders);
                destinationOrders.DisplayAttributes.SourceTabTableText = order.DisplayAttributes.SourceTabTableText;
            }
            else
            {
                order.OrderState = OrderState.Complete;
                DbOrder.AddOrder(order, CurrenTerminal.TerminalId, false);
                ProcessTransferWhenDestinationNotExist(sourceOrders, order);
                TotalOrders.Add(order);
                AnalyticalData.TotalOrdersCount++;
                AnalyticalData.CurrentOrdersCount++;
            }

            if (CurrentSettings.ConfirmOnTransfer)
            {
                ShowMessageBox("Order Transferred", order.SourceTableName + " is transferred to " + order.TableTabName);
            }
            TotalOrders.RemoveAll(s => s.Items.Count == 0);
            PublishRedrawEvent();
        }
예제 #2
0
 private void AddCompleteOrder(Order order)
 {
     if (order.OrderKey == 0)
     {
         DbOrder.AddOrder(order, CurrenTerminal.TerminalId);
     }
     if (OutputTime.Immediately == CurrentSettings.OutputTime)
     {
         OutputController.Instance.OutputOrder(order);
     }
     else
     {
         if (order.OrderState == OrderState.Complete || order.OrderState == OrderState.Runner)
         {
             AnalyticalData.TotalOrdersCount++;
             AnalyticalData.CurrentOrdersCount++;
             AnalyticalData.CurrentItems += order.Items.Count;
         }
         TotalOrders.Add(order);
     }
 }