///<summary>Main Menu for customer operations</summary>
        public void MainMenu()
        {
            string input;

            do
            {
                Console.WriteLine("Welcome to the Customer Records! \n What would you like to do?");
                Console.WriteLine(" [0] Add Customers \n [1] Search Customers \n [2] Get Customer History \n [3] Go back to Main Menu \n [4] Exit");
                input = Console.ReadLine();
            } while (ErrorHandler.InvalidIntInput(input));

            switch (input)
            {
            case "0":
                //Go to Add Customer UI
                AddCustomerMenu();
                break;

            case "1":
                //Go to Search Customer UI
                SearchCustomerMenu();
                break;

            case "2":
                //Go to Customer History UI
                AdminOrder ao = new AdminOrder();
                ao.ViewCustomerOrderHistory();
                break;

            case "3":
                //go back to Main Menu
                AdminMenu main = new AdminMenu();
                main.Welcome();
                break;

            case "4":
                //go to exit
                ExitMenu exit = new ExitMenu();
                exit.Exit();
                break;

            default:
                //error handling
                ErrorHandler err = new ErrorHandler();
                err.InvalidInputMsg();
                Log.Error("Invalid Input");
                MainMenu();
                break;
            }
        }
Beispiel #2
0
        public void Welcome()
        {
            Console.WriteLine("Tindahan ni Aling Nena");
            Console.WriteLine("Welcome BacK! What would you like to view?");
            Console.WriteLine(" [0] Location \n [1] Customer  \n [2] Orders \n [3] Exit");
            string input = Console.ReadLine();

            switch (input)
            {
            case "0":
                //go to the Locations UI
                AdminLocation al = new AdminLocation();
                al.Menu();
                break;

            case "1":
                //go to customer UI
                AdminCustomer ac = new AdminCustomer();
                ac.MainMenu();
                break;

            case "2":
                //go to order UI
                AdminOrder ao = new AdminOrder();
                ao.Menu();
                break;

            case "3":
                //go to exit
                ExitMenu exit = new ExitMenu();
                exit.Exit();
                break;

            default:
                //error handler
                ErrorHandler err = new ErrorHandler();
                err.InvalidInputMsg();
                Log.Error("Invalid Input.");
                Welcome();
                break;
            }
        }
Beispiel #3
0
        ///<summary>Main menu for location operations</summary>
        public void Menu()
        {
            Console.WriteLine("Welcome to Location UI! \n What would you like to do?");
            Console.WriteLine(" [0] View Order History of Location \n [1] View Location Inventory \n [2] Go back to Main Menu \n [3] Exit");
            string input = Console.ReadLine();

            switch (input)
            {
            case "0":
                //code to view orderhistory of location
                AdminOrder ao = new AdminOrder();
                ao.ViewLocationOrderHistory();
                break;

            case "1":
                //code to view location inventory
                ViewLocationInventory();
                break;

            case "2":
                //go back to Main Menu
                AdminMenu main = new AdminMenu();
                main.Welcome();
                break;

            case "3":
                //go to exit
                ExitMenu exit = new ExitMenu();
                exit.Exit();
                break;

            default:
                //error handling
                ErrorHandler err = new ErrorHandler();
                err.InvalidInputMsg();
                Menu();
                break;
            }
        }