Esempio n. 1
0
        public static void Main(string[] args)
        {
            string thingsToDo = "1) display menu \n2) display all menu items \n3) display a menu item \n4) add a menu item \n5) edit a menu item \n6) add item to menu \n7) remove item from menu \n8) remove item from list of menu items \n0) quit/exit the program \n";
            string done       = "99";

            Console.WriteLine("About to try to create Menu object.");
            Menu menu = new Menu();

            Console.WriteLine("Hey it was created.");

            while (done != "0")
            {
                Console.WriteLine(thingsToDo);
                done = Console.ReadLine();
                if (done == "1")
                {
                    menu.displayMenu();
                }
                else if (done == "2")
                {
                    foreach (MenuItem item in menu.AllItems)
                    {
                        item.displayMenuItem();
                    }
                }
                else if (done == "3")
                {
                    // display item name/number to choose from
                    MenuItem item = new MenuItem();
                    item.displayMenuItem();
                }
                else if (done == "4")
                {
                    MenuItem item = new MenuItem();
                    item.addMenuItem();
                    menu.AllItems.Add(item);
                }
                else if (done == "5")
                {
                    // display item name/number to choose from
                    MenuItem item = new MenuItem();
                }
                else if (done == "6")
                {
                    // display item name/number to choose from
                    MenuItem item = new MenuItem();
                    menu.addItemToMenu(item);
                }
                else if (done == "7")
                {
                    // display item name/number to choose from
                    MenuItem item = new MenuItem();
                    menu.ItemsOnMenu.Remove(item);
                }
                else if (done == "8")  // remove item from list of menu items
                {
                    // display item name/number to choose from
                    MenuItem item = new MenuItem();
                    menu.AllItems.Remove(item);
                }
                else if (done == "0")
                {
                    Console.WriteLine("Thanks for testing the program");
                }
                else
                {
                    Console.WriteLine("what you talking about Willis.");
                }
            }
        }