From 146caf1178ce149465a5ea8f2cc00546e490fa55 Mon Sep 17 00:00:00 2001 From: liangkun Date: Wed, 22 Mar 2023 10:41:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=89=8B=E6=9C=BA=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E8=A1=A8=E5=8D=95=E5=90=AB=E5=AD=90=E8=A1=A8=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=E6=8A=A5from=E9=99=84=E8=BF=91=E8=AF=AD?= =?UTF-8?q?=E6=B3=95=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scheme/FormSchemeBLL.cs | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeBLL.cs index 2964baaf7..4cff056d4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeBLL.cs @@ -1070,22 +1070,25 @@ namespace Learun.Application.Form string querySql = " SELECT "; if (tableComponts.ContainsKey(tableItem.data.name) && !res.ContainsKey(tableItem.data.name)) { - foreach (var compont in tableComponts[tableItem.data.name]) + DataTable dt = null; + if (tableComponts[tableItem.data.name].Count > 0) { - querySql += compont.field + " , "; - } - - if (string.IsNullOrEmpty(keyValue)) - { - keyValue = pData[tableItem.data.relationField]; - } + foreach (var compont in tableComponts[tableItem.data.name]) + { + querySql += compont.field + " , "; + } - querySql = querySql.Remove(querySql.Length - 2, 2); - querySql += " FROM " + tableItem.data.name + " WHERE " + tableItem.data.field + " = @keyValue"; + if (string.IsNullOrEmpty(keyValue)) + { + keyValue = pData[tableItem.data.relationField]; + } - DataTable dt = databaseLinkIBLL.FindTable(dbId, querySql, new { keyValue = keyValue }); - res.Add(tableItem.data.name, dt); + querySql = querySql.Remove(querySql.Length - 2, 2); + querySql += " FROM " + tableItem.data.name + " WHERE " + tableItem.data.field + " = @keyValue"; + dt = databaseLinkIBLL.FindTable(dbId, querySql, new { keyValue = keyValue }); + res.Add(tableItem.data.name, dt); + } // 获取它的从表数据 if (tableItem.ChildNodes.Count > 0 && dt.Rows.Count > 0) {