/// <summary> /// 返回数据库所有的对象集合(用于分页数据显示) /// </summary> /// <param name="info">分页实体信息</param> /// <returns>指定对象的集合</returns> public virtual List <T> GetAllWithPager(ref PagerInfo info) { List <T> result = new List <T>(); IBaseService <T> service = CreateClient(); ICommunicationObject comm = service as ICommunicationObject; WHC.Pager.Entity.PagerInfo pagerInfo = info; comm.Using(client => { result = service.GetAllWithPager(ref pagerInfo); }); info.RecordCount = pagerInfo.RecordCount; return(result); }
/// <summary> /// 根据条件查询数据库,并返回对象集合(用于分页数据显示) /// </summary> /// <param name="condition">查询的条件</param> /// <param name="info">分页实体</param> /// <param name="fieldToSort">排序字段</param> /// <param name="desc">是否降序</param> /// <returns>指定对象的集合</returns> public virtual List <T> FindWithPager3(string condition, ref PagerInfo info, string fieldToSort, bool desc) { List <T> result = new List <T>(); IBaseService <T> service = CreateClient(); ICommunicationObject comm = service as ICommunicationObject; WHC.Pager.Entity.PagerInfo pagerInfo = info; comm.Using(client => { result = service.FindWithPager3(condition, ref pagerInfo, fieldToSort, desc); }); info.RecordCount = pagerInfo.RecordCount; return(result); }
/// <summary> /// 根据条件查询数据库,并返回DataTable集合(用于分页数据显示) /// </summary> /// <param name="condition">查询的条件</param> /// <param name="info">分页实体</param> /// <param name="fieldToSort">排序字段</param> /// <param name="desc">是否降序</param> /// <returns>指定DataTable的集合</returns> public virtual DataTable FindToDataTableWithPager2(string condition, ref PagerInfo info, string fieldToSort, bool desc) { DataTable result = new DataTable(); result.TableName = "tableName"; IBaseService <T> service = CreateClient(); ICommunicationObject comm = service as ICommunicationObject; WHC.Pager.Entity.PagerInfo pagerInfo = info; comm.Using(client => { result = service.FindToDataTableWithPager2(condition, ref pagerInfo, fieldToSort, desc); }); info.RecordCount = pagerInfo.RecordCount; return(result); }
/// <summary> /// 根据分页条件,返回DataSet对象 /// </summary> /// <param name="info">分页条件</param> /// <returns></returns> public virtual DataTable GetAllToDataTableWithPager(ref PagerInfo info) { DataTable result = new DataTable(); result.TableName = "tableName"; IBaseService <T> service = CreateClient(); ICommunicationObject comm = service as ICommunicationObject; WHC.Pager.Entity.PagerInfo pagerInfo = info; comm.Using(client => { result = service.GetAllToDataTableWithPager(ref pagerInfo); }); info.RecordCount = pagerInfo.RecordCount; return(result); }