Beispiel #1
0
        private static void GetCustomerInfo(int count)
        {
            if (count > 2)
            {
                Console.WriteLine("\n\nYou have entered an incorrect password 3 times. Goodbye.\n");
                return;
            }

            // prompt for the password
            Console.WriteLine("\n\nWe need to verify your identity to access the First Third customer Portal."
                +"\nPlease enter your account number:\n(Hint: 10001 - 10050)\n");
            String str = Console.ReadLine();
            int accountNumber = int.Parse(str);

            // compare the password if it matches start the portal otherwise try again
            if (accountNumber > 10000 && accountNumber < 10051)
            {
                Customer customer = new Customer(accountNumber,pseudoDatabase);
                customer.StartPortal();
                pseudoDatabase = customer.GetPseudoDatabase();
            }
            else
            {
                Console.WriteLine("\n\nYou have entered and incorrect password."
                    + "\nYou have " + (2 - count) + " more chances to enter the correct password.");
                GetCustomerInfo(++count);
            }
        }