Esempio n. 1
0
        private static void TestAddCustomer()
        {
            var customerToAdd = new Customer()
            {
                CustomerID  = "IDIDI",
                CompanyName = "SomeCompanyName"
            };

            customersManager.AddCustomer(customerToAdd);
        }
Esempio n. 2
0
        static void CustomersMenu()
        {
            int option = 0;

            while (option != 3)
            {
                Console.Clear();
                Console.WriteLine("CUSTOMERS MENU");
                Console.WriteLine("1. List All Customers");
                Console.WriteLine("2. Add a Customer");
                Console.WriteLine("3. Back to main menu");
                Console.WriteLine("Write the number of the actinon you want to take:");

                try
                {
                    option = Convert.ToInt32(Console.ReadLine());

                    switch (option)
                    {
                    case 1:
                        customersManager.ShowCustomers();
                        WaitForUserInput();
                        break;

                    case 2:
                        customersManager.AddCustomer();
                        WaitForUserInput();
                        break;

                    case 3:
                        break;

                    default:
                        option = 0;
                        break;
                    }
                }
                catch (FormatException)
                {
                    Console.WriteLine("Please enter a valid option (a number from 1 to 3.");
                    option = 0;
                }
            }
        }