示例#1
0
		/// <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;
		}
示例#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;
		}
示例#3
0
		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;
		}
示例#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);
		}
示例#5
0
		/// <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>&nbsp;</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>"));
		}
示例#7
0
		public virtual void Remove(Group group)
		{
			List.Remove(group);
		}
示例#8
0
		/// <summary>
		/// Adds the specified group.
		/// </summary>
		/// <param name="group">The group.</param>
		/// <returns></returns>
		public int Add(Group group)
		{
			return List.Add(group);
		}
示例#9
0
		/// <summary>
		/// Saves the specified group.
		/// </summary>
		/// <param name="group">The group.</param>
		/// <returns></returns>
		public int Save(Group group)
		{
			return _dao.Save(group);
		}