Пример #1
0
        private void confirmButtonPress(object sender, MouseButtonEventArgs e)
        {
            UITimers timer;

            if (!(output == null || output == ""))
            {
                int amount = Convert.ToInt32(output);
                timer = new UITimers();
                if (amount != 0 && amount % 5 == 0 && amount < customer.getBalance())
                {
                    caller.setAmount(amount);
                    WithdrawConfirmPopup confirm = new WithdrawConfirmPopup(caller, customer.getSymbol() + output, customer);
                    confirm.Show();
                    this.Close();
                }
                else if (amount > customer.getBalance())
                {
                    WithdrawErrorPopup errorPopup = new WithdrawErrorPopup();
                    errorPopup.Show();

                    output            = "";
                    amountOutput.Text = "";
                }
                else if (amount == 0 || amount % 5 != 0)
                {
                    timer.colorTimer(amountOutput, new SolidColorBrush(Color.FromArgb(0xFF, 0xF3, 0x5A, 0x5A)), 20);
                }
            }
            else
            {
                timer = new UITimers();
                timer.colorTimer(amountOutput, new SolidColorBrush(Color.FromArgb(0xFF, 0xF3, 0x5A, 0x5A)), 20);
            }
        }
Пример #2
0
        private void numericButtonPress(object sender, MouseButtonEventArgs e)
        {
            Label    label = (Label)sender;
            UITimers timer = new UITimers();

            timer.colorTimer(label, new SolidColorBrush(Color.FromArgb(255, 78, 123, 220)), 5);

            if (input.Length < 4)
            {
                input += label.Content;
                authenticatorOutput.Text += "•";

                if (input.Length == 4)
                {
                    confirmButton.Background  = new SolidColorBrush(Color.FromArgb(0xFF, 0x4B, 0xC9, 0x37));
                    confirmButton.Foreground  = new SolidColorBrush(Color.FromArgb(0xFF, 0xFF, 0xFF, 0xFF));
                    confirmButton.BorderBrush = new SolidColorBrush(Color.FromArgb(0xFF, 0x1B, 0x99, 0x07));
                }
            }
            else
            {
                SoundPlayer player = new SoundPlayer("../../Assests/Sounds/Error_Select.wav");
                player.Load();
                player.Play();
            }
        }
Пример #3
0
        private void numericButtonPress(object sender, MouseButtonEventArgs e)
        {
            Label    label = (Label)sender;
            UITimers timer = new UITimers();

            timer.colorTimer(label, new SolidColorBrush(Color.FromArgb(255, 78, 123, 220)), 5);

            if (amountOutput.Text.Length == 0)
            {
                if (label.Content.ToString() != "0")
                {
                    amountOutput.Text = customer.getSymbol() + label.Content;
                }
            }
            else
            {
                amountOutput.Text += label.Content;
            }
            output += label.Content;
        }