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
        public static void Main(string[] args)
        {
            DatabaseInterface db = new DatabaseInterface("BAGOLOOT_DB");

            db.CheckChildTable();
            db.CheckToyTable();

            MainMenu      menu = new MainMenu();
            ChildRegister book = new ChildRegister(db);
            ToyRegister   bag  = new ToyRegister(db);

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

            do
            {
                // Show the main menu
                choice = menu.Show();

                switch (choice)
                {
                // Menu option 1: Adding child
                case 1:
                    CreateChild.DoAction(book);
                    break;

                // Menu option 2: Adding toy
                case 2:
                    AddToy.DoAction(bag, book);
                    break;
                }
            } while (choice != 3);
        }