Exemple #1
0
        public MagicMenuCollection loadOwnerMenu(MagicMenuCollection collection)
        {
            collection.Menus.Add(new MagicMenuList()
            {
                MenuId    = 2,
                MenuItems =
                {
                    new MagicMenuItem()
                    {
                        Option        = "Display All Stock Requests\n",
                        CannotExecute = false,
                        Execute       = () =>
                        {
                            Console.WriteLine("Need to implement function!");
                        }
                    },
                    new MagicMenuItem()
                    {
                        Option        = "Display Stock Requests (True / False)\n",
                        CannotExecute = false,
                        Execute       = () =>
                        {
                            Console.WriteLine("Need to implement function!");
                        }
                    },
                    new MagicMenuItem()
                    {
                        Option        = "Display All Product Lines\n",
                        CannotExecute = false,
                        Execute       = () =>
                        {
                            Console.Clear();
                            access.displayAllStock();
                            Console.ReadKey();
                            Console.Clear();
                            collection.ShowMenu(2);
                        }
                    },
                    new MagicMenuItem()
                    {
                        Option        = "Return to Main Menu\n",
                        CannotExecute = true,
                        SubMenuId     = 1
                    },
                    new MagicMenuItem()
                    {
                        Option        = "Exit\n",
                        CannotExecute = false,
                        Execute       = () =>
                        {
                            System.Environment.Exit(1);
                        }
                    }
                }
            });

            return(collection);
        }
Exemple #2
0
        public void loadMainMenu()
        {
            // build a collection of menus
            // can have as deep a structure as you like
            // give each menu a unique integer MenuId
            // link to other menus by setting HasSubMenu to true, and the SubMenuId to the MenuId of the menu you wish to link to
            // or, set HasSubMenu to false, and have an Action performed when the menuitem is selected

            MagicMenuCollection collection = new MagicMenuCollection()
            {
                Menus =
                {
                    new MagicMenuList()
                    {
                        MenuId    = 1,
                        MenuItems =
                        {
                            new MagicMenuItem()
                            {
                                Option        = "Owner",
                                CannotExecute = true,
                                SubMenuId     = 2
                            },

                            new MagicMenuItem()
                            {
                                Option        = "Franchise Owner",
                                CannotExecute = true,
                                SubMenuId     = 5
                            },

                            new MagicMenuItem()
                            {
                                Option        = "Customer",
                                CannotExecute = true,
                                SubMenuId     = 4
                            },

                            new MagicMenuItem()
                            {
                                Option        = "Exit",
                                CannotExecute = false,
                                Execute       = () =>
                                {
                                    System.Environment.Exit(1);
                                }
                            }
                        }
                    }
                }
            };

            collection = loadAllLists(collection);

            collection.ShowMenu(1);
            Console.ReadLine();
        }
Exemple #3
0
        public MagicMenuCollection loadFranchiseOwnerMenu(MagicMenuCollection collection)
        {
            collection.Menus.Add(new MagicMenuList()
            {
                MenuId    = 3,
                MenuItems =
                {
                    new MagicMenuItem()
                    {
                        Option        = "Display Inventory\n",
                        CannotExecute = false,
                        Execute       = () =>
                        {
                            Console.WriteLine("Need to implement function!");
                        }
                    },
                    new MagicMenuItem()
                    {
                        Option        = "Display Inventory (Threshold)\n",
                        CannotExecute = false,
                        Execute       = () =>
                        {
                            Console.WriteLine("Need to implement function!");
                        }
                    },
                    new MagicMenuItem()
                    {
                        Option        = "Add New Inventory Item\n",
                        CannotExecute = false,
                        Execute       = () =>
                        {
                            Console.WriteLine("Need to implement function!");
                        }
                    },
                    new MagicMenuItem()
                    {
                        Option        = "Return to Main Menu\n",
                        CannotExecute = true,
                        SubMenuId     = 1
                    },
                    new MagicMenuItem()
                    {
                        Option        = "Exit\n",
                        CannotExecute = false,
                        Execute       = () =>
                        {
                            System.Environment.Exit(1);
                        }
                    }
                }
            });

            return(collection);
        }
Exemple #4
0
        private MagicMenuCollection loadAllLists(MagicMenuCollection collection)
        {
            OwnerMenu          ownerMenu     = new OwnerMenu();
            FranchiseOwnerMenu franOwnerMenu = new FranchiseOwnerMenu();
            CustomerMenu       customerMenu  = new CustomerMenu();

            collection = ownerMenu.loadOwnerMenu(collection);
            collection = franOwnerMenu.loadFranchiseOwnerMenu(collection);
            collection = franOwnerMenu.validateFranchiseStore(collection);
            collection = customerMenu.loadCustomerMenu(collection);

            return(collection);
        }
        public MagicMenuCollection loadCustomerMenu(MagicMenuCollection collection)
        {
            collection.Menus.Add(new MagicMenuList()
            {
                MenuId    = 4,
                MenuItems =
                {
                    new MagicMenuItem()
                    {
                        Option        = "Display Products\n",
                        CannotExecute = false,
                        Execute       = () =>
                        {
                            Console.Clear();
                            displayProducts.displayAllStock();
                            CustomerOrder();
                            Console.ReadKey();
                            Console.Clear();
                            collection.ShowMenu(4);
                        }
                    },
                    new MagicMenuItem()
                    {
                        Option        = "Display Workshops\n",
                        CannotExecute = false,
                        Execute       = () =>
                        {
                            Console.WriteLine("Need to implement function!");
                        }
                    },
                    new MagicMenuItem()
                    {
                        Option        = "Return to Main Menu\n",
                        CannotExecute = true,
                        SubMenuId     = 1
                    },
                    new MagicMenuItem()
                    {
                        Option        = "Exit\n",
                        CannotExecute = false,
                        Execute       = () =>
                        {
                            System.Environment.Exit(1);
                        }
                    }
                }
            });

            return(collection);
        }
Exemple #6
0
        public MagicMenuCollection validateFranchiseStore(MagicMenuCollection collection)
        {
            collection.Menus.Add(new MagicMenuList()
            {
                MenuId    = 5,
                MenuItems =
                {
                    new MagicMenuItem()
                    {
                        Option        = "Melbourne CBD\n",
                        CannotExecute = false,
                        Execute       = () =>
                        {
                            Console.Clear();
                            access.identifyStore("Melbourne_CBD");
                            collection.ShowMenu(3);
                        }
                    },
                    new MagicMenuItem()
                    {
                        Option        = "Melbourne North\n",
                        CannotExecute = false,
                        Execute       = () =>
                        {
                            Console.Clear();
                            access.identifyStore("Melbourne_North");
                            collection.ShowMenu(3);
                        }
                    },
                    new MagicMenuItem()
                    {
                        Option        = "Melbourne South\n",
                        CannotExecute = false,
                        Execute       = () =>
                        {
                            Console.Clear();
                            access.identifyStore("Melbourne_South");
                            collection.ShowMenu(3);
                        }
                    },
                    new MagicMenuItem()
                    {
                        Option        = "Melbourne East\n",
                        CannotExecute = false,
                        Execute       = () =>
                        {
                            Console.Clear();
                            access.identifyStore("Melbourne_East");
                            collection.ShowMenu(3);
                        }
                    },
                    new MagicMenuItem()
                    {
                        Option        = "Melbourne West\n",
                        CannotExecute = false,
                        Execute       = () =>
                        {
                            Console.Clear();
                            access.identifyStore("Melbourne_West");
                            collection.ShowMenu(3);
                        }
                    },
                    new MagicMenuItem()
                    {
                        Option        = "Return to Main Menu\n",
                        CannotExecute = true,
                        SubMenuId     = 1
                    },
                    new MagicMenuItem()
                    {
                        Option        = "Exit\n",
                        CannotExecute = false,
                        Execute       = () =>
                        {
                            System.Environment.Exit(1);
                        }
                    }
                }
            });

            return(collection);
        }