public static string GetArticleTrashList(int startIndex, int maximumRows, string sortExpressions) { Guid subId = SessionHelper.GetSession(SessionKey.SubDomain) == string.Empty ? Guid.Empty : new Guid(SessionHelper.GetSession(SessionKey.SubDomain)); if (subId == Guid.Empty) { DisplayArticleTrashList = ArticleTrashList.ToList(); } else { DisplayArticleTrashList = new List <Article>(); PSCPortal.Engine.SubDomain subDomain = new PSCPortal.Engine.SubDomain { Id = subId }; PageCollection listPage = subDomain.GetPagesBelongTo(); foreach (var item in listPage) { foreach (var article in ArticleTrashList.Where(ar => ar.PageId == item.Id)) { DisplayArticleTrashList.Add(article); } } } // kiem tra nhung bai viet duoc goi den da xu ly ? foreach (var item in ArticleSendList.Where(ar => ar.IsCheck == false)) { Article article = DisplayArticleTrashList.SingleOrDefault(ar => ar.Id == item.Id); if (article != null) { DisplayArticleTrashList.Remove(article); } } System.Web.Script.Serialization.JavaScriptSerializer js = new System.Web.Script.Serialization.JavaScriptSerializer(); return(js.Serialize(Libs.IEnumerableExtentionMethods.GetSegmentList(DisplayArticleTrashList, startIndex, maximumRows, sortExpressions))); }
public static void ArticleTrashDelete(string[] arrId) { foreach (string id in arrId) { Guid idArticle = new Guid(id); ArticleTrashList.Remove(ArticleTrashList.Where(a => a.Id == idArticle).Single()); PSCPortal.CMS.ArticleCollection.DeleteArticleFromTrash(id); } }
public static void ArticleTrashRestore(string[] arrId) { foreach (string articleId in arrId) { Guid ArticleId = new Guid(articleId); Article article = ArticleTrashList.Where(a => a.Id == ArticleId).Single(); Topic topic = PSCPage.DataShare as Topic; article.AddTopicBelong(topic); article.SetTopicBelongPrimary(topic); ArticleTrashList.Remove(article); } }