Example #1
0
        /// <summary>
        /// Gets the last user in the system.
        /// </summary>
        /// <returns></returns>
        public ForumUser GetLast()
        {
            SharePointListDescriptor descriptor = Provider.GetAllListItems(ForumConstants.Lists_Users);
            SharePointListItem       item       = descriptor.SharePointListItems[descriptor.SharePointListItems.Length - 1];

            return(UserMapper.CreateDomainObject(item));
        }
Example #2
0
        public ForumUser GetLast()
        {
            SharePointListProvider   provider   = new SharePointListProvider(ForumApplication.Instance.SpWeb);
            SharePointListDescriptor descriptor = provider.GetAllListItems(ForumConstants.Lists_Users);
            SharePointListItem       item       = descriptor.SharePointListItems[descriptor.SharePointListItems.Length - 1];

            return(UserMapper.CreateDomainObject(item));
        }
Example #3
0
        /// <summary>
        /// Gets all.
        /// </summary>
        /// <returns></returns>
        public MessageCollection GetAll()
        {
            MessageCollection        messages  = new MessageCollection();
            SharePointListDescriptor postItems = Provider.GetAllListItems(ForumConstants.Lists_Posts);

            foreach (SharePointListItem postItem in postItems.SharePointListItems)
            {
                messages.Add(MessageMapper.CreateDomainObject(postItem));
            }
            return(messages);
        }
Example #4
0
        public MessageCollection GetByTopicId(int id)
        {
            MessageCollection        messages  = new MessageCollection();
            SharePointListDescriptor postItems = Provider.GetListItemsByField(ForumConstants.Lists_Posts, "TopicID", id.ToString());

            foreach (SharePointListItem postItem in postItems.SharePointListItems)
            {
                messages.Add(MessageMapper.CreateDomainObject(postItem));
            }
            return(messages);
        }
Example #5
0
        /// <summary>
        /// Gets all.
        /// </summary>
        /// <returns></returns>
        public GroupCollection GetAll()
        {
            GroupCollection          groups = new GroupCollection();
            SharePointListDescriptor items  = Provider.GetAllListItems(ForumConstants.Lists_Groups);

            foreach (SharePointListItem listItem in items.SharePointListItems)
            {
                groups.Add(new Group(listItem.Id, listItem["Title"]));
            }

            return(groups);
        }
Example #6
0
        public MessageCollection FindByDate(DateTime dateCriteria)
        {
            string isoDate = SPUtility.CreateISO8601DateTimeFromSystemDateTime(dateCriteria);
            SharePointListDescriptor listItems = Provider.GetListItemsByField(ForumConstants.Lists_Posts, "Modified", isoDate);
            MessageCollection        messages  = new MessageCollection();

            foreach (SharePointListItem item in listItems.SharePointListItems)
            {
                messages.Add(MessageMapper.CreateDomainObject(item));
            }
            return(messages);
        }
Example #7
0
        public TopicCollection FindInactive()
        {
            SharePointListDescriptor listItems = Provider.GetListItemsByField(
                ForumConstants.Lists_Topics, "NumPosts", "1");
            TopicCollection topics = new TopicCollection();

            foreach (SharePointListItem item in listItems.SharePointListItems)
            {
                topics.Add(TopicMapper.CreateDomainObject(item));
            }
            return(topics);
        }
Example #8
0
        /// <summary>
        /// Gets all categories.
        /// </summary>
        /// <returns></returns>
        public CategoryCollection GetAll()
        {
            SharePointListDescriptor items = Provider.GetAllListItems(ForumConstants.Lists_Category);

            CategoryCollection categoryCollection = new CategoryCollection();

            foreach (SharePointListItem listItem in items.SharePointListItems)
            {
                categoryCollection.Add(CategoryMapper.CreateDomainObject(listItem));
            }
            return(categoryCollection);
        }
Example #9
0
        public ForumCollection GetAll()
        {
            SharePointListDescriptor descriptor      = Provider.GetAllListItems(ForumConstants.Lists_Forums);
            ForumCollection          forumCollection = new ForumCollection();

            foreach (SharePointListItem listItem in descriptor.SharePointListItems)
            {
                forumCollection.Add(ForumMapper.CreateDomainObject(listItem));
            }

            return(forumCollection);
        }
Example #10
0
        public Hashtable GetPermissionsForForum(int id)
        {
            Hashtable permissions = new Hashtable();
            SharePointListDescriptor listItems = Provider.GetListItemsByField(ForumConstants.Lists_ForumAccess, "ForumID", id.ToString());

            foreach (SharePointListItem listItem in listItems.SharePointListItems)
            {
                Permission perm = new Permission(listItem["Title"]);
                permissions.Add(Convert.ToInt32(listItem["GroupID"]), perm);
            }
            return(permissions);
        }
Example #11
0
        public ForumCollection FindByCategoryId(int id)
        {
            SharePointListDescriptor descriptor      = Provider.GetListItemsByField(ForumConstants.Lists_Forums, "CategoryID", id.ToString());
            ForumCollection          forumCollection = new ForumCollection();

            foreach (SharePointListItem listItem in descriptor.SharePointListItems)
            {
                forumCollection.Add(ForumMapper.CreateDomainObject(listItem));
            }

            return(forumCollection);
        }
Example #12
0
        /// <summary>
        /// Gets all.
        /// </summary>
        /// <returns></returns>
        public ForumUserCollection GetAll()
        {
            ForumUserCollection users = new ForumUserCollection();

            SharePointListDescriptor descriptor = Provider.GetAllListItems(ForumConstants.Lists_Users);

            foreach (SharePointListItem listItem in descriptor.SharePointListItems)
            {
                users.Add(UserMapper.CreateDomainObject(listItem));
            }

            return(users);
        }
Example #13
0
        public TopicCollection GetAll()
        {
            TopicCollection topicCollection = new TopicCollection();

            SharePointListDescriptor descriptor = Provider.GetAllListItems(ForumConstants.Lists_Topics);

            foreach (SharePointListItem listItem in descriptor.SharePointListItems)
            {
                topicCollection.Add(TopicMapper.CreateDomainObject(listItem));
            }

            return(topicCollection);
        }
Example #14
0
        public TopicCollection FindByForumId(int id)
        {
            TopicCollection topicCollection = new TopicCollection();

            SharePointListDescriptor descriptor = Provider.GetListItemsByField(ForumConstants.Lists_Topics, "ForumID", id.ToString());

            foreach (SharePointListItem listItem in descriptor.SharePointListItems)
            {
                topicCollection.Add(TopicMapper.CreateDomainObject(listItem));
            }

            return(topicCollection);
        }