Example #1
0
        public void GetParkDetailTest()
        {
            ParkSqlDAL sqlDAL = new ParkSqlDAL(connectionString);
            Park       park   = sqlDAL.GetParkDetail("tnp");

            Assert.IsNotNull(park);
            Assert.AreEqual("Test National Park", park.ParkName);
            Assert.AreEqual("Woodland", park.Climate);
            Assert.AreEqual("2018", park.YearFounded.ToString());
        }
Example #2
0
        public ActionResult Detail(string id)
        {
            string     tempUnit = Session["Temp_Unit"] as string;
            ParkSqlDAL dal      = new ParkSqlDAL(connectionString);
            Park       park     = dal.GetParkDetail(id);

            ViewBag.Park = park;
            if ((tempUnit == null) || (tempUnit == "°F"))
            {
                ViewBag.TempUnit = "°F";
            }
            else
            {
                if (tempUnit == "°C")
                {
                    ViewBag.TempUnit = "°C";
                }
            }
            return(View("Detail", park));
        }