public ActionResult Index(SearchModel model) { if (model.IsValid) { IList <PointModel> points = new SearchService().Search(model); IList <SearchProfileModel> SearchProfiles = new List <SearchProfileModel>(); if (Session.Count > 2) { SearchProfiles = new SearchProfileService().GetSearchProfiles(new Guid(Session["USERNAME_KEY"].ToString())); } ViewBag.SearchProfile = new SelectList(SearchProfiles, "Id", "Name"); ViewBag.Points = points; return(View(model)); } IList <SearchProfileModel> sp = new List <SearchProfileModel>(); if (Session.Count > 2) { sp = new SearchProfileService().GetSearchProfiles(new Guid(Session["USERNAME_KEY"].ToString())); } ViewBag.SearchProfile = new SelectList(sp, "Id", "Name", model.SearchProfile.Id); return(RedirectToAction("Index")); }
public ActionResult Index() { IList <SearchProfileModel> SearchProfiles = new List <SearchProfileModel>(); if (Session.Count > 2) { SearchProfiles = new SearchProfileService().GetSearchProfiles(new Guid(Session["USERNAME_KEY"].ToString())); } ViewBag.SearchProfile = new SelectList(SearchProfiles, "Id", "Name"); SearchModel model = new SearchModel { Coordenate = Session["COORDENATES"].ToString(), Terms = string.Empty }; return(View(model)); }
public Guid InsertUser(UserModel user) { Guid userId = new UserRepository().InsertUser(user); SearchProfileModel myDefaultSearchProfile = new SearchProfileModel { Id = Guid.NewGuid(), Name = "Default", EventsSearchDays = 10, IsActive = true, PointsRangeDistance = 5, SearchCriteria = string.Empty, Utilizador = GetUser(userId), SearchProfileTopics = new TopicService().GetActiveTopics() }; Guid id = new SearchProfileService().InsertSearchProfile(myDefaultSearchProfile); return(userId); }
public SearchProfileController(SearchProfileService searchProfileService) { _searchProfileService = searchProfileService; }