示例#1
0
        public ActionResult Thanks()
        {
            var surveySessKey = (string)TempData["SurveySessKey"];
            var srm = (SurveyRunModel)Session[surveySessKey];

            var model = new SubmitSurveyModel { SurveySessKey = surveySessKey, SurveyScore = srm.Score() };

            return View(model);
        }
示例#2
0
        public ActionResult Thanks(SubmitSurveyModel model)
        {
            if (ModelState.IsValid)
            {
                var survey = (SurveyRunModel)Session[model.SurveySessKey];
                _surveyRepository.StoreSurveyResult(model, survey);

                return RedirectToAction("Index", "Home");
            }

            // If we got this far, something failed, redisplay form
            return View(model);
        }
 public void StoreSurveyResult(SubmitSurveyModel submit, SurveyModel survey)
 {
     // Yes yes, jolly good wot
 }