private void GetAllCampgrounds() { ParksDAL pdal = new ParksDAL(DatabaseConnection); List <Park> parks = pdal.GetAllParks(); if (parks.Count > 0) { foreach (Park park in parks) { Console.WriteLine("(" + park.Park_id + ") " + park.Name); Console.WriteLine(); } CampgroundDAL cdal = new CampgroundDAL(DatabaseConnection); int parkId = CLIHelper.GetInteger("Please select a Park Id : "); Console.WriteLine(); List <Campground> campground = cdal.GetAllCampgrounds(parkId); foreach (Campground camp in campground) { Console.WriteLine("(" + camp.CampgroundId + ") " + camp.Name.PadRight(30) + "Opening Month " + months[camp.OpenFromMM].ToString().PadRight(10) + "Closing Month " + months[camp.OpenToMM].ToString().PadRight(10) + "Daily Fee " + camp.DailyFee.ToString("c")); Console.WriteLine(); } } else { Console.WriteLine("**** NO RESULTS ****"); } Console.ReadLine(); }
private void GetAllParks() { ParksDAL pdal = new ParksDAL(DatabaseConnection); List <Park> parks = pdal.GetAllParks(); if (parks.Count > 0) { foreach (Park park in parks) { Console.WriteLine(park.Name.PadRight(20) + "Park Id: " + park.Park_id.ToString().PadRight(20) + "Park Location: " + park.Location.PadRight(20) + "Park Establish Date: " + park.Establish_date.ToString("yyyy").PadRight(20) + "Park Area In Miles: " + park.Area.ToString("N0").PadRight(20) + "Park Visitors: " + park.Visitors.ToString("N0")); Console.WriteLine(); } } else { Console.WriteLine("**** NO RESULTS ****"); } Console.ReadLine(); }