Example #1
0
 private void BindForSearch()
 {
     if (canManageUsers)
     {
         if (ipSearchText.Length > 0)
         {
             siteUserPage = SiteUser.GetByIPAddress(siteSettings.SiteGuid, ipSearchText);
         }
         else
         {
             // admins can also search against email address
             siteUserPage = SiteUser.GetUserAdminSearchPage(
                 siteSettings.SiteId,
                 pageNumber,
                 pageSize,
                 searchText,
                 sortMode,
                 out totalPages
                 );
         }
     }
     else
     {
         siteUserPage = SiteUser.GetUserSearchPage(
             siteSettings.SiteId,
             pageNumber,
             pageSize,
             searchText,
             sortMode,
             out totalPages
             );
     }
 }
Example #2
0
        private void BindForSearch()
        {
            if (canManageUsers)
            {
                if (ipSearchText.Length > 0)
                {
                    siteUserPage = SiteUser.GetByIPAddress(siteSettings.SiteGuid, ipSearchText);
                }
                else
                {
                    // admins can also search against email address
                    siteUserPage = SiteUser.GetUserAdminSearchPage(
                        siteSettings.SiteId,
                        pageNumber,
                        pageSize,
                        searchText,
                        sortMode,
                        out totalPages);
                }
            }
            else
            {
                siteUserPage = SiteUser.GetUserSearchPage(
                    siteSettings.SiteId,
                    pageNumber,
                    pageSize,
                    searchText,
                    sortMode,
                    out totalPages);
            }


            //if (searchText.Length > 0)
            //{
            //    txtSearchUser.Text = Server.HtmlEncode(searchText);
            //}

            //AddAlphaPagerLinks();


            //string pageUrl = SiteRoot
            //    + "/MemberList.aspx?"
            //    + "search=" + Server.UrlEncode(Server.HtmlEncode(searchText))
            //    + "&pagenumber={0}"
            //    +"&sd=" + sortMode.ToInvariantString(); ;

            //pgrMembers.PageURLFormat = pageUrl;
            //pgrMembers.ShowFirstLast = true;
            //pgrMembers.CurrentIndex = pageNumber;
            //pgrMembers.PageSize = pageSize;
            //pgrMembers.PageCount = totalPages;
            //pgrMembers.Visible = (totalPages > 1);


            //rptUsers.DataSource = siteUserPage;
            //rptUsers.DataBind();
        }
Example #3
0
        private void BindForSearch()
        {
            List <SiteUser> siteUserPage;

            if (canManageUsers)
            {
                // admins can also search against email address
                siteUserPage = SiteUser.GetUserAdminSearchPage(
                    siteSettings.SiteId,
                    pageNumber,
                    pageSize,
                    searchText,
                    sortMode,
                    out totalPages);
            }
            else
            {
                siteUserPage = SiteUser.GetUserSearchPage(
                    siteSettings.SiteId,
                    pageNumber,
                    pageSize,
                    searchText,
                    sortMode,
                    out totalPages);
            }

            if (pageNumber > totalPages)
            {
                pageNumber = 1;
            }

            if (searchText.Length > 0)
            {
                txtSearchUser.Text = Server.HtmlEncode(searchText);
            }

            AddAlphaPagerLinks();


            string pageUrl = SiteRoot
                             + "/MemberList.aspx?"
                             + "search=" + Server.UrlEncode(Server.HtmlEncode(searchText))
                             + "&amp;pagenumber={0}"
                             + "&amp;sd=" + sortMode.ToInvariantString();;

            pgrMembers.PageURLFormat = pageUrl;
            pgrMembers.ShowFirstLast = true;
            pgrMembers.CurrentIndex  = pageNumber;
            pgrMembers.PageSize      = pageSize;
            pgrMembers.PageCount     = totalPages;
            pgrMembers.Visible       = (totalPages > 1);


            rptUsers.DataSource = siteUserPage;
            rptUsers.DataBind();
        }
Example #4
0
        private void BindListForAdmin()
        {
            List <SiteUser> siteUserPage = SiteUser.GetUserSearchPage(
                CurrentSite.SiteId,
                pageNumber,
                pageSize,
                userNameBeginsWith,
                0,
                out totalPages);

            if (pageNumber > totalPages)
            {
                pageNumber = 1;
            }

            if (userNameBeginsWith.Length > 1)
            {
                txtSearchUser.Text = Server.HtmlEncode(userNameBeginsWith);
            }

            Literal topPageLinks = new Literal();
            string  pageUrl      = SiteRoot
                                   + "/Dialog/UserSelectorDialog.aspx?"
                                   + "pagenumber=";

            String alphaChars;

            if (WebConfigSettings.GetAlphaPagerCharsFromResourceFile)
            {
                alphaChars = Resource.AlphaPagerChars;
            }
            else
            {
                alphaChars = WebConfigSettings.AlphaPagerChars;
            }

            topPageLinks.Text = UIHelper.GetAlphaPagerLinks(
                pageUrl,
                pageNumber,
                alphaChars,
                userNameBeginsWith);

            this.spnTopPager.Controls.Add(topPageLinks);

            pageUrl = SiteRoot
                      + "/Dialog/UserSelectorDialog.aspx?"
                      + "letter=" + userNameBeginsWith
                      + "&amp;pagenumber={0}";

            pgrMembers.PageURLFormat = pageUrl;
            pgrMembers.ShowFirstLast = true;
            pgrMembers.CurrentIndex  = pageNumber;
            pgrMembers.PageSize      = pageSize;
            pgrMembers.PageCount     = totalPages;
            pgrMembers.Visible       = (totalPages > 1);


            this.rptUsers.DataSource = siteUserPage;
#if MONO
            this.rptUsers.DataBind();
#else
            this.DataBind();
#endif
        }
        private void BindForSearch()
        {
            List <SiteUser> siteUserPage;

            if (WebUser.IsAdmin)
            {
                // admins can also search against email address
                siteUserPage = SiteUser.GetUserAdminSearchPage(
                    siteSettings.SiteId,
                    pageNumber,
                    pageSize,
                    searchText,
                    out totalPages);
            }
            else
            {
                siteUserPage = SiteUser.GetUserSearchPage(
                    siteSettings.SiteId,
                    pageNumber,
                    pageSize,
                    searchText,
                    out totalPages);
            }

            if (pageNumber > totalPages)
            {
                pageNumber = 1;
            }

            if (searchText.Length > 0)
            {
                txtSearchUser.Text = Server.HtmlEncode(searchText);
            }

            Literal topPageLinks = new Literal();
            string  pageUrl      = SiteRoot + "/MemberList.aspx?pagenumber=";

            string alphaChars;

            if (WebConfigSettings.GetAlphaPagerCharsFromResourceFile)
            {
                alphaChars = Resource.AlphaPagerChars;
            }
            else
            {
                alphaChars = WebConfigSettings.AlphaPagerChars;
            }

            topPageLinks.Text = UIHelper.GetAlphaPagerLinks(
                pageUrl,
                pageNumber,
                alphaChars,
                userNameBeginsWith);

            this.spnTopPager.Controls.Add(topPageLinks);

            pageUrl = SiteRoot
                      + "/MemberList.aspx?"
                      + "search=" + Server.UrlEncode(Server.HtmlEncode(searchText))
                      + "&amp;pagenumber={0}";

            pgrMembers.PageURLFormat = pageUrl;
            pgrMembers.ShowFirstLast = true;
            pgrMembers.CurrentIndex  = pageNumber;
            pgrMembers.PageSize      = pageSize;
            pgrMembers.PageCount     = totalPages;
            pgrMembers.Visible       = (totalPages > 1);


            rptUsers.DataSource = siteUserPage;
            rptUsers.DataBind();
        }