Exemple #1
0
        public async Task <List <IUserInfo> > GetUserSearchPage(
            int siteId,
            int pageNumber,
            int pageSize,
            string searchInput,
            int sortMode)
        {
            if (multiTenantOptions.UseRelatedSitesMode)
            {
                siteId = multiTenantOptions.RelatedSiteId;
            }

            //sortMode: 0 = DisplayName asc, 1 = JoinDate desc, 2 = Last, First

            List <IUserInfo> userList = new List <IUserInfo>();

            using (DbDataReader reader = dbSiteUser.GetUserSearchPage(
                       siteId,
                       pageNumber,
                       pageSize,
                       searchInput,
                       sortMode))
            {
                while (reader.Read())
                {
                    UserInfo user = new UserInfo();
                    user.LoadFromReader(reader);
                    userList.Add(user);
                }
            }

            return(userList);
        }