Exemplo n.º 1
0
        /// <summary>
        /// 获取视图导出数据
        /// </summary>
        /// <param name="_sql"></param>
        /// <param name="page"></param>
        /// <param name="User"></param>
        /// <returns></returns>
        public DataTable GetViewExportData(string _sql, Pagination page, AdminCredential admin)
        {
            DBDatabase    db = CreateDao();
            PageOfDaTaSet result;
            var           sql = CacheHelper.Single.TryGet($"{page.vid}-{admin.ID}-list-sql", 0, () => { return(_sql); }).ToString();

            result = db.DataSetPage(page.Page, page.PageSize, new Sql(sql));
            db.Dispose();
            if (result.Data.Tables.Count > 0)
            {
                return(result.Data.Tables[0]);
            }
            else
            {
                return(new DataTable());
            }
        }