: ARDetailReportService
{
private string[] TempTableName;
public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName)
{
IDBService service = ServiceHelper.GetService<IDBService>();
this.TempTableName = service.CreateTemporaryTableName(this.Context, 1);
string text = TempTableName[0];
base.BuilderReportSqlAndTempTable(filter, text);
StringBuilder stringBuilder = new StringBuilder();
string format = "/*dialect*/select t1.*, t3.FWMSFBILLNO AS FWmsFBillNo " +
" into {0} from {1} t1 " +
"LEFT JOIN t_AR_receivable t2 on t1.FID=t2.FID " +
"left join T_SAL_OUTSTOCK t3 ON t3.FBILLNO=t2.F_KD_YDDH" +
" ORDER BY t1.FID DESC";
stringBuilder.AppendFormat(format, tableName, text);
DBUtils.Execute(this.Context, stringBuilder.ToString());
}
public override void CloseReport()
{
bool flag = this.TempTableName == null || this.TempTableName.Length == 0;
bool flag2 = !flag;
if (flag2)
{
IDBService service = ServiceHelper.GetService<IDBService>();
service.DeleteTemporaryTableName(base.Context, this.TempTableName);
base.CloseReport();
}
}
}
推荐阅读