Пример #1
0
        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();
        }
Пример #2
0
        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));
        }
Пример #3
0
        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)));
        }
Пример #4
0
 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));
 }
Пример #5
0
        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);
        }
Пример #6
0
        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));
        }
Пример #7
0
        public static void TopicSecurity(string id)
        {
            Guid idTopic = new Guid(id);

            PSCDialog.DataShare = new TopicArgs((Topic)TopicList.Search(o => ((Topic)o).Id == idTopic), true);
        }
Пример #8
0
 public static void TopicEditContentTemplate(Guid id)
 {
     PSCDialog.DataShare = new TopicArgs((Topic)TopicList.Search(o => ((Topic)o).Id == id), true);
 }
Пример #9
0
        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));
        }
Пример #10
0
        public static void ChangeRoot(Guid id)
        {
            Topic topic = (Topic)TopicList.Search(t => ((Topic)t).Id == id);

            topic.ChangeRoot();
        }
Пример #11
0
        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);
        }
Пример #12
0
        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);
        }
Пример #13
0
        public static void TopicDelete(string id)
        {
            Guid idTopic = new Guid(id);

            TopicList.RemoveDB((Topic)TopicList.Search(o => ((Topic)o).Id == idTopic));
        }