Beispiel #1
0
        public void GetAllParksTest()
        {
            ParkWeatherSqlDal  testDal  = new ParkWeatherSqlDal(connectionString);
            List <ParkWeather> testList = testDal.GetAllParks();

            Assert.AreEqual(parkCount, testList.Count);
        }
        public ActionResult TakeSurvey()
        {
            Survey            survey  = new Survey();
            ParkWeatherSqlDal parkDAL = new ParkWeatherSqlDal(connectionString);

            survey.Parks = parkDAL.GetAllParks();
            return(View(survey));
        }
 public ActionResult TakeSurvey(Survey survey)
 {
     if (!ModelState.IsValid)
     {
         ParkWeatherSqlDal parkDAL = new ParkWeatherSqlDal(connectionString);
         survey.Parks = parkDAL.GetAllParks();
         return(View("TakeSurvey", survey));
     }
     else
     {
         surveyDAL.SaveNewSurvey(survey);
         return(RedirectToAction("TakeSurveyResult", "Survey"));
     }
 }