/// <summary> /// What to see before camp selections /// </summary> protected override void DisplayBeforeMenu() { Console.WriteLine($"{MyPark.Name} National Campgrounds\r\n"); Console.WriteLine($"{"Name",10} {"Open",33} {"Close", 16} {"Daily Fee",18}"); List <Campground> list = MyCampgroundDAO.GetAllCampgrounds(MyPark.ParkID); int i = 1; foreach (Campground camp in list) { Console.WriteLine($"#{i, -5}{camp.Name,-30}\t{Month(camp.OpenFrom),-15}\t" + $"{Month(camp.OpenTo),-15}{camp.DailyFee,-15:C}"); i++; } }
/// <summary> /// Constructor, requires DAO and park object /// </summary> /// <param name="parkDAO">DAO for parks created at startup</param> /// <param name="campgroundDAO">DAO for campgrounds created at startup</param> /// <param name="siteDAO">DAO for sites created at startup</param> /// <param name="reservationDAO">DAO for reservations created at startup</param> /// <param name="park">The park the user selected earlier</param> public ReservationMenu(IParkDAO parkDAO, ICampgroundDAO campgroundDAO, ISiteDAO siteDAO, IReservationDAO reservationDAO, Park park) : base(parkDAO, campgroundDAO, siteDAO, reservationDAO) { MyPark = park; this.Title = "*** Search for Campground Reservation ***"; this.Labels = $"{"Name",8}{"Open",35}{"Close",16}{"Daily Fee",19:C}"; // Get camps and create a menu option for each one Camps = MyCampgroundDAO.GetAllCampgrounds(MyPark.ParkID); for (int i = 0; i < Camps.Count; i++) { this.menuOptions.Add((i + 1).ToString(), ($"{Camps[i].Name,-35}{Month(Camps[i].OpenFrom),-15}" + $"{Month(Camps[i].OpenTo),-15}{Camps[i].DailyFee,-20:C}")); } this.menuOptions.Add("Q", "Return to previous menu"); }