Example #1
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);
		}
Example #2
0
        /// <summary>
        /// Saves the specified category.
        /// </summary>
        /// <param name="category">The category.</param>
        /// <returns></returns>
        public int Save(Category category)
        {
            SharePointListItem listItem = CategoryMapper.CreateDto(category);
            int categoryId;

            if (listItem.Id == 0)
            {
                categoryId = provider.AddListItem(ForumConstants.Lists_Category, listItem);
            }
            else
            {
                categoryId = provider.UpdateListItem(ForumConstants.Lists_Category, listItem);
            }

            return(categoryId);
        }
Example #3
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;
		}
Example #4
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);
        }
Example #5
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));
            }
        }