/// <summary> /// Finds the by id. /// </summary> /// <param name="id">The id.</param> /// <returns></returns> public Group FindById(int id) { SharePointListItem listItem = Provider.GetListItembyID(ForumConstants.Lists_Groups, id); Group group = new Group(); group.Id = listItem.Id; group.Name = listItem["Title"]; return group; }
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; }
private void LoadControlValues() { groupId = ValidInt(HttpContext.Current.Request.QueryString["group"]); if (groupId == 0) group = new Group("New Group"); else group = RepositoryRegistry.GroupRepository.FindById(groupId); txtName.Text = group.Name; }
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 group. /// </summary> /// <param name="group">The group.</param> /// <returns></returns> public int Save(Group group) { 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); }
private void DisplayGroups(Group group, Forum forum) { Controls.Add(new LiteralControl("<tr class=\"ms-alternating\">")); Controls.Add(new LiteralControl("<td> </td>")); Controls.Add(new LiteralControl(string.Format("<td>{0}</td>", group.Name))); string editLink = ForumApplication.Instance.GetLink(SharePointForumControls.ManageForumGroupPermissions, "forum={0}&group={1}", forum.Id, group.Id); Controls.Add(new LiteralControl(string.Format("<td align=center><a href=\"{0}\">Edit</a></td>", editLink))); string permissionDisplay = "None"; foreach (DictionaryEntry permission in forum.Permissions) { if (Convert.ToInt32(permission.Key) == group.Id) { Permission perm = new Permission(permission.Value.ToString()); permissionDisplay = perm.DisplayString; } } Controls.Add(new LiteralControl(string.Format("<td align=center>{0}</td>", permissionDisplay))); Controls.Add(new LiteralControl("</tr>")); }
public virtual void Remove(Group group) { List.Remove(group); }
/// <summary> /// Adds the specified group. /// </summary> /// <param name="group">The group.</param> /// <returns></returns> public int Add(Group group) { return List.Add(group); }
/// <summary> /// Saves the specified group. /// </summary> /// <param name="group">The group.</param> /// <returns></returns> public int Save(Group group) { return _dao.Save(group); }