Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 3
0
        private void takeCardButtonPush(object sender, MouseButtonEventArgs e)
        {
            moneyBorder.Visibility   = Visibility.Hidden;
            cardBorder.Visibility    = Visibility.Hidden;
            confirmBorder.Visibility = Visibility.Visible;

            if (customer != null)
            {
                customer.updateFile();
            }

            UITimers timer = new UITimers();

            timer.exitTimer(this, 50);
        }
        private void WithdrawButtonPush(object sender, MouseButtonEventArgs e)
        {
            Label label   = (Label)sender;
            int   ammount = Convert.ToInt32(label.Content.ToString().Split('£')[1]);

            if (customer.withdraw(ammount))
            {
                Console.WriteLine("Success");
                WithdrawConfirmPopup confirm = new WithdrawConfirmPopup(this, label.Content.ToString(), customer);
                confirm.Show();
            }
            else
            {
                Console.WriteLine("Not Enough Funds");
                UITimers           timer      = new UITimers();
                WithdrawErrorPopup errorPopup = new WithdrawErrorPopup();
                errorPopup.Show();
                timer.popUpWindowTimer(errorPopup, 15);
            }
        }
Ejemplo n.º 5
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;
        }
        public ResetPinPopup(ResetPinWindow caller, bool isSuccessful)
        {
            InitializeComponent();
            this.caller       = caller;
            this.isSuccessful = isSuccessful;

            timer = new UITimers();
            timer.popUpWindowTimer(this, 20);

            if (isSuccessful)
            {
                successContent.Visibility = Visibility.Visible;
                failedContent.Visibility  = Visibility.Hidden;
                contentBorder.BorderBrush = new SolidColorBrush(Color.FromArgb(0xFF, 0x2B, 0xE2, 0x0E));
            }
            else
            {
                successContent.Visibility = Visibility.Hidden;
                failedContent.Visibility  = Visibility.Visible;
            }
        }
        private void Window_ContentRendered(object sender, EventArgs e)
        {
            UITimers timer = new UITimers();

            timer.popUpWindowTimer(this, 15);
        }