Beispiel #1
0
        public List <T> ExecuteEntityList <T>(string commandText, PagerEntity pagerEntity) where T : new()
        {
            if (pagerEntity == null)
            {
                _DbCommand.CommandText = commandText;
                return(ExecuteEntityList <T>());
            }
            int recordCount;
            int pageCount;
            var ans = ExecuteEntityList <T>(commandText, pagerEntity.Orderby, pagerEntity.PageSize, pagerEntity.PageIndex, out recordCount, out pageCount);

            pagerEntity.RecordCount = recordCount;
            pagerEntity.PagesCount  = pageCount;
            return(ans);
        }
Beispiel #2
0
        public List <T> ExecuteEntityList <T>(string tableName, string fieldList, string whereClause, PagerEntity pagerEntity) where T : new()
        {
            pagerEntity.RecordCount = GetRecordCount(tableName, whereClause);
            int pagesCount;

            int.TryParse(Math.Ceiling(pagerEntity.RecordCount * 1d / pagerEntity.PageSize).ToString(), out pagesCount);
            pagerEntity.PagesCount = pagesCount;
            return(ExecuteEntityList <T>(tableName, fieldList, whereClause, pagerEntity.Orderby, pagerEntity.PageSize, pagerEntity.PageIndex));
        }