public static void Main(string[] args)
        {
            MainMenu       menu = new MainMenu();
            SantasNiceList book = new SantasNiceList();
            SantasToyBag   bag  = new SantasToyBag();

            // Choice will hold the number entered by the user
            // after main menu ws displayed
            int choice;

            do
            {
                // Show the main menu
                choice = menu.Show();
                var createChildAction = new CreateChild();
                switch (choice)
                {
                // Menu option 1: creating children
                case 1:
                    CreateChild.DoAction(book);
                    break;

                // Menu option 2: add toy
                case 2:
                    AddToy.DoAction(bag, book);
                    break;

                // Menu option 2: add toy
                case 3:
                    RevokeToy.DoAction(bag, book);
                    break;
                }
            } while (choice <= 6);
        }
예제 #2
0
        static void Main(string[] args)
        {
            var db = new DatabaseInterface("LootBag");

            var BagOLoot = new MainMenu();
            var book     = new ChildrenRegister(db);
            var bag      = new ToyRegister(db);

            int choice;

            do
            {
                choice = BagOLoot.Start();

                switch (choice)
                {
                case 1:
                    CreateChild.Action(book);
                    break;

                case 2:
                    AddToy.Action(bag, book);
                    break;

                case 3:
                    RevokeToy.Action(bag, book);
                    break;

                case 4:
                    ShowBag.Action(bag, book);
                    break;

                case 5:
                    DeliverToys.Action(book);
                    break;

                case 6:
                    YuletimeReport.Action(bag, book);
                    break;
                }
            } while (choice != 7);
        }