1234567891011121314151617181920212223242526272829 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Data;
- namespace Bowin.Common.Linq
- {
- public static partial class Extensions_ForSXTEx
- {
- public static DataSet ToSXTEx_PagingDataSet<T>(this IEnumerable<T> source, int PageIndex, int PageSize) where T : class
- {
- DataSet ds = new DataSet("root");
- var dt1=source.Paging(PageIndex+1, PageSize).ToTable();
- DataTable dt2 = new DataTable("Tatol");
- dt2.Columns.Add("count", typeof(int));
- var dt2_con = dt2.NewRow();
- dt2_con[0] = source.Count();
- dt2.Rows.Add(dt2_con);
-
- ds.Tables.Add(dt1.Copy());
- ds.Tables.Add(dt2);
- return ds;
- }
- }
- }
|