public ActionResult SubmitSurvey(survey_result survey)
        {
            using (var context = new ParkSystemDatabaseEntities())
            {
                context.survey_result.Add(survey);
                context.SaveChanges();

            }
            return RedirectToAction("SurveyResult");
        }
Exemple #2
0
 public ActionResult SubmitSurvey(survey_result survey)
 {
     if (ModelState.IsValid)
     {
         using (var context = new ParkSystemDatabaseEntities())
         {
             context.survey_result.Add(survey);
             context.SaveChanges();
         }
         return(RedirectToAction("SurveyResult"));
     }
     else
     {
         return(View("Survey", survey));
     }
 }
Exemple #3
0
 public ActionResult Survey(SurveyModel theSurvey)
 {
     if (ModelState.IsValid)
     {
         using (var context = new ParkSystemDatabaseEntities())
         {
             context.survey_result.Add(theSurvey.Survey);
             context.SaveChanges();
         }
         return(RedirectToAction("SurveyResult"));
     }
     else
     {
         SurveyModel survey = new SurveyModel();
         survey.Fahrenheit = CheckTemp();
         using (var context = new ParkSystemDatabaseEntities())
         {
             survey.Parks = context.parks.ToList();
         }
         survey.Survey = theSurvey.Survey;
         return(View(survey));
     }
 }