Exemple #1
0
        public ActionResult Survey(SurveyModel post)
        {
            surveyDAL.SaveNewPost(post);

            if (!ModelState.IsValid)
            {
                return(View("Survey", post));
            }

            return(RedirectToAction("SurveyResult", "Home"));
        }
Exemple #2
0
        public void SavePostTest()
        {
            SurveyModel model = new SurveyModel()
            {
                FavoritePark  = "Everglades National Park",
                Email         = "*****@*****.**",
                Residence     = "OH",
                ActivityLevel = "Low"
            };

            SurveySqlDAL dal = new SurveySqlDAL(connectionString);

            bool result = dal.SaveNewPost(model);

            Assert.AreEqual(true, result);
        }