Exemple #1
0
        private void Read()
        {
            string choice = null;

            string msg = "";

            do
            {
                choice = UserInterface(3);

                switch (choice.ToUpper())
                {
                case "1":
                    Console.WriteLine("Enter bank's ID to list its accounts: ");
                    accountView.Read(long.Parse(Console.ReadLine()));     // expecting the user to input in correct form
                    msg = "\n----------------------------> \nPress a key to continue!";
                    break;

                case "2":
                    Console.WriteLine("Enter bank's ID to list its customers: ");
                    customerView.Read(long.Parse(Console.ReadLine()));     // expecting the user to input in correct form
                    msg = "\n----------------------------> \nPress a key to continue!";
                    break;

                case "3":
                    Console.WriteLine("Enter customer's ID to list their accounts: ");
                    accountView.Read(long.Parse(Console.ReadLine()), -1);     // expecting the user to input in correct form
                    msg = "\n----------------------------> \nPress a key to continue!";
                    break;

                case "4":
                    Console.WriteLine("Enter customer's ID to list their first account's transactions: ");
                    transactionView.Read(accountView.Read(long.Parse(Console.ReadLine()), 0));     // expecting the user to input in correct form
                    msg = "\n----------------------------> \nPress a key to continue!";
                    break;

                case "X":
                    msg = "\nChanging to customer menu\nPress a key to continue";
                    break;

                default:
                    msg = "Error occured - Press Enter and start over!";
                    break;
                }
                Console.WriteLine(msg);
                Console.ReadKey();
            }while (choice.ToUpper() != "X");
        }