提交当前本机整理版本
This commit is contained in:
@@ -362,4 +362,25 @@ namespace Lskj.PubControlDetail
|
||||
string fieldName = !string.IsNullOrEmpty(model.UnionParentField) && rowItem.Table.Columns.Contains(model.UnionParentField) ? model.UnionParentField : DataModel.DetailModuleModel.ParmaryKey;
|
||||
string sqlValue = model.IsReadOnly || model.IsChart ? model.DetailSql : model.SystemModel.MenuSql;
|
||||
sqlValue = ReplaceHelper.ReplaceRowParam(rowItem, sqlValue);
|
||||
DataRow row = gcMain.GridView.GetFocusedDataRow
|
||||
DataRow row = gcMain.GridView.GetFocusedDataRow();
|
||||
if (isLeft)
|
||||
{
|
||||
//先替换左侧选中行,在替换主表
|
||||
sqlValue = ReplaceHelper.ReplaceRowParam(row, sqlValue);
|
||||
}
|
||||
if (ReplaceHelper.IsSelect(sqlValue) && !string.IsNullOrEmpty(model.UnionValue))
|
||||
{
|
||||
string Conditions = string.Empty;
|
||||
//是左侧选中行,并且没有替换字段,则使用主表选中行
|
||||
Conditions = isLeft ? rowItem.Table.Columns.Contains(fieldName) ? rowItem[fieldName] + "" : row[fieldName] + "" : rowItem[fieldName] + "";
|
||||
sqlValue = ReplaceHelper.ReplaceWhereCond(sqlValue) + string.Format(" and {0}='{1}'", model.UnionValue, Conditions);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(model.UnionCond))
|
||||
{
|
||||
string UnionCond = ReplaceHelper.ReplaceRowParam(rowItem, model.UnionCond);
|
||||
sqlValue += UnionCond;
|
||||
}
|
||||
return sqlValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user