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); }
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 }