|
|
@@ -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) |
|
|
|
{ |
|
|
|