/// <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 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); }
/// <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); }
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; }
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); }
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)); } }