示例#1
0
 public abstract IList<Article> FindArticles(Filter<string> categoryName,
                                    Filter<string> searchFor,
                                    Filter<string> author,
                                    Filter<string> owner,
                                    Filter<string> tag, 
                                    DateTime? fromDate, DateTime? toDate,
                                    ArticleStatus status,
                                    PagingInfo paging);
示例#2
0
 public abstract IList<Message> FindMessages(Filter<string> categoryName,
                                    Filter<string> searchFor,
                                    Filter<string> owner,
                                    Filter<string> tag,  
                                    DateTime? fromDate, DateTime? toDate,
                                    PagingInfo paging);
        public override IList<Item> FindItems(Filter<string> categoryName,
                                            Filter<string> tag, 
                                           DateTime? fromDate, DateTime? toDate,
                                           PagingInfo paging)
        {
            using (TransactionScope transaction = new TransactionScope(mConfiguration))
            {
                ItemDataStore dataStore = new ItemDataStore(transaction);

                return dataStore.FindByFields(categoryName, tag, fromDate, toDate, paging);
            }
        }
        public override IList<Item> GetItems(Category category, PagingInfo paging)
        {
            using (TransactionScope transaction = new TransactionScope(mConfiguration))
            {
                ItemDataStore dataStore = new ItemDataStore(transaction);

                return dataStore.FindByCategory(category, paging);
            }
        }
示例#5
0
 public static IList<Item> GetItems(Category category, PagingInfo paging)
 {
     return Provider.GetItems(category, paging);
 }
        public override ProfileInfoCollection GetAllProfiles(ProfileAuthenticationOption authenticationOption,
                                                             int pageIndex, int pageSize, out int totalRecords)
        {
            ProfileType? profileType = null;
            if (authenticationOption == ProfileAuthenticationOption.Anonymous)
                profileType = ProfileType.Anonymous;
            else if (authenticationOption == ProfileAuthenticationOption.Authenticated)
                profileType = ProfileType.Authenticated;

            using (new TransactionScope(_connName))
            {
                DSSEOProfile profileStore = DSSEOProfile.Create(_connName);

                var paging = new PagingInfo(pageSize, pageIndex);
                IList<SEOProfile> users = profileStore.FindByFields(ApplicationName,
                                                                    null, null, profileType, paging);
                totalRecords = (int) paging.RowCount;

                return ProfilesToProfileInfoCollection(users);
            }
        }
        /// <summary>
        /// Gets a collection of membership users where the user name contains the specified user name to match.
        /// </summary>
        /// <returns>
        /// A <see cref="T:System.Web.Security.MembershipUserCollection" /> collection that contains a page of <paramref name="pageSize" /><see cref="T:System.Web.Security.MembershipUser" /> objects beginning at the page specified by <paramref name="pageIndex" />.
        /// </returns>
        /// <param name="usernameToMatch">The user name to search for.</param>
        /// <param name="pageIndex">The index of the page of results to return. <paramref name="pageIndex" /> is zero-based.</param>
        /// <param name="pageSize">The size of the page of results to return.</param>
        /// <param name="totalRecords">The total number of matched users.</param>
        public override MembershipUserCollection FindUsersByName(string usernameToMatch, int pageIndex, int pageSize,
                                                                 out int totalRecords)
        {
            var membershipUsers = new MembershipUserCollection();

            var tran = BeginTransaction();
            try
            {
                var dataStore = DSSEOToolsetUser.Create(_connName);

                var paging = new PagingInfo(pageSize, pageIndex);
                var users = dataStore.FindByNameLike(usernameToMatch, paging);
                totalRecords = (int) paging.RowCount;

                foreach (var u in users)
                    membershipUsers.Add(UserToMembershipUser(u));
                tran.Commit();
            }
            catch (Exception ex)
            {
                tran.Rollback();
                LogException(ex, "FindUsersByName");
                totalRecords = 0;
            }

            return membershipUsers;
        }
示例#8
0
 public static IList<Topic> GetTopics(Category category, PagingInfo paging)
 {
     return Provider.GetTopics(category, paging);
 }
示例#9
0
 public abstract IList<Item> FindItems(Filter<string> categoryName,
                                     Filter<string> tag, 
                                    DateTime? fromDate, DateTime? toDate,
                                    PagingInfo paging);
示例#10
0
 public abstract IList<Item> GetItems(Category category,
                                     PagingInfo paging);
        public override System.Web.Security.MembershipUserCollection GetAllUsers(int pageIndex, int pageSize, out int totalRecords)
        {
            System.Web.Security.MembershipUserCollection membershipUsers = new MembershipUserCollection();

            using (TransactionScope transaction = new TransactionScope(mConfiguration))
            {
                UserDataStore dataStore = new UserDataStore(transaction);

                PagingInfo paging = new PagingInfo(pageSize, pageIndex);
                IList<User> users = dataStore.FindAll(ApplicationName, paging);
                totalRecords = (int)paging.RowCount;

                foreach (User u in users)
                    membershipUsers.Add(UserToMembershipUser(u));
            }

            return membershipUsers;
        }
示例#12
0
 public static IList<Article> FindArticles(Filter<string> categoryName,
                                    Filter<string> searchFor,
                                    Filter<string> author,
                                    Filter<string> owner,
                                    Filter<string> tag,  
                                    DateTime? fromDate, DateTime? toDate,
                                    ArticleStatus status,
                                    PagingInfo paging)
 {
     return Provider.FindArticles(categoryName, searchFor,
                                 author, owner,
                                 tag,
                                  fromDate, toDate,
                                  status,
                                  paging);
 }
        public override ProfileInfoCollection GetAllProfiles(ProfileAuthenticationOption authenticationOption, 
                        int pageIndex, int pageSize, out int totalRecords)
        {
            ProfileType? profileType = null;
            if (authenticationOption == ProfileAuthenticationOption.Anonymous)
                profileType = ProfileType.Anonymous;
            else if (authenticationOption == ProfileAuthenticationOption.Authenticated)
                profileType = ProfileType.Authenticated;

            using (TransactionScope transaction = new TransactionScope(mConfiguration))
            {
                ProfileUserDataStore profileStore = new ProfileUserDataStore(transaction);

                PagingInfo paging = new PagingInfo(pageSize, pageIndex);
                IList<ProfileUser> users = profileStore.FindByFields(ApplicationName,
                        null, null, profileType, paging);
                totalRecords = (int)paging.RowCount;

                return ProfileUsersToProfileInfoCollection(users);
            }
        }
示例#14
0
 public abstract IList<Topic> GetTopics(Category category, PagingInfo paging);
        /// <summary>
        /// Gets a collection of all the users in the data source in pages of data.
        /// </summary>
        /// <returns>
        /// A <see cref="T:System.Web.Security.MembershipUserCollection" /> collection that contains a page of <paramref name="pageSize" /><see cref="T:System.Web.Security.MembershipUser" /> objects beginning at the page specified by <paramref name="pageIndex" />.
        /// </returns>
        /// <param name="pageIndex">The index of the page of results to return. <paramref name="pageIndex" /> is zero-based.</param>
        /// <param name="pageSize">The size of the page of results to return.</param>
        /// <param name="totalRecords">The total number of matched users.</param>
        public override MembershipUserCollection GetAllUsers(int pageIndex, int pageSize, out int totalRecords)
        {
            var membershipUsers = new MembershipUserCollection();
            totalRecords = 0;

            var tran = BeginTransaction();
            try
            {
                var dataStore = DSSEOToolsetUser.Create(_connName);

                var paging = new PagingInfo(pageSize, pageIndex);
                var users = dataStore.Find(dataStore.CreateCriteria(), paging);
                totalRecords = (int) paging.RowCount;

                foreach (var u in users)
                    membershipUsers.Add(UserToMembershipUser(u));

                tran.Commit();
            }
            catch (Exception ex)
            {
                LogException(ex, "GetAllUsers");
                tran.Rollback();
            }

            return membershipUsers;
        }
示例#16
0
 public static IList<Message> FindMessages(Filter<string> categoryName,
                            Filter<string> searchFor,
                            Filter<string> owner,
                            Filter<string> tag,  
                            DateTime? fromDate, DateTime? toDate,
                            PagingInfo paging)
 {
     return Provider.FindMessages(categoryName, searchFor, owner, tag, fromDate, toDate, paging);
 }
        public override IList<Message> FindMessages(Filter<string> categoryName,
                                           Filter<string> searchFor,
                                           Filter<string> owner,
                                           Filter<string> tag,
                                           DateTime? fromDate, DateTime? toDate,
                                           PagingInfo paging)
        {
            //TODO Evaluate if is better to returns a light object to don't load all the attachments and the forum data

            using (TransactionScope transaction = new TransactionScope(Configuration))
            {
                MessageDataStore store = new MessageDataStore(transaction);

                return store.FindByFields(categoryName, searchFor, owner, tag, fromDate, toDate, paging);
            }
        }
        public override IList<Article> FindArticles(Filter<string> categoryName,
                                           Filter<string> searchFor,
                                           Filter<string> author,
                                           Filter<string> owner,
                                           Filter<string> tag,  
                                           DateTime? fromDate, DateTime? toDate,
                                           ArticleStatus status,
                                           PagingInfo paging)
        {
            using (TransactionScope transaction = new TransactionScope(mConfiguration))
            {
                ArticleDataStore dataStore = new ArticleDataStore(transaction);

                return dataStore.FindByFields(categoryName, searchFor,
                                                author, owner,
                                                tag,
                                                fromDate, toDate,
                                                status,
                                                paging);
            }
        }
        public override IList<Topic> GetTopics(Category category, PagingInfo paging)
        {
            using (TransactionScope transaction = new TransactionScope(Configuration))
            {
                TopicDataStore dataStore = new TopicDataStore(transaction);

                return dataStore.Find(category, paging);
            }
        }
示例#20
0
 public static IList<Item> FindItems(Filter<string> categoryName,
                             Filter<string> tag, 
                            DateTime? fromDate, DateTime? toDate,
                            PagingInfo paging)
 {
     return Provider.FindItems(categoryName, tag, fromDate, toDate, paging);
 }
        public override ProfileInfoCollection FindInactiveProfilesByUserName(
            ProfileAuthenticationOption authenticationOption,
            string usernameToMatch, DateTime userInactiveSinceDate,
            int pageIndex, int pageSize, out int totalRecords)
        {
            ProfileType? profileType = null;
            if (authenticationOption == ProfileAuthenticationOption.Anonymous)
                profileType = ProfileType.Anonymous;
            else if (authenticationOption == ProfileAuthenticationOption.Authenticated)
                profileType = ProfileType.Authenticated;

            using (var transaction = new TransactionScope(_connName))
            {
                DSSEOProfile profileStore = DSSEOProfile.Create(_connName);

                var paging = new PagingInfo(pageSize, pageIndex);
                IList<SEOProfile> users = profileStore.FindByFields(ApplicationName,
                                                                    usernameToMatch, userInactiveSinceDate, profileType,
                                                                    paging);
                totalRecords = (int) paging.RowCount;

                return ProfilesToProfileInfoCollection(users);
            }
        }