Exemple #1
0
        //TODO: (Damian) Zo veel mogelijk copy-pasta verwijderen (aka. de input.Equals in eigen methode)

        private void ChoiceHandler()
        {
            if (input.Equals("1"))
            {
                WindowSwitcher.OpenBalanceWindow();
            }

            else if (input.Equals("2"))
            {
                WindowSwitcher.OpenWithdrawWindow();
            }

            else if (input.Equals("3"))
            {
                if (!BillHandler.isWithdrawable(70))
                {
                    return;
                }
                else
                {
                    User.SetBalanceInput("70");
                    User.SetReceipt(false);
                    WindowSwitcher.OpenConfirm();
                }
            }
        }
Exemple #2
0
        public WithdrawWindow()
        {
            InitializeComponent();

            double money = User.GetBalance();

            if (money < 10)
            {
                _1.IsEnabled = false;
            }
            if (money < 10)
            {
                _7.IsEnabled = false;
            }
            if (money < 20)
            {
                _2.IsEnabled = false;
            }
            if (money < 50)
            {
                _3.IsEnabled = false;
            }
            if (money < 100)
            {
                _4.IsEnabled = false;
            }
            if (money < 200)
            {
                _5.IsEnabled = false;
            }
            if (money < 500)
            {
                _6.IsEnabled = false;
            }

            if (!BillHandler.isWithdrawable(10))
            {
                _1.IsEnabled = false;
            }

            if (!BillHandler.isWithdrawable(20))
            {
                _2.IsEnabled = false;
            }

            if (!BillHandler.isWithdrawable(50))
            {
                _3.IsEnabled = false;
            }

            if (!BillHandler.isWithdrawable(100))
            {
                _4.IsEnabled = false;
            }

            if (!BillHandler.isWithdrawable(200))
            {
                _5.IsEnabled = false;
            }

            if (!BillHandler.isWithdrawable(500))
            {
                _6.IsEnabled = false;
            }
        }