public IActionResult Detail(string parkCode) { if (!HttpContext.Session.Keys.Contains("temp")) { HttpContext.Session.SetString("temp", "f"); } TempData["temp"] = HttpContext.Session.GetString("temp"); Park park = parkDAO.GetParkDetail(parkCode); List <Weather> fiveDay = weatherDAO.GetFiveDayForecast(parkCode); DetailViewModel model = new DetailViewModel(); model.Park = parkDAO.GetParkDetail(parkCode); model.FiveDayForecast = weatherDAO.GetFiveDayForecast(parkCode); if (HttpContext.Session.GetString("temp") == "f") { model.isFahrenheit = true; } else { model.isFahrenheit = false; } model.Park = park; // model.TempSetting return(View(model)); }
/// <summary> /// Lists details about park based on the user choice. /// </summary> private void GetParkDetail() { this.parkId = CLIHelper.GetInteger("Please choose a park for more details: "); IList <Park> parks = parkDAO.GetParkDetail(this.parkId); Console.Clear(); foreach (Park detail in parks) { Console.WriteLine($"{detail.Name} National Park"); Console.WriteLine($"Location: {detail.Location}"); Console.WriteLine($"Established: {detail.EstablishDate}"); Console.WriteLine($"Area: {detail.Area}"); Console.WriteLine($"Annual Visitors: {detail.Visitors}"); Console.WriteLine(); Console.WriteLine($"{detail.Description}"); Console.WriteLine(); Console.WriteLine(); CampgroundCommandMenu(); } }
public ActionResult ParkDetail(string id) { Park selectedPark = parkDAO.GetParkDetail(id); return(View(selectedPark)); }
public IActionResult ParkDetail(string parkCode) { Park park = parkDAO.GetParkDetail(parkCode); return(View(park)); }