Пример #1
0
        private void Create()
        {
            string choice = null;

            string msg = "";

            do
            {
                choice = UserInterface(2);

                switch (choice.ToUpper())
                {
                case "1":
                    accountView.Create(customerView.Create());
                    msg = "\n----------------------------> \nPress a key to continue!";
                    break;

                case "2":
                    Console.WriteLine("Enter customer's ID you want to add an account: ");
                    accountView.Create(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 first account's transactions: ");
                    long    customerId = long.Parse(Console.ReadLine());
                    string  IBAN       = accountView.Read(customerId, 0);
                    decimal amount     = transactionView.Create(IBAN); // expecting the user to input in correct form
                    accountView.Update(IBAN, amount);
                    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");
        }