예제 #1
0
 protected void lnkFriendsRequests_Click(object sender, EventArgs e)
 {
     if (HttpContext.Current == null)
         HttpContext.Current = itsContext;
     ProcessMenuButtonClick((LinkButton)sender, "Quick Friends Search", "Friends Requests", true);
     var results = new FacebookAndUsersMergeResults
     {
         Usernames = Classes.User.FetchOpenFriendshipRequestsToUsernme(CurrentUserSession.Username).ToArray(),
         FacebookIds = null
     };
     SearchResults.Results = results;
 }
예제 #2
0
 protected void lnkShowFavorites_Click(object sender, EventArgs e)
 {
     if (HttpContext.Current == null)
         HttpContext.Current = itsContext;
     ProcessMenuButtonClick((LinkButton)sender, "Quick Friends Search", "Favorites Users", true);
     var results = new FacebookAndUsersMergeResults
                       {
                           Usernames = Classes.User.FetchFavouriteUsers(CurrentUserSession.Username),
                           FacebookIds = null
                       };
     SearchResults.Results = results;
 }
예제 #3
0
 protected void lnkQuickSearch_Click(object sender, EventArgs e)
 {
     if (HttpContext.Current == null)
         HttpContext.Current = itsContext;
     ProcessMenuButtonClick((LinkButton)sender, "Quick Friends Search", "Friends Search Results", false);
     if (CurrentUserSession != null)
     {
         var search1 = new BasicFriendsSearch
         {
             Username = CurrentUserSession.Username,
             Active = true,
             Deleted = false,
             SortByColumn = OrderByColumnEnum.FacebookMutualFriends,
             FriendUsername = String.Empty
         };
         if (CurrentUserSession != null) search1.ExcludeUsername.Add(CurrentUserSession.Username);
         if (MatchmakerHelper.IsMatchToFriendAlredySelected) search1.ExcludeUsername.Add(MatchmakerHelper.MatchToUsername);
         DateTime time1 = DateTime.Now;
         var res1 = search1.GetResults();
         DateTime time2 = DateTime.Now;
         TimeSpan delta = time2/* DateTime.Now*/ - time1;
         string[] usernames = (res1 != null) ? res1.Usernames : null;
         //var search2 = new FacebookFriendsSearch();
         //var res2 = search2.GetResults();
         //string[] fbFriendsIds = (res2 !=null) ? res2.Usernames : null;
         var results = new FacebookAndUsersMergeResults
                         {
                             Usernames = usernames,
                             FacebookIds = null//fbFriendsIds
                         };
         SearchResults.Results = results;
     }
 }
예제 #4
0
        protected void lnkShowOnlineFriends_Click(object sender, EventArgs e)
        {
            if (HttpContext.Current == null)
                HttpContext.Current = itsContext;

            if (CurrentUserSession == null) return;

            ProcessMenuButtonClick((LinkButton)sender, "Quick Friends Search", "Online Friends", true);
            var search = new OnlineFriendsSearch
                             {
                                 Username = CurrentUserSession.Username,
                                 Active = true,
                                 Deleted = false,
                                 SortByColumn = OrderByColumnEnum.LastOnline,
                                 FriendUsername = String.Empty
                             };
            search.ExcludeUsername.Add(CurrentUserSession.Username);
            var results = new FacebookAndUsersMergeResults
                            {
                                Usernames = search.GetResults().Usernames,
                                FacebookIds = null
                            };
            SearchResults.Results = results;
        }
예제 #5
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            if (HttpContext.Current == null)
                HttpContext.Current = itsContext;
            bool isUsernameSearch = !IsPostBack || txtUsername.Text.Trim().Length > 0;
            BasicFriendsSearch search = new BasicFriendsSearch
                                            {
                                                Username = CurrentUserSession.Username,
                                                FriendUsername = isUsernameSearch ? txtUsername.Text.Trim() : null
                                            };

            if (Config.Users.RequireProfileToShowInSearch)
            {
                search.HasAnswer = true;
            }
            else
            {
                search.hasAnswer_isSet = false;
            }
            if (!Config.Users.DisableGenderInformation)
            {
                search.Gender = (User.eGender)SearchGenderPicker1.LookingForGender;
                //if (Config.Users.InterestedInFieldEnabled && !Config.Users.DisableGenderInformation)
                //    search.InterestedIn = (User.eGender) SearchGenderPicker1.InterestedInGender;
            }
            if (!Config.Users.DisableAgeInformation)
            {
                try
                {
                    search.MinAge = AgeRangePicker1.AgeFrom;
                    search.MaxAge = AgeRangePicker1.AgeTo;
                }
                catch
                {
                }
            }
            if (Config.Users.LocationPanelVisible)
            {
                if (SearchLocationPicker1 != null)
                {
                    search.Country = (SearchLocationPicker1.Country.IsNullOrEmpty()) ? "" : SearchLocationPicker1.Country;
                    search.State = (SearchLocationPicker1.Region.IsNullOrEmpty()) ? "" : SearchLocationPicker1.Region;
                    search.City = (SearchLocationPicker1.City.IsNullOrEmpty()) ? "" : SearchLocationPicker1.City;
                }
            }

            if (cbPhotoReq.Checked)
                search.HasPhoto = true;

            if (CurrentUserSession != null) search.ExcludeUsername.Add(CurrentUserSession.Username);
            if (MatchmakerHelper.IsMatchToFriendAlredySelected) search.ExcludeUsername.Add(MatchmakerHelper.MatchToUsername);
            var results = new FacebookAndUsersMergeResults
                           {
                               Usernames = search.GetResults().Usernames,
                               FacebookIds = null
                           };
            SearchResults.Results = results;
            SetSearchresultViewableProperties();
        }