Example #1
0
        public ActionResult SelectInterests(SelectInterestsViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(HttpNotFound());
            }
            else
            {
                var currentUserName = User.Identity.GetUserId();

                var userInterests = new Interests()
                {
                    UserId         = currentUserName,
                    Comedy         = model.Comedy,
                    Concerts       = model.Concerts,
                    Conferences    = model.Conferences,
                    Education      = model.Education,
                    Family         = model.Family,
                    Festivals      = model.Festivals,
                    Film           = model.Film,
                    Food           = model.Food,
                    Fundraisers    = model.Fundraisers,
                    Galleries      = model.Galleries,
                    Health         = model.Health,
                    Holidays       = model.Holidays,
                    Literary       = model.Literary,
                    Musuems        = model.Musuems,
                    Neighboorhood  = model.Neighboorhood,
                    NightLife      = model.NightLife,
                    OnCampus       = model.OnCampus,
                    Organizations  = model.Organizations,
                    Outdoors       = model.Outdoors,
                    Pets           = model.Pets,
                    PerformingArts = model.PerformingArts,
                    Politics       = model.Politics,
                    Sales          = model.Sales,
                    Science        = model.Science,
                    Spiritualality = model.Spiritualality,
                    Sports         = model.Sports,
                    Technology     = model.Technology
                };
                _context.Interest.Add(userInterests);
                _context.SaveChanges();
                return(RedirectToAction("Index", "DashBoard"));
            }
        }
Example #2
0
        public ActionResult SelectInterests()
        {
            var           currentUserId = User.Identity.GetUserId();
            List <string> interestsList = new List <string>()
            {
                "Comedy",
                "Concerts",
                "Conferences",
                "Education",
                "Family",
                "Festivals",
                "Film",
                "Food",
                "Fundraisers",
                "Galleries",
                "Health",
                "Holidays",
                "Literary",
                "Musuems",
                "Neighboorhood",
                "Night Life",
                "On Campus",
                "Organizations",
                "Outdoors",
                "Pets",
                "Performing Arts",
                "Politics",
                "Sales",
                "Science",
                "Spiritualality",
                "Sports",
                "Technology"
            };
            SelectInterestsViewModel viewModel = new SelectInterestsViewModel()
            {
                UserId        = currentUserId,
                InterestsList = interestsList
            };

            return(View(viewModel));
        }