public ProjectForum PutProjectForum(ProjectForum forum) { var project = Umbraco.TypedContent(forum.ParentId); if (project.GetPropertyValue<int>("owner") == Members.GetCurrentMemberId()) { var cs = Services.ContentService; var content = cs.GetById(forum.Id); content.Name = forum.Title; content.SetValue("forumDescription", forum.Description); cs.SaveAndPublish(content); return forum; } return null; }
public ProjectForum PostProjectForum(ProjectForum forum) { var project = Umbraco.TypedContent(forum.ParentId); if (project.GetPropertyValue<int>("owner") == Members.GetCurrentMemberId()) { var cs = Services.ContentService; var content = cs.CreateContent(forum.Title, forum.ParentId, "Forum"); content.Name = forum.Title; content.SetValue("forumDescription", forum.Description); content.SetValue("forumAllowNewTopics", true); cs.SaveAndPublish(content); forum.Id = content.Id; return forum; } return null; }