コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: radtek/Pos
        private bool BumpByTableNumber(string tableNumber)
        {
            var order = CurrentDisplayOrders.FirstOrDefault(s => s.TableTabName.Contains(tableNumber));

            if (order != null && IsOrderInView(order))
            {
                OrderController.Instance.BumpOrder(order);
                return(true);
            }
            return(false);
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: radtek/Pos
        private void BumpByLoacation(Key pressedKey)
        {
            bool doBump = false;

            CurrentDisplayOrders.ToList().ForEach(s => s.DisplayAttributes.ExecutePopUp = false);
            switch (pressedKey)
            {
            case Key.D0:
            case Key.NumPad0:
                Forward(null);
                break;

            case Key.D1:
            case Key.NumPad1:
                _lastSelectedIndex = 0;
                break;

            case Key.D2:
            case Key.NumPad2:
                _lastSelectedIndex = 1;
                break;

            case Key.D3:
            case Key.NumPad3:
                _lastSelectedIndex = 2;
                break;

            case Key.D4:
            case Key.NumPad4:
                _lastSelectedIndex = 3;
                break;

            case Key.D5:
            case Key.NumPad5:
                _lastSelectedIndex = 4;
                break;

            case Key.D6:
            case Key.NumPad6:
                _lastSelectedIndex = 5;
                break;

            case Key.D7:
            case Key.NumPad7:
                _lastSelectedIndex = 6;
                break;

            case Key.D8:
            case Key.NumPad8:
                _lastSelectedIndex = 7;
                break;

            case Key.D9:
            case Key.NumPad9:
                Backward(null);
                break;

            case Key.Enter:
                doBump = true;
                break;

            case Key.Escape:
                _lastSelectedIndex = -1;
                this.Focus();
                break;
            }
            if (_lastSelectedIndex > -1)
            {
                if (CurrentDisplayOrders.Count > _lastSelectedIndex)
                {
                    var selectedOrder = TotalOrders[_lastSelectedIndex];
                    selectedOrder = CurrentDisplayOrders.FirstOrDefault(s => s.OrderKey == selectedOrder.OrderKey);
                    if (selectedOrder != null && IsOrderInView(selectedOrder))
                    {
                        if (doBump)
                        {
                            OrderController.Instance.BumpOrder(selectedOrder);
                            _lastSelectedIndex = -1;
                            RedrawOrders();
                        }
                        else
                        {
                            selectedOrder.DisplayAttributes.ExecutePopUp = true;
                        }
                    }
                }
            }
        }