Exemplo n.º 1
0
        /// <summary>
        /// Метод AnotherAction реализовывает функции для
        /// совершения дополнительных операций над лицевым счетом
        /// </summary>

        public void AnotherAction()
        {
            string    user;
            ATMScreen atm = new ATMScreen();

            atm.DisplayAnotherOperations();
            do
            {
                user = Console.ReadLine();
                switch (user)
                {
                case "1":
                {
                    PayTheBills();
                    break;
                }

                case "2":
                {
                    Transfer();
                    break;
                }

                case "3":
                {
                    atm.DisplayMenu();
                    break;
                }
                }
            } while (user != "3");
        }
Exemplo n.º 2
0
        public void Run()
        {
            string input;

            Console.WriteLine("Welcome");
            Console.WriteLine("Insert your card, please");
            Console.ReadKey();
            Console.WriteLine("Please, enter your password");
            var  userInput = Console.ReadLine();
            Bank bank      = new Bank();

            bank.Notify += (string s) => { Console.WriteLine(s); };
            var isValid = bank.CheckPassword(userInput);

            if (isValid)
            {
                var atmScreen = new ATMScreen();
                atmScreen.DisplayMenu();
            }
            else
            {
                Console.WriteLine("Invalid PIN number");
            }
            do
            {
                input = Console.ReadLine();
                switch (input)
                {
                case "1":
                {
                    bank.CheckBalance();
                    break;
                }

                case "2":
                {
                    bank.Withdrawal();
                    break;
                }

                case "3":
                {
                    bank.AnotherAction();
                    break;
                }
                }
            } while (input != "4");
        }