Esempio n. 1
0
        public ActionResult GoToSurvey(Survey survey)
        {
            string surveySent = null;

            if (ModelState.IsValid)
            {
                if (Session["Surveyed"] != null)
                {
                    return(View("Sorry"));
                }
                else
                {
                    surveySent          = "Surveyed";
                    Session["Surveyed"] = surveySent;
                    surveyDal.SaveSurvey(survey);
                    return(RedirectToAction("SurveyResult"));
                }
            }
            else
            {
                ViewBag.parks         = parkDal.GetDropDown();
                ViewBag.activityLevel = activityLevel;
                ViewBag.state         = state;
                return(View("GoToSurvey", survey));
            }
        }
 public IActionResult AddSurvey(DailySurveyViewModel model)
 {
     if (!ModelState.IsValid)
     {
         return View(model);
     }
     else
     {
         surveyDAL.SaveSurvey(model.Survey);
         return RedirectToAction("Index", "Survey");
     }
 }