Exemple #1
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));
        }
Exemple #2
0
 public Group FindById(int id)
 {
     SharePointListProvider provider = new SharePointListProvider(ForumApplication.Instance.SpWeb);
     SharePointListItem listItem = provider.GetListItembyID(ForumConstants.Lists_Groups, id);
     Group group = new Group();
     group.Id = listItem.Id;
     group.Name = listItem["Title"];
     return group;
 }
Exemple #3
0
        public Group FindById(int id)
        {
            SharePointListProvider provider = new SharePointListProvider(ForumApplication.Instance.SpWeb);
            SharePointListItem     listItem = provider.GetListItembyID(ForumConstants.Lists_Groups, id);
            Group group = new Group();

            group.Id   = listItem.Id;
            group.Name = listItem["Title"];
            return(group);
        }
Exemple #4
0
        public int Save(Group group)
        {
            SharePointListProvider provider = new SharePointListProvider(ForumApplication.Instance.SpWeb);
            string[] values = {
				"Title", group.Name,
			};
            SharePointListItem listItem = new SharePointListItem(group.Id, values);
            if (group.Id == 0)
                return provider.AddListItem(ForumConstants.Lists_Groups, listItem);
            else
                return provider.UpdateListItem(ForumConstants.Lists_Groups, listItem);
        }
Exemple #5
0
        public IList <Group> GetAll()
        {
            IList <Group>            groups   = new List <Group>();
            SharePointListProvider   provider = new SharePointListProvider(ForumApplication.Instance.SpWeb);
            SharePointListDescriptor items    = provider.GetAllListItems(ForumConstants.Lists_Groups);

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

            return(groups);
        }
Exemple #6
0
        public IList<Group> GetAll()
        {
            IList<Group> groups = new List<Group>();
            SharePointListProvider provider = new SharePointListProvider(ForumApplication.Instance.SpWeb);
            SharePointListDescriptor items = provider.GetAllListItems(ForumConstants.Lists_Groups);

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

            return groups;
        }
Exemple #7
0
        public ForumUser GetBySharePointId(int id)
        {
            SharePointListProvider provider = new SharePointListProvider(ForumApplication.Instance.SpWeb);
            SharePointListItem listItem = provider.GetListItemByField(ForumConstants.Lists_Users, "UserID", id.ToString());

            if (null == listItem)
            {
                CreateUserFromSharePointId(id);
                listItem = provider.GetListItemByField(ForumConstants.Lists_Users, "UserID", id.ToString());
            }

            return UserMapper.CreateDomainObject(listItem);
        }
Exemple #8
0
        public IList<ForumUser> GetAll()
        {
            IList<ForumUser> users = new List<ForumUser>();

            SharePointListProvider provider = new SharePointListProvider(ForumApplication.Instance.SpWeb);
            SharePointListDescriptor descriptor = provider.GetAllListItems(ForumConstants.Lists_Users);
            foreach (SharePointListItem listItem in descriptor.SharePointListItems)
            {
                users.Add(UserMapper.CreateDomainObject(listItem));
            }

            return users;
        }
Exemple #9
0
        public ForumUser GetBySharePointId(int id)
        {
            SharePointListProvider provider = new SharePointListProvider(ForumApplication.Instance.SpWeb);
            SharePointListItem     listItem = provider.GetListItemByField(ForumConstants.Lists_Users, "UserID", id.ToString());

            if (null == listItem)
            {
                CreateUserFromSharePointId(id);
                listItem = provider.GetListItemByField(ForumConstants.Lists_Users, "UserID", id.ToString());
            }

            return(UserMapper.CreateDomainObject(listItem));
        }
Exemple #10
0
        public IList <ForumUser> GetAll()
        {
            IList <ForumUser> users = new List <ForumUser>();

            SharePointListProvider   provider   = new SharePointListProvider(ForumApplication.Instance.SpWeb);
            SharePointListDescriptor descriptor = provider.GetAllListItems(ForumConstants.Lists_Users);

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

            return(users);
        }
Exemple #11
0
        public int Save(ForumUser user)
        {
            int userId;

            SharePointListProvider provider = new SharePointListProvider(ForumApplication.Instance.SpWeb);
            SharePointListItem listItem = UserMapper.CreateDto(user);

            if (user.Id == 0)
            {
                userId = provider.AddListItem(ForumConstants.Lists_Users, listItem);
            }
            else
            {
                userId = provider.UpdateListItem(ForumConstants.Lists_Users, listItem);
            }

            return userId;
        }
Exemple #12
0
        public int Save(ForumUser user)
        {
            int userId;

            SharePointListProvider provider = new SharePointListProvider(ForumApplication.Instance.SpWeb);
            SharePointListItem     listItem = UserMapper.CreateDto(user);

            if (user.Id == 0)
            {
                userId = provider.AddListItem(ForumConstants.Lists_Users, listItem);
            }
            else
            {
                userId = provider.UpdateListItem(ForumConstants.Lists_Users, listItem);
            }

            return(userId);
        }
Exemple #13
0
        public int Save(Group group)
        {
            SharePointListProvider provider = new SharePointListProvider(ForumApplication.Instance.SpWeb);

            string[] values =
            {
                "Title", group.Name,
            };
            SharePointListItem listItem = new SharePointListItem(group.Id, values);

            if (group.Id == 0)
            {
                return(provider.AddListItem(ForumConstants.Lists_Groups, listItem));
            }
            else
            {
                return(provider.UpdateListItem(ForumConstants.Lists_Groups, listItem));
            }
        }
 public bool DeleteList(Guid guid)
 {
     SharePointListProvider provider = new SharePointListProvider(this.web);
     return provider.DeleteList(guid);
 }
 public Guid CreateList(string listName)
 {
     SharePointListProvider provider = new SharePointListProvider(this.web);
     return provider.CreateList(listName);
 }
Exemple #16
0
        public Guid CreateList(string listName)
        {
            SharePointListProvider provider = new SharePointListProvider(this.web);

            return(provider.CreateList(listName));
        }
Exemple #17
0
        public bool DeleteList(Guid guid)
        {
            SharePointListProvider provider = new SharePointListProvider(this.web);

            return(provider.DeleteList(guid));
        }
Exemple #18
0
        public SharePointListDescriptor GetListById(Guid guid)
        {
            SharePointListProvider provider = new SharePointListProvider(this.web);

            return(provider.GetListById(guid));
        }
Exemple #19
0
        public Guid GetListByName(string listName)
        {
            SharePointListProvider provider = new SharePointListProvider(this.web);

            return(provider.GetListByName(listName));
        }
 public SharePointListDescriptor GetListById(Guid guid)
 {
     SharePointListProvider provider = new SharePointListProvider(this.web);
     return provider.GetListById(guid);
 }
Exemple #21
0
 /// <summary>
 /// Adds the list values.
 /// </summary>
 /// <param name="values">The values.</param>
 protected void AddListValues(string[] values)
 {
     SharePointListItem listItem = new SharePointListItem(0, values);
     SharePointListProvider provider = new SharePointListProvider(ForumApplication.Instance.SpWeb);
     provider.AddListItem(listName, listItem);
 }
 public Guid GetListByName(string listName)
 {
     SharePointListProvider provider = new SharePointListProvider(this.web);
     return provider.GetListByName(listName);
 }
Exemple #23
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);
 }