Beispiel #1
0
        private void ButtonClick(object sender, RoutedEventArgs e)
        {
            decimal money;

            if (!string.IsNullOrEmpty(tbS.Text) && decimal.TryParse(tbS.Text.Trim(), out money) &&
                FunctionsService.PayWithValidation(sender, money, MaxMoney, PayType))
            {
                FunctionsService.Click(sender);
            }
        }
Beispiel #2
0
        private void ButtonClick(object sender, RoutedEventArgs e)
        {
            var button = sender as Button;

            if (button?.ToolTip != null && button.ToolTip.ToString() == "WNumPadMini")
            {
                string getValue = button.Name.Remove(0, 1);

                switch (getValue)
                {
                case "Sup":
                    TextBox.Text = "";
                    break;

                case "Entree":
                    var window = Tag as WPayEtc;
                    if (window != null)
                    {
                        decimal money;
                        if (!string.IsNullOrEmpty(window.tbS.Text) &&
                            decimal.TryParse(window.tbS.Text.Trim(), out money) &&
                            FunctionsService.PayWithValidation(sender, money, window.MaxMoney, window.PayType))
                        {
                            FunctionsService.Click(BEnter);
                        }
                    }
                    else
                    {
                        FunctionsService.Click(BEnter);
                    }
                    break;

                case "Point":
                    TextBox.Text += ",";
                    break;

                default:
                    if (Clr)
                    {
                        TextBox.Text = "";
                    }
                    int f;
                    if (int.TryParse(getValue, out f))
                    {
                        TextBox.Text += getValue;
                    }
                    break;
                }

                Clr = false;
            }
        }