Ejemplo n.º 1
0
        public void GetParksTest()
        {
            ParkSQLDAL  park  = new ParkSQLDAL(connectionString);
            List <Park> parks = park.GetAllParks();

            Assert.IsNotNull(parks);
        }
        // GET: Home
        public ActionResult Index()
        {
            ParkSQLDAL  sql      = new ParkSQLDAL();
            List <Park> allParks = sql.GetAllParks();

            return(View("Index", allParks));
        }
Ejemplo n.º 3
0
        // GET: Home
        public ActionResult Home()
        {
            IParkDAL    dal    = new ParkSQLDAL(connectionString);
            List <Park> result = dal.GetAllParks();

            return(View(result));
        }
Ejemplo n.º 4
0
        public ActionResult TemperatureChange()
        {
            if (Request["temperatureType"] != null)
            {
                if (Request["temperatureType"] == "Celsius")
                {
                    Session["temperatureType"] = "Celsius";
                }
                else
                {
                    Session["temperatureType"] = "Fahrenheit";
                }
            }

            IParkDAL    dal    = new ParkSQLDAL(connectionString);
            List <Park> result = dal.GetAllParks();

            return(View("Home", result));
        }
Ejemplo n.º 5
0
        public void PrintAllParks()
        {
            ParkSQLDAL  dal   = new ParkSQLDAL(DatabaseConnection);
            List <Park> parks = dal.GetAllParks();

            if (parks.Count > 0)
            {
                foreach (Park park in parks)
                {
                    Console.WriteLine($"{park.ParkID}) {park.ParkName}");
                }
                Console.WriteLine();
                Console.WriteLine("Q) quit");
                Console.WriteLine();
            }
            else
            {
                Console.WriteLine("NO RESULTS");
            }
        }
Ejemplo n.º 6
0
        //GET:
        public ActionResult DailySurvey()
        {
            IParkDAL    dal       = new ParkSQLDAL(connectionString);
            List <Park> parkNames = dal.GetAllParks();

            List <SelectListItem> parks = new List <SelectListItem>();

            foreach (Park p in parkNames)
            {
                parks.Add(new SelectListItem {
                    Text = p.ParkName, Value = p.ParkCode
                });
            }

            ViewBag.ParkNames = parks;

            ViewBag.ActivityLevels = activityLevel;

            ViewBag.StateNames = states;

            return(View());
        }
        /// <summary>
        /// Shows a list of all parks with their descriptions
        /// </summary>
        /// <returns></returns>
        public IActionResult Index()
        {
            IList <ParkModel> parks = parkDAL.GetAllParks();

            return(View(parks));
        }