SVN-Revision: r263
This commit is contained in:
cyf
2025-02-12 06:26:04 +00:00
parent 8fac982e19
commit 40b107eb82
6 changed files with 101 additions and 66 deletions
@@ -555,7 +555,7 @@ namespace Lskj.Control.MultiModelLookUp
ReplaceHelper.ReplaceWhereCond(this.NewSourceSQL) + where;
this.DataSource = MainImpl.GetDataTableResult(sqlValue);
this.SetSelectionBox();
this.SetDefaultValue();
//this.SetDefaultValue();
}
/// <summary>
@@ -636,7 +636,7 @@ namespace Lskj.Control.MultiModelLookUp
this.SearchObj.ParentUnionField = this.ParentUnionField;
this.pl_top.Height = 0;
this.pl_top.Height = this.SearchObj.InitSearchControl(queryTable, this.pl_top);
this.SearchObj.OnSearchAfterCallBack += SearchObj_OnSearchAfterCallBack;
//this.SearchObj.OnSearchAfterCallBack += SearchObj_OnSearchAfterCallBack;
if (LeftTreeViewEx != null && LeftTreeViewEx.TreeView.Nodes.Count > 0)
{
@@ -659,7 +659,7 @@ namespace Lskj.Control.MultiModelLookUp
this.SetDefaultValue();
//查询
if(this.SysModel.CsHasDefultSearch) this.SearchObj.SearchGrid();
if (this.SysModel.CsHasDefultSearch) this.SearchObj.SearchGrid();
//单选模式不需要设置下方表中选中行
//if (!SingleChoiceMode) this.SetDefaultValue();
@@ -671,12 +671,9 @@ namespace Lskj.Control.MultiModelLookUp
{
if (isFirstSearch)
{
//this.SetSelectionBox();
this.SetDefaultValue();
}
isFirstSearch = false;
//this.SetSelectionBox();
//this.SetReadOnlyColumns();
}
#endregion
@@ -813,7 +810,7 @@ namespace Lskj.Control.MultiModelLookUp
DataRow rowItem = this.gcMain.GridView.GetFocusedDataRow();
if (rowItem != null)
{
DataRow Item = (this.gcDetail.GridControl.DataSource as DataTable).Rows.Cast<DataRow>().FirstOrDefault(x => x[ValueMember] + "" == rowItem[ValueMember]+"");
DataRow Item = (this.gcDetail.GridControl.DataSource as DataTable).Rows.Cast<DataRow>().FirstOrDefault(x => x[ValueMember] + "" == rowItem[ValueMember] + "");
if (Item == null) (this.gcDetail.GridControl.DataSource as DataTable).Rows.Add(rowItem.ItemArray);
rowItem.AcceptChanges();
}
@@ -833,13 +830,49 @@ namespace Lskj.Control.MultiModelLookUp
/// <param name="e">The <see cref="DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs"/> instance containing the event data.</param>
private void OnRowCellClickRadio(object sender, EventArgs e)
{
EditValue = string.Empty;
EditText = string.Empty;
ModuleResultDic.Clear();
DataRow dr = this.gcMain.GridView.GetFocusedDataRow();
if (dr != null)
{
this.EditValue = dr[ValueMember] + "";
this.EditText = dr[TextField] + "";
if (!string.IsNullOrEmpty(AddModuleResult))
{
string[] resultFields = AddModuleResult.Split(',');
foreach (string resultField in resultFields)
{
Match match = Regex.Match(resultField, @"^\s*([^\s]+)\s+AS\s+([^\s]+)\s*$", RegexOptions.IgnoreCase);
if (match.Success)
{
string beforeAs = match.Groups[1].Value.Trim();
string afterAs = match.Groups[2].Value.Trim();
string value = "";
if (dr.Table.Columns.Contains(beforeAs))
{
value += dr[beforeAs] + "";
}
ModuleResultDic.Add(afterAs, value);
}
else
{
string value = "";
if (dr.Table.Columns.Contains(resultField))
{
value += dr[resultField] + "";
}
ModuleResultDic.Add(resultField, value);
}
}
}
this.DialogResult = DialogResult.OK;
this.Close();
}