Esempio n. 1
0
        public IActionResult Detail(string id, string tempType)
        {
            string tempTypeSession = HttpContext.Session.GetString("tempTypeSession");

            if (string.IsNullOrEmpty(tempTypeSession))
            {
                HttpContext.Session.SetString("tempTypeSession", "Fahrenheit");
            }

            if (!string.IsNullOrEmpty(tempType))
            {
                HttpContext.Session.SetString("tempTypeSession", tempType);
            }

            tempTypeSession = HttpContext.Session.GetString("tempTypeSession");

            if (tempTypeSession == "Fahrenheit")
            {
                ViewData["tempType"] = "Fahrenheit";
            }

            if (tempTypeSession == "Celsius")
            {
                ViewData["tempType"] = "Celsius";
            }

            ParkPlusWeather parkPlusWeather = new ParkPlusWeather();

            parkPlusWeather.Park     = parkDAO.Detail(id);
            parkPlusWeather.Weathers = weatherDAO.GetAllWeathers(id);

            return(View(parkPlusWeather));
        }