예제 #1
0
        public void whenGetAllParksIsRunReturnsListOfParks()
        {
            IList <Park> parks = new List <Park>();

            parks = _parkDAL.GetAllParks();

            Assert.IsNotNull(parks);
        }
예제 #2
0
        public ActionResult Index()
        {
            List <NationalPark> parks = parkDAL.GetAllParks();

            Survey survey = new Survey(parks);

            return(View("Index", survey));
        }
예제 #3
0
        public ActionResult Index()
        {
            if (Session["isFahrenheit"] == null)
            {
                Session["isFahrenheit"] = true;
            }

            return(View("Index", parkDAL.GetAllParks()));
        }
        public ActionResult TakeSurvey()
        {
            List <ParkModel> parks       = parkDAL.GetAllParks();
            SurveyFormModel  emptySurvey = new SurveyFormModel();

            emptySurvey.AvailableParks = parks;

            return(View("TakeSurvey", emptySurvey));
        }
예제 #5
0
        // GET: Home
        public ActionResult Index()
        {
            if (Session["isCelsius"] == null)
            {
                Session["isCelsius"] = false;
            }

            List <Park> model = parkDAL.GetAllParks();

            return(View("Index", model));
        }
        public IActionResult TakeSurvey()
        {
            var parks = parkDAL.GetAllParks();

            var options = parks.Select <Park, SelectListItem>(park => new SelectListItem()
            {
                Text = park.ParkName, Value = park.ParkCode
            });

            ViewBag.Parks = options;

            Survey survey = new Survey();

            return(View(survey));
        }
예제 #7
0
        public ActionResult ChoosePark()
        {
            List <ParkModel> parks = parkDAL.GetAllParks();

            parks.ForEach(park => park.Image = parkDAL.GetImageByParkId(park.ParkId));
            return(View("ChoosePark", parks));
        }
        /// <summary>
        /// Home page
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            // Get all parks from DB
            IList <Park> parks = _parkDAL.GetAllParks();

            return(View("Index", parks));
        }
예제 #9
0
        // GET: Home
        public ActionResult Index()
        {
            List <ParkModel> parks = dal.GetAllParks();

            Session["TempChoice"] = GetTempChoice();
            return(View("Index", parks));
        }
예제 #10
0
        public IActionResult Index()
        {
            HttpContext.Session.SetString("SessionTemperatureKey", "Fahrenheit");
            List <Park> parksList = parkDAL.GetAllParks();

            return(View(parksList));
        }
예제 #11
0
        // GET: /
        // GET: Home/
        // GET: Home/Index
        public ActionResult Index()
        {
            Session["tempSetting"] = "Fahrenheit";
            List <ParkModel> allParks = parkDAL.GetAllParks();

            return(View("Index", allParks));
        }
예제 #12
0
        public IActionResult Index(Park park)
        {
            var parks = parkDAL.GetAllParks();

            park.Parks = parks;

            return(View(parks));
        }
예제 #13
0
        public IActionResult Index()
        {
            IndexViewModel allParks = new IndexViewModel();

            allParks.Parks = _parkDAL.GetAllParks();

            return(View(allParks));
        }
예제 #14
0
        // GET: Home Page <--list of Parks
        public ActionResult Home()
        {
            List <Park> model = new List <Park>();

            //add dal that gets list of parks and puts into model
            model = dal.GetAllParks();

            return(View("Home", model));
        }
예제 #15
0
        public ActionResult Index()
        {
            List <Park> parks = parkDal.GetAllParks();

            if (parks == null)
            {
                return(HttpNotFound());
            }
            return(View("Index", parks));
        }
예제 #16
0
        public Dictionary <string, string> GetParkNameAndCode()
        {
            Dictionary <string, string> output = new Dictionary <string, string>();
            List <Park> parks = dal.GetAllParks();

            foreach (Park park in parks)
            {
                output[park.imgName] = park.parkName;
            }
            return(output);
        }
예제 #17
0
        public IActionResult Results()
        {
            Dictionary <string, int> surveysAndTheirCounts = surveyDAL.GetFavoriteParkBySurveyCount();

            SurveyResultsViewModel srvm = new SurveyResultsViewModel()
            {
                Results = surveysAndTheirCounts,
                Parks   = parkDAL.GetAllParks()
            };

            return(View(srvm));
        }
예제 #18
0
        public ActionResult SurveyView()
        {
            SurveyModel survey = new SurveyModel();

            List <ParkModel> parks = parkDal.GetAllParks();

            survey.Parks = parks;

            //surveyDal.MakePost(survey);

            return(View("SurveyView", survey));
        }
예제 #19
0
        /// <summary>
        /// Survey Index page
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            List <Park> parks = _parkDAL.GetAllParks();

            //Select List For Park names and Code
            List <SelectListItem> parkItems = new List <SelectListItem>();

            // Makes a new List of only Park.Name to use for the form drop
            foreach (Park p in parks)
            {
                parkItems.Add(new SelectListItem {
                    Text = p.ParkName, Value = p.ParkCode
                });
            }

            //Put SelectLsit in TempData to access in the View
            TempData["Parks"] = parkItems;

            //Select List For State
            TempData["States"] = States;

            //Select List For Activity Level
            TempData["ActivityLevel"] = new List <SelectListItem>()
            {
                new SelectListItem {
                    Text = "Extremely Active", Value = "extremelyActive"
                },
                new SelectListItem {
                    Text = "Active", Value = "active"
                },
                new SelectListItem {
                    Text = "Sedentary", Value = "sedentary"
                },
                new SelectListItem {
                    Text = "Inactive", Value = "inactive"
                }
            };

            return(View("Index"));
        }
예제 #20
0
        // GET: Home
        public ActionResult Index()
        {
            List <Park> parks = dal.GetAllParks();

            return(View("Index", parks));
        }
예제 #21
0
        public ActionResult Index()
        {
            var parks = _dal.GetAllParks();

            return(View(parks));
        }
예제 #22
0
        public IHttpActionResult GetParks()
        {
            List <ParkModel> parks = parkDAL.GetAllParks();

            return(Ok(parks));
        }
예제 #23
0
        public ActionResult Index()
        {
            List <NationalPark> parks = parkDAL.GetAllParks();

            return(View("Index", parks));
        }
예제 #24
0
        public IActionResult ParksList()
        {
            var parks = parkDAL.GetAllParks();

            return(View(parks));
        }
예제 #25
0
        // GET: Home
        public ActionResult Index(List <ParkModel> parks)
        {
            var p = dal.GetAllParks();

            return(View("Index", p));
        }
예제 #26
0
        // GET: NationalPark
        public ActionResult Index()
        {
            List <NationalParkModel> list = parkDAL.GetAllParks();

            return(View("Index", list));
        }
예제 #27
0
        /// <summary>
        /// Gets a list of all the parks in the system.
        /// </summary>
        /// <returns>Returns a list of all parks in alphabetical order</returns>
        public List <Park> GetParksList()
        {
            List <Park> list = _db.GetAllParks();

            return(list);
        }
        // GET: Home
        public ActionResult Index()
        {
            List <Park> model = dal.GetAllParks();

            return(View("Index", model));
        }
예제 #29
0
 // GET: Home
 public ActionResult Index()
 {
     return(View("Index", parkDAL.GetAllParks()));
 }
예제 #30
0
        // GET: Park
        public ActionResult Index()
        {
            var parks = _parkDal.GetAllParks();

            return View("Index", parks);
        }