Beispiel #1
0
 public static List<Schedule> GetList(PageParameter page)
 {
     page.RecordCount = int.Parse(DbHelper.ExecuteScalar("select count(1) from Schedule").ToString());
     var dt = DbHelper.GetDataTable(string.Format("select * from Schedule  order by id desc limit {0},{1}", page.CurrentPage - 1, page.PageSize));
     var list = new List<Schedule>();
     foreach (DataRow row in dt.Rows)
     {
         list.Add(ConvertToModel(row));
     }
     return list;
 }
Beispiel #2
0
        public static List<PlayLog> GetList(PageParameter page)
        {
            var list = new List<PlayLog>();

            var sql = string.Format("select * from PlayLog order by id desc limit {0},{1}", page.CurrentPage - 1, page.PageSize);
            var dt = DbHelper.GetDataTable(sql);
            foreach (DataRow dr in dt.Rows)
            {
                list.Add(ConvertToModel(dr));
            }
            page.RecordCount = int.Parse(DbHelper.ExecuteScalar("select count(1) from PlayLog").ToString());
            return list;
        }