Beispiel #1
0
        // Validates that the pin code is valid
        public void ValidateAccount(Card card, int input)
        {
            ATM atm = new ATM();

            ValidationMessages vm = new ValidationMessages();

            while (validatorBool)
            {
                if (validatorCount <= 1)
                {
                    if (input == card.Pin)
                    {
                        vm.ApprovedMessage();
                        validatorBool = false;
                        atm.FrontScreen(card);
                    }
                    else
                    {
                        validatorCount++;
                        validatorBool = true;
                        vm.DeclinedMessage();
                        atm.PromptPIN(card);
                    }
                }
                else
                {
                    vm.BlockMessage();
                    Console.ReadLine();
                    Environment.Exit(0);
                }
            }
        }
Beispiel #2
0
        //Checks if the current Balance is greater than the wanted amount
        public bool BalanceCheck(Card card, double wantedAmount)
        {
            bool            balancebool;
            ATM             atm             = new ATM();
            AccountMessages accountMessages = new AccountMessages();

            if (wantedAmount <= card.Balance)
            {
                Withdrawal(card, wantedAmount);
                accountMessages.BalanceCheck(card);
                return(true);
            }
            else
            {
                accountMessages.AccountInsuffiant();
                atm.FrontScreen(card);
                return(false);
            }
        }