/// <summary> /// 执行存储过程返回结果集 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="sp"></param> /// <returns></returns> public List <T> RunList <T>(string sp) where T : class, new() { var reader = helper.RunDataReader(sp); ClearParame(); return(ObjectConvert.DataReaderToList <T>(reader)); }
/// <summary> /// 执行存储过程返回结果集 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="sp"></param> /// <returns></returns> public List <T> RunList <T>(string sp) where T : class, new() { var reader = dbHelper.RunDataReader(sp); ClearParame(); double runTime; return(ObjectConvert.DataReaderToList <T>(reader, out runTime)); }
/// <summary> /// page /// </summary> /// <param name="query"></param> /// <param name="fields"></param> /// <param name="sort"></param> /// <param name="pageSize"></param> /// <param name="pageIndex"></param> /// <returns></returns> internal virtual CallBackDataReader GetPageData(string query, string fields, string sort, int pageSize, int pageIndex) { helper.AddParam("query_", query); helper.AddParam("fields_", fields); helper.AddParam("sort_", sort); helper.AddParam("pageSize_", pageSize); helper.AddParam("pageIndex_", pageIndex); helper.AddOutParam("count_", 1); //var reader = helper.RunDataReader("sp_page"); var reader = new CallBackDataReader(helper.RunDataReader("sp_page"), () => { return(Convert.ToInt32(helper.GetOutParam("count_"))); }); return(reader); }