コード例 #1
0
        //****************************************************Demographic*******************************************************//

        /// <summary>
        /// The demographic search page. Runs with the DemographicSearch.js.
        /// </summary>
        /// <returns>
        /// A view.
        /// </returns>
        public ActionResult Demographic()
        {
            var userName = User.Identity.Name;
            var userId   = User.Identity.GetUserId();

            if (userId == null)
            {
                return(RedirectToAction("Login", "Account"));
            }
            else
            {
                FormdataDB fd        = new FormdataDB();
                LifeStyle  lifeStyle = _repository.GetLifeStyleVM();
                lifeStyle.SearchResults = _repository.GetSavedColleges(userName);
                lifeStyle.DemoAges      = _repository.GetFormData().DemoAges;
                lifeStyle.DemoRaces     = _repository.GetFormData().DemoRaces;
                return(View(lifeStyle));
            }
        }