Exemplo n.º 1
0
        public virtual DataPage <ContentPost> GetPageBySection(int sectionId, int pageSize)
        {
            DataPage <ContentPostSection> list    = ContentPostSection.findPage("SectionId=" + sectionId + " and SaveStatus=" + SaveStatus.Normal + " order by PostId desc", pageSize);
            DataPage <ContentPost>        xResult = list.Convert <ContentPost>(populatePost(list.Results));

            // 兼容旧版
            if (xResult.RecordCount == 0)
            {
                return(ContentPost.findPage("SectionId=" + sectionId + " and SaveStatus=" + SaveStatus.Normal, pageSize));
            }
            else
            {
                return(xResult);
            }
        }