コード例 #1
0
 private void NumberKeyPad_PadClick(object sender, NumberPadEventArgs e)
 {
     if (e.IsNumeric)
     {
         this.FieldPhone.Text = this.FieldPhone.Text + e.Number.ToString();
     }
     else if (e.IsCancel)
     {
         if (this.FieldPhone.Text.Length > 1)
         {
             this.FieldPhone.Text = this.FieldPhone.Text.Substring(0, this.FieldPhone.Text.Length - 1);
         }
         else
         {
             this.FieldPhone.Text = "";
         }
     }
     this.UpdateCustomerButton();
 }
コード例 #2
0
ファイル: NumberPad.cs プロジェクト: pattapong/smartClient
 protected virtual void OnPadClick(NumberPadEventArgs e)
 {
     if (this.PadClick != null)
     {
         this.PadClick(this, e);
     }
 }
コード例 #3
0
        private void NumberKeyPad_PadClick(object sender, NumberPadEventArgs e)
        {
            if (e.IsNumeric)
            {
                if ((this.inputState == 2) || (this.inputState == 20))
                {
                    this.StartInputMenu();
                }
                this.inputValue = this.inputValue + e.Number.ToString();
                this.UpdateMonitor();
            }
            else if (e.IsCancel)
            {
                if (this.inputValue.Length > 1)
                {
                    this.inputValue = this.inputValue.Substring(0, this.inputValue.Length - 1);
                    this.UpdateMonitor();
                }
                else
                {
                    this.StartInputMenu();
                }
            }
            else if (e.IsEnter)
            {
                int num;
                try
                {
                    num = int.Parse(this.inputValue);
                }
                catch (Exception)
                {
                    num = 0;
                }
                switch (this.inputState)
                {
                    case 0:
                    {
                        if ((num == 0) || (this.selectedBill == null))
                        {
                            break;
                        }
                        smartRestaurant.MenuService.MenuItem menuItemKeyID = MenuManagement.GetMenuItemKeyID(num);
                        if (menuItemKeyID == null)
                        {
                            break;
                        }
                        this.AddOrderBillItem(menuItemKeyID);
                        return;
                    }
                    case 1:
                        if (this.selectedItem == null)
                        {
                            break;
                        }
                        if ((num > 0) && (this.selectedItem.Unit != num))
                        {
                            this.selectedItem.Unit = num;
                            this.selectedItem.ChangeFlag = true;
                            this.isChanged = true;
                        }
                        this.StartInputMenu();
                        return;

                    case 10:
                        if (num > 0)
                        {
                            this.guestNumber = num;
                            this.UpdateTableInformation();
                        }
                        break;

                    case 11:
                        if (num > 0)
                        {
                            this.billNumber = num;
                            if (this.billNumber > this.guestNumber)
                            {
                                this.guestNumber = this.billNumber;
                            }
                            this.ChangeBillCount();
                            this.UpdateOrderGrid();
                            this.UpdateTableInformation();
                        }
                        break;
                }
                this.StartInputMenu();
            }
        }
コード例 #4
0
        private void NumberKeyPad_PadClick(object sender, NumberPadEventArgs e)
        {
            if (this.inputState != 0)
            {
                if (e.IsNumeric)
                {
                    if (this.inputState == 2)
                    {
                        try
                        {
                            this.inputValue = ((double.Parse(this.inputValue) * 10.0) + (0.01 * e.Number)).ToString("N");
                        }
                        catch (Exception)
                        {
                            this.inputValue = "0.0" + e.Number.ToString();
                        }
                    }
                    else
                    {
                        this.inputValue = this.inputValue + e.Number.ToString();
                    }
                    this.UpdateMonitor();
                }
                else if (e.IsCancel)
                {
                    if (this.inputState == 2)
                    {
                        try
                        {
                            double num2 = Math.Floor(double.Parse(this.inputValue) * 10.0) / 100.0;
                            this.inputValue = num2.ToString("N");
                            if (num2 == 0.0)
                            {
                                this.StartInputNone();
                                this.receipt.PaymentMethod = null;
                                this.UpdatePaymentTypeList();
                            }
                            else
                            {
                                this.UpdateMonitor();
                            }
                        }
                        catch (Exception)
                        {
                            this.StartInputNone();
                            this.receipt.PaymentMethod = null;
                            this.UpdatePaymentTypeList();
                        }
                        this.receipt.PaymentMethod = null;
                    }
                    else if (this.inputValue.Length > 1)
                    {
                        this.inputValue = this.inputValue.Substring(0, this.inputValue.Length - 1);
                        this.UpdateMonitor();
                    }
                    else
                    {
                        this.StartInputNone();
                    }
                }
                else if (e.IsEnter)
                {
                    this.inputValue = this.inputValue.Replace(",", "");
                    if (this.inputValue != "")
                    {
                        int num3;
                        double num4;
                        try
                        {
                            num3 = int.Parse(this.inputValue);
                        }
                        catch (Exception)
                        {
                            num3 = 0;
                        }
                        try
                        {
                            num4 = double.Parse(this.inputValue);
                        }
                        catch (Exception)
                        {
                            num4 = 0.0;
                        }
                        switch (this.inputState)
                        {
                            case 2:
                                this.receipt.PayValue = num4;
                                this.receipt.SetPaymentMethod(this.receipt.PaymentMethod, this.receipt.PayValue);
                                break;

                            case 3:
                                this.receipt.PointAmount = num3;
                                break;
                        }
                    }
                    this.receipt.PaymentMethod = null;
                    this.UpdatePaymentTypeList();
                    this.StartInputNone();
                    this.UpdateSummary();
                }
            }
        }