/// <summary> /// The override of ExecuteSelection handles whatever selection was made by the user. /// This is where any business logic is executed. /// </summary> /// <param name="choice">"Key" of the user's menu selection</param> /// <returns></returns> protected override bool ExecuteSelection(string choice) { IList <Campground> listCG = campgroundDAO.GetCampgrounds(park); int inputNum = int.Parse(choice); Campground campground = listCG[inputNum - 1]; Console.Write($" Press Enter to see campsite availablity for {campground.campgroundName}..."); Console.ReadLine(); ParkCampgroundsMenu pgm2 = new ParkCampgroundsMenu(campgroundDAO, campsiteDAO, parkDAO, reservationDAO, campground); pgm2.Run(); return(true); }
protected override bool ExecuteSelection(string choice) { switch (choice) { case "1": // display campgrounds method ICampgroundSqlDAO campgroundDAO = new CampgroundSqlDAO(ConnectionString); ParkCampgroundsMenu menu = new ParkCampgroundsMenu(campgroundDAO, park); menu.Run(); break; case "2": // Call Reservation Menu campgroundDAO = new CampgroundSqlDAO(ConnectionString); CampgroundReservationMenu menu2 = new CampgroundReservationMenu(campgroundDAO, park); menu2.Run(); break; case "Q": break; } return(true); }