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