public void GetDates(int campgroundID, int parkID) { IList <DateTime> departArriveDates = new List <DateTime>(); IList <Site> sitesToReserve = new List <Site>(); while (true) { //DateTime fromDate; //DateTime toDate; try { Console.WriteLine("Please enter the arrival date: MM / DD / YYYY or press \"Q\" to quit"); string input = Console.ReadLine(); if (input.ToLower() == "q") { SearchForReservation(parkID); } //string fromDateString = Console.ReadLine(); DateTime fromDate = Convert.ToDateTime(input); Console.WriteLine("Please enter the departure date: MM / DD / YYYY or press \"Q\" to quit"); input = Console.ReadLine(); if (input.ToLower() == "q") { SearchForReservation(parkID); } //fromDate = Convert.ToDateTime(fromDateString); DateTime toDate = Convert.ToDateTime(input); departArriveDates.Add(fromDate); departArriveDates.Add(toDate); IList <Site> sites = siteDAO.ListSitesAtCampgroundWithinDate(campgroundID, departArriveDates); IList <Campground> campgrounds = campgroundDAO.ListCampgroundsFromPark(parkID); decimal campgroundFee = 0; if (sites.Count == 0) { Console.WriteLine("No Results. Press any key to enter an alternate date range."); Console.ReadKey(); GetDates(campgroundID, parkID); } Console.WriteLine("Results Matching Your Criteria: "); Console.WriteLine(string.Format("{0,-10}{1,-12}{2,-16}{3,-16}{4,-12}{5,-14}", "Site No.", "Max Occup.", "Accessible?", "Max RV Length", "Utility", "Cost")); foreach (Site site in sites) { foreach (Campground campground in campgrounds) { if (site.CampgroundID == campground.CampgroundID) { campgroundFee = reservationDAO.GetTotalCost(campground.DailyFee, departArriveDates); } } sitesToReserve.Add(site); Console.WriteLine(string.Format("{0,-10}{1,-12}{2,-16}{3,-16}{4,-12}{5,-14}", site.SiteNumber, site.MaxOccupancy, site.Accessible, site.MaxRvLength, site.Utilities, campgroundFee.ToString("C"))); } break; } catch (Exception e) { Console.WriteLine(e.Message); } } GetReservation(departArriveDates, sitesToReserve); }