예제 #1
0
파일: EB.cs 프로젝트: chloerager/light
        public static IList <T> Paging(string connectionString, out int recordCount, string tableName, string fields, string sortfield, int start, int end, string orderType, string whereSQL, ToEntityCallback callback)
        {
            IList <T> list = null;

            recordCount = DBH.Count(connectionString, tableName, whereSQL);
            using (IDataReader dr = DBH.Paging(connectionString, tableName, fields, sortfield, start, end, orderType, whereSQL))
            {
                if (dr != null)
                {
                    list = new List <T>();
                    while (dr.Read())
                    {
                        list.Add(callback(dr));
                    }
                    dr.Close();
                }
            }

            return(list);
        }