SVN r924
SVN-Revision: r924
This commit is contained in:
@@ -27,7 +27,7 @@ namespace Lskj.Control
|
||||
/// <summary>
|
||||
/// The _look up form
|
||||
/// </summary>
|
||||
private FrmModelLookUp2 _lookUpForm = null;
|
||||
public FrmModelLookUp2 _lookUpForm = null;
|
||||
/// <summary>
|
||||
/// 绑定ValueMember
|
||||
/// </summary>
|
||||
@@ -82,6 +82,15 @@ namespace Lskj.Control
|
||||
///模块选择返回框,配置列加载模式(默认根据sql动态加载列)
|
||||
/// </summary>
|
||||
public bool ConfigureColumnMode { get; set; }
|
||||
/// <summary>
|
||||
/// 数据源
|
||||
/// </summary>
|
||||
public DataTable DataSource;
|
||||
/// <summary>
|
||||
/// 显示text值(保存id,显示text值)
|
||||
/// </summary>
|
||||
public bool ModuleFrameDisplayText;
|
||||
|
||||
|
||||
private string editValue;
|
||||
|
||||
@@ -167,6 +176,31 @@ namespace Lskj.Control
|
||||
set
|
||||
{
|
||||
this.EditValue = value;
|
||||
if (ModuleFrameDisplayText)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value) && this.DataSource != null)
|
||||
{
|
||||
string[] values = value.Trim(',').Split(',');
|
||||
string text = string.Empty;
|
||||
foreach (string item in values)
|
||||
{
|
||||
DataRow rowItem = this.DataSource.Rows.Cast<DataRow>().FirstOrDefault(x => x[ValueMember] + "" == item);
|
||||
if (rowItem != null)
|
||||
{
|
||||
text += rowItem[TextField] + ",";
|
||||
}
|
||||
}
|
||||
this.txtEdit.Text = text.TrimEnd(',');
|
||||
}
|
||||
else
|
||||
{
|
||||
this.txtEdit.Text = "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.TextEdit.Text = value.TrimEnd(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,18 +215,9 @@ namespace Lskj.Control
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public string EditValue
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.TextEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.TextEdit.Text = value.TrimEnd(',');
|
||||
this.editValue = value.TrimEnd(',');
|
||||
}
|
||||
}
|
||||
public string EditValue;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
@@ -351,5 +376,6 @@ namespace Lskj.Control
|
||||
if (result == DialogResult.OK)
|
||||
{
|
||||
string value = Model.FieldType == ControlType.LabSelectReturnIdNew ? _lookUpForm.EditValue : _lookUpForm.EditText;
|
||||
this.EditValue = value;
|
||||
|
||||
this.EditText = value;
|
||||
//this.EditValue = value;
|
||||
|
||||
Reference in New Issue
Block a user