public void DisplayBookingSubMenu() { bool running = true; bool searching = true; bool reserving = true; int campgroundID = 0; int siteNumber = 0; DateTime startDate = new DateTime(); DateTime endDate = new DateTime(); while (running) { VerifyingReservation(ref running, ref searching, ref campgroundID, ref startDate, ref endDate); Console.Clear(); decimal totalCost = FindTotalCost(Park, campgroundID, startDate, endDate); ReservationHandlerDAL reservationHandler = new ReservationHandlerDAL(Park, campgroundID, startDate, endDate, DatabaseConnection); List <Site> availableSites = new List <Site>(reservationHandler.CheckAvailabilty(startDate, endDate)); Console.WriteLine("Results Matching Your Search Criteria"); Console.Write("Site No.".PadRight(10)); Console.Write("Max Occup.".PadRight(15)); Console.Write("Accesible?".PadRight(17)); Console.Write("Max RV Length".PadRight(17)); Console.Write("Utilities?".PadRight(12)); Console.WriteLine("Cost".PadRight(10)); foreach (var availableSite in availableSites) { Console.WriteLine($"{availableSite.SiteID.ToString().PadRight(9)} " + $"{availableSite.MaxOccupancy.ToString().PadRight(14)} " + $"{ToYesOrNo(availableSite.Accessible).ToString().PadRight(16)} " + $"{ZeroToNA(availableSite.MaxRVLength).ToString().PadRight(16)} " + $"{ToYesOrNo(availableSite.Utilities).ToString().PadRight(11)} " + $"{totalCost.ToString("C2")}"); } VerifyingCampsite(ref reserving, ref siteNumber, availableSites); CreatingReservation(siteNumber, reservationHandler); MainMenuCLI mainMenu = new MainMenuCLI(); mainMenu.DisplayCLI(); } }
static void Main(string[] args) { MainMenuCLI mainMenu = new MainMenuCLI(); mainMenu.DisplayCLI(); }