public void Menu()
        {
            Console.WriteLine("Welcome to the Product Records! \nWhat would you like to do?");
            Console.WriteLine("[1] Add Product \n[2] View Products \n[3] Exit");
            string input = Console.ReadLine();

            switch (input)
            {
            case "1":
                //Code to add product
                break;

            case "2":
                //code to view product
                break;

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

            default:
                //error handling
                ErrorHandler err = new ErrorHandler();
                err.InvalidInputMsg();
                Menu();
                break;
            }
        }
예제 #2
0
        public void CheckOutMenu(Customer c, Location l, Order o)
        {
            Console.WriteLine("Thank you for your patronage");
            ExitMenu ex = new ExitMenu();

            ex.Exit();
        }
        ///<summary>Search customer UI that returns to main customer menu when finished </summary>
        public void SearchCustomerMenu()
        {
            try
            {
                _ = SearchCustomer();
                string input;
                do
                {
                    Console.WriteLine("Where would you like to go? \n [0] Back to main menu? \n [1] Customer Menu?\n [2] Exit?");
                    input = Console.ReadLine();
                } while (ErrorHandler.InvalidIntInput(input));

                switch (input)
                {
                case "0":
                    AdminMenu am = new AdminMenu();
                    am.Welcome();
                    break;

                case "1":
                    MainMenu();
                    break;

                case "2":
                    ExitMenu exit = new ExitMenu();
                    exit.Exit();
                    break;

                default:
                    ErrorHandler err = new ErrorHandler();
                    err.InvalidInputMsg();
                    Log.Error("Invalid Input");
                    ExitMenu ex = new ExitMenu();
                    ex.Exit();
                    break;
                }
            }
            catch (CustomerException ex)
            {
                Console.WriteLine(ex.Message);
                Log.Error(ex.Message);
                TryAgain(SearchCustomerMenu);
            }
            catch (NotImplementedException ex)
            {
                Console.WriteLine(ex.Message);
                Log.Error(ex.Message);
                TryAgain(SearchCustomerMenu);
            }
            catch (CustomerNotFoundException ex)
            {
                Console.WriteLine(ex.Message);
                Log.Error(ex.Message);
                TryAgain(SearchCustomerMenu);
            }
        }
        ///<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;
            }
        }
        ///<summary>Main menu for Order Operations</summary>
        public void Menu()
        {
            Console.WriteLine("Welcome to Order UI! \n What would you like to do?");
            Console.WriteLine(" [0] Place Order \n [1] View Order History of Customer \n [2] View Order History of Location\n [3] Return to Main Menu \n [4] Exit");
            string input = Console.ReadLine();

            switch (input)
            {
            case "0":
                //code to add order
                AddOrder();
                break;

            case "1":
                //code to view order history of customer
                ViewCustomerOrderHistory();
                break;

            case "2":
                //code to view order history of location
                ViewLocationOrderHistory();
                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();
                Menu();
                break;
            }
        }
예제 #6
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;
            }
        }
예제 #7
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;
            }
        }
예제 #8
0
        public void LoginMenu()
        {
            Console.WriteLine("Enter your username: "******"Enter your password: "******"Unable to verify account");
                Console.WriteLine("Try again? \n Y^(Yes) N^(No)");
                string input = Console.ReadLine();
                switch (input)
                {
                case "Y":
                    LoginMenu();
                    break;

                case "N":
                    ex.Exit();
                    LoginMenu();
                    break;

                default:
                    err.InvalidInputMsg();
                    break;
                }
            }
        }