public static void ChangeParent(string idChild, string idParent) { Topic child = (Topic)TopicList.Search(t => ((Topic)t).Id == new Guid(idChild)); Topic parent = (Topic)TopicList.Search(t => ((Topic)t).Id == new Guid(idParent)); child.Parent = parent; child.Update(); }
public static string AddTopicBelong(string Id) { Guid topicId = new Guid(Id); Topic topic = (Topic)TopicList.Search(t => ((Topic)t).Id == topicId); TopicBelongList.Add(topic); System.Web.Script.Serialization.JavaScriptSerializer js = new System.Web.Script.Serialization.JavaScriptSerializer(); return(js.Serialize(TopicBelongList)); }
public static string GetArticleCommentNewList(string topicId, int startIndex, int maximumRows, string sortExpressions) { Guid idTopic = new Guid(topicId); Topic topic = (Topic)TopicList.Search(o => ((Topic)o).Id == idTopic); ArticleListCommentNew = ArticleCollection.GetArticleCollectionPublishCommentNew(topic); System.Web.Script.Serialization.JavaScriptSerializer js = new System.Web.Script.Serialization.JavaScriptSerializer(); return(js.Serialize(ArticleListCommentNew.GetSegment(startIndex, maximumRows, sortExpressions))); }
public static string DeleteTopicBelong(string[] arrId) { foreach (string Id in arrId) { Guid topicId = new Guid(Id); Topic topic = (Topic)TopicList.Search(t => ((Topic)t).Id == topicId); TopicBelongList.Remove(topic); } System.Web.Script.Serialization.JavaScriptSerializer js = new System.Web.Script.Serialization.JavaScriptSerializer(); return(js.Serialize(TopicBelongList)); }
public static void ArticleNew(Guid idTopic) { Article item = new Article(); item.Id = Guid.NewGuid(); item.UserAdd = System.Web.HttpContext.Current.User.Identity.Name; item.CreatedDate = DateTime.Now; item.ModifiedDate = DateTime.Now; Topic topic = (Topic)TopicList.Search(o => ((Topic)o).Id == idTopic); item.PageId = topic.PageId; PSCDialog.DataShare = new ArticleArgs(item, item.GetDescription(), item.GetContent(), false); }
public static string SecurityUI(string id) { Guid topicId = new Guid(id); Topic topic = (Topic)TopicList.Search(t => ((Topic)t).Id == topicId); TopicAuthentication ta = TopicAuthentication.GetTopicAuthentication(topic); bool allowNew = ta.IsAllow(TopicPermission.PERMISSION.ARTICLE_NEW); bool allowEdit = ta.IsAllow(TopicPermission.PERMISSION.ARTICLE_EDIT); bool allowDelete = ta.IsAllow(TopicPermission.PERMISSION.ARTICLE_DELETE); bool allowAprove = ta.IsAllow(TopicPermission.PERMISSION.ARTICLE_APROVE); var result = new { AllowNew = allowNew, AllowEdit = allowEdit, AllowDelete = allowDelete, AllowAprove = allowAprove }; System.Web.Script.Serialization.JavaScriptSerializer js = new System.Web.Script.Serialization.JavaScriptSerializer(); return(js.Serialize(result)); }
public static void TopicSecurity(string id) { Guid idTopic = new Guid(id); PSCDialog.DataShare = new TopicArgs((Topic)TopicList.Search(o => ((Topic)o).Id == idTopic), true); }
public static void TopicEditContentTemplate(Guid id) { PSCDialog.DataShare = new TopicArgs((Topic)TopicList.Search(o => ((Topic)o).Id == id), true); }
public static void TopicMoveDown(string id) { Guid topicId = new Guid(id); TopicList.MoveDown((PSCPortal.CMS.Topic)TopicList.Search(m => ((PSCPortal.CMS.Topic)m).Id == topicId)); }
public static void ChangeRoot(Guid id) { Topic topic = (Topic)TopicList.Search(t => ((Topic)t).Id == id); topic.ChangeRoot(); }
public static void TopicMakeMenuDo(string id) { Topic topic = (Topic)TopicList.Search(t => ((Topic)t).Id == new Guid(id)); TopicList.TopicMakeMenu(topic, ((MenuMasterArgs)PSCDialog.DataShare).MenuMaster); }
public static void TopicCopyDo(string id) { Topic topic = (Topic)TopicList.Search(t => ((Topic)t).Id == new Guid(id)); TopicList.TopicCopy(topic, ((TopicArgs)PSCDialog.DataShare).Topic); }
public static void TopicDelete(string id) { Guid idTopic = new Guid(id); TopicList.RemoveDB((Topic)TopicList.Search(o => ((Topic)o).Id == idTopic)); }