public ActionResult Submit(WebsiteExperienceSurveyModel model) { var formResult = model; formResult.Referrer = Session["referrer"].ToString(); try { using (var repository = new WebSiteSurveyRepository()) { repository.Insert(new Data.Models.WebSiteSurvey() { Name = formResult.Name, Age = formResult.Age, Country = formResult.Country, Email = formResult.Email, ExperienceRating = formResult.ExperienceRating, Gender = formResult.Gender, Referrer = formResult.Referrer, Suggestion = formResult.Suggestion }); } } catch (Exception) { return(RedirectToAction("Index", "Error")); } TempData["Name"] = formResult.Name; TempData["Email"] = formResult.Email; return(RedirectToAction("Index", "ThankYou")); }
public ActionResult Index() { var referrer = GetReferrer(); var newSurvey = new WebsiteExperienceSurveyModel(referrer); return(View(newSurvey)); }