Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <returns></returns>
        public DataPage <IList <T> > ToListPage(int pageSize, int pageIndex)
        {
            DataPage <IList <T> > view = new DataPage <IList <T> >(pageSize);
            PageSection <T>       page = GetPage(pageSize);

            view.CurrentPageIndex = pageIndex;
            view.RowCount         = page.RowCount;
            view.DataSource       = page.ToList(pageIndex);
            return(view);
        }
Exemple #2
0
        /// <summary>
        /// 返回DataPage
        /// </summary>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <returns></returns>
        public DataPage <DataTable> ToTablePage(int pageSize, int pageIndex)
        {
            DataPage <DataTable> view = new DataPage <DataTable>(pageSize);
            PageSection <T>      page = GetPage(pageSize);

            view.CurrentPageIndex = pageIndex;
            view.RowCount         = page.RowCount;
            view.DataSource       = page.ToTable(pageIndex);
            return(view);
        }
        /// <summary>
        /// 返回DataPage
        /// </summary>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <returns></returns>
        public DataPage <DataSet> ToDataSetPage(int pageSize, int pageIndex)
        {
            DataPage <DataSet> view = new DataPage <DataSet>(pageSize);
            PageSection        page = GetPage(pageSize);

            view.CurrentPageIndex = pageIndex;
            view.RowCount         = page.RowCount;
            view.DataSource       = page.ToDataSet(pageIndex);
            return(view);
        }