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); }
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); }