public Article[] GetColumnArticles(ref PageParameter page, string alias) { string data = string.Format("alias={0}&page={1}&size={2}" , alias, page.PageIndex, page.PageSize); string json = Post("blog/getcolumnarticles", data); page.RowCount = GetValue("count", json).ToInt(); return Json2Articles(json); }
public Article[] GetArticles(ref PageParameter page, bool isDraft = false) { if (page == null) page = new PageParameter(); string data = string.Format("status={0}&page={1}&size={2}" , (isDraft ? "draft" : "enabled"), page.PageIndex, page.PageSize); string json = Post("blog/getarticlelist", data); page.RowCount = GetValue("count", json).ToInt(); return Json2Articles(json); }
public Column[] GetColumns(ref PageParameter page, int channel = 0) { if (page == null) page = new PageParameter(); string data = string.Format("channel={0}&page={1}&size={2}" , channel, page.PageIndex, page.PageSize); string json = Post("blog/getcolumnlist"); page.RowCount = GetValue("count", json).ToInt(); string[] items = json.Split(new string[] { "},{" }, StringSplitOptions.None); if (!items[0].Contains("\"alias\"")) { return new Column[0]; } var list = new Column[items.Length]; for (int i = 0; i < items.Length; i++) { list[i] = new Column() { Alias = GetValue("alias", items[i]), Channel = GetValue("channel", items[i]).ToInt(), Title = GetValue("title", items[i]), Description = GetValue("description", items[i]), Url = GetValue("url", items[i]), Logo = GetValue("logo", items[i]) }; } return list; }
public Article[] GetHomeNewArticles(ref PageParameter page, int channel=0) { if (page == null) page = new PageParameter(); string data = string.Format("channel={0}&page={1}&size={2}" , channel, page.PageIndex, page.PageSize); string json = Post("blog/gethomenewest", data); page.RowCount = GetValue("count", json).ToInt(); return Json2Articles(json); }
public Article[] GetNewArticles(ref PageParameter page) { if (page == null) page = new PageParameter(); string data = string.Format("page={0}&size={1}" , page.PageIndex, page.PageSize); string json = Post("blog/getnewarticlelist", data); page.RowCount = GetValue("count", json).ToInt(); return Json2Articles(json); }
public Comment[] GetArticleComments(ref PageParameter page, int article) { string data = string.Format("article={0}&page={1}&size={2}", article, page.PageIndex, page.PageSize); string json = Post("blog/getcommentlist", data); page.RowCount = GetValue("count", json).ToInt(); return Json2Comments(json); }
public Comment[] GetMyComments(ref PageParameter page) { string data = string.Format("page={0}&size={1}", page.PageIndex, page.PageSize); string json = Post("blog/getmycommentlist", data); page.RowCount = GetValue("count", json).ToInt(); return Json2Comments(json); }