SVN r258
SVN-Revision: r258
This commit is contained in:
@@ -354,6 +354,10 @@ namespace Lskj.Control
|
||||
///选中的行在数据源中的索引
|
||||
/// </summary>
|
||||
private List<int> SelectedDataSource = new List<int>();
|
||||
/// <summary>
|
||||
/// 禁显列不加载数据源
|
||||
/// </summary>
|
||||
public bool DisableFieldSources;
|
||||
|
||||
public GridControlEx()
|
||||
{
|
||||
@@ -660,6 +664,11 @@ namespace Lskj.Control
|
||||
/// <param name="item">The dr row.</param>
|
||||
protected void InitEditColumns(GridColumn column, GridColumnModel model)
|
||||
{
|
||||
if (this.DisableFieldSources && model.isVislble)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(model.SqlSource))
|
||||
{
|
||||
Task<DataTable> sourceTask = new Task<DataTable>(() =>
|
||||
@@ -793,6 +802,10 @@ namespace Lskj.Control
|
||||
case ControlType.LabSelectReturnText:
|
||||
InitSelectReturnId(column, model);
|
||||
break;
|
||||
case ControlType.LabSelectReturnIdNew:
|
||||
case ControlType.LabSelectReturnTextNew:
|
||||
InitSelectReturnIdNew(column, model);
|
||||
break;
|
||||
case ControlType.LabSelectReturnRows:
|
||||
InitSelectReturnRows(column, model);
|
||||
break;
|
||||
@@ -927,6 +940,7 @@ namespace Lskj.Control
|
||||
for (int i = 0; i < table.Rows.Count; i++)
|
||||
{
|
||||
GridColumnModel model = new GridColumnModel(table.Rows[i], false);
|
||||
|
||||
GridColumn gridColumn = new GridColumn();
|
||||
gridColumn.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
|
||||
|
||||
@@ -1055,9 +1069,18 @@ namespace Lskj.Control
|
||||
{
|
||||
foreach (GridColumnModel item in mControlList)
|
||||
{
|
||||
if (this.DisableFieldSources && item.isVislble) continue;
|
||||
if (!string.IsNullOrWhiteSpace(item.SqlSource))
|
||||
{
|
||||
DataTable dataTable = BaseImpl.GetDataTableResult(item.SqlSource);
|
||||
DataTable dataTable = new DataTable();
|
||||
if (mControlSourceDic.ContainsKey(item))
|
||||
{
|
||||
dataTable = mControlSourceDic[item].Result;
|
||||
}
|
||||
else
|
||||
{
|
||||
dataTable = BaseImpl.GetDataTableResult(item.SqlSource);
|
||||
}
|
||||
Application.DoEvents();
|
||||
if (!item.Visible) continue;
|
||||
switch (item.FieldType)
|
||||
@@ -1278,7 +1301,6 @@ namespace Lskj.Control
|
||||
foreach (DataRow item in table.Rows)
|
||||
{
|
||||
GridColumnModel model = new GridColumnModel(item);
|
||||
|
||||
GridColumn gridColumn = new GridColumn();
|
||||
gridColumn.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
|
||||
gridColumn.FieldName = model.FieldName;
|
||||
@@ -3995,6 +4017,7 @@ namespace Lskj.Control
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:创建 模块返回ID</para>
|
||||
/// <para>创建人:曹屹峰</para>
|
||||
@@ -4039,6 +4062,50 @@ namespace Lskj.Control
|
||||
|
||||
this.mControlList.Add(model);
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:创建 模块返回ID 新版</para>
|
||||
/// <para>创建人:曹屹峰</para>
|
||||
/// <para>创建日期:2021-08-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
private void InitSelectReturnIdNew(GridColumn gridColumn, GridColumnModel model)
|
||||
{
|
||||
FrmModelLookUp2 modelLookUp = new FrmModelLookUp2(model.addModuleld, model.IsRadio);
|
||||
modelLookUp.ConfigureColumnMode = model.ConfigureColumnMode;
|
||||
modelLookUp.ValueField = model.ValueMember;
|
||||
modelLookUp.TextField = model.TextMember;
|
||||
modelLookUp.SourceSQL = model.SqlSource;
|
||||
modelLookUp.IsType = model.FieldType;
|
||||
modelLookUp.ValueMember = model.FieldType == ControlType.LabSelectReturnIdNew ? model.ValueMember : model.TextMember;
|
||||
modelLookUp.Tag = model;
|
||||
|
||||
RepositoryItemCheckedComboBoxEdit btnEdit = new RepositoryItemCheckedComboBoxEdit();
|
||||
btnEdit.NullText = "";
|
||||
btnEdit.PopupBorderStyle = PopupBorderStyles.Flat;
|
||||
btnEdit.AllowNullInput = DefaultBoolean.False;
|
||||
btnEdit.DisplayMember = model.TextMember;
|
||||
btnEdit.SeparatorChar = ',';
|
||||
btnEdit.ValueMember = model.FieldType == ControlType.LabSelectReturnIdNew ? model.ValueMember : model.TextMember;
|
||||
//DataTable dataTable = MainImpl.GetDataTableResult(modelLookUp.SingleChoiceMode ? modelLookUp.SysModel.MenuSql : model.SqlSource);
|
||||
////ModuleEnclosure.Add(model.FieldName, dataTable);
|
||||
//btnEdit.DataSource = dataTable;
|
||||
btnEdit.Buttons[0].Visible = false; // 不能移除,移除后事件不起作用.
|
||||
btnEdit.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Ellipsis) });
|
||||
|
||||
btnEdit.Tag = model;
|
||||
btnEdit.Buttons[1].Tag = modelLookUp;
|
||||
btnEdit.ButtonClick += new ButtonPressedEventHandler(OnModuleChoiceNew);
|
||||
btnEdit.KeyDown += BtnEdit_KeyDown;
|
||||
gridControl.RepositoryItems.Add(btnEdit);
|
||||
gridColumn.OptionsColumn.ReadOnly = true;
|
||||
gridColumn.ColumnEdit = btnEdit;
|
||||
|
||||
|
||||
this.mControlList.Add(model);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4068,14 +4135,6 @@ namespace Lskj.Control
|
||||
RepositoryItemButtonEdit btnEdit = new RepositoryItemButtonEdit();
|
||||
btnEdit.NullText = "";
|
||||
btnEdit.AllowNullInput = DefaultBoolean.False;
|
||||
//RepositoryItemCheckedComboBoxEdit btnEdit = new RepositoryItemCheckedComboBoxEdit();
|
||||
//btnEdit.NullText = "";
|
||||
//btnEdit.PopupBorderStyle = PopupBorderStyles.Flat;
|
||||
//btnEdit.AllowNullInput = DefaultBoolean.False;
|
||||
//btnEdit.DisplayMember = model.TextMember;
|
||||
//btnEdit.SeparatorChar = ',';
|
||||
//btnEdit.ValueMember = model.FieldType == ControlType.LabSelectReturnId ? model.ValueMember : model.TextMember;
|
||||
//btnEdit.DataSource = MainImpl.GetDataTableResult(model.SqlSource);
|
||||
btnEdit.Buttons[0].Visible = false; // 不能移除,移除后事件不起作用.
|
||||
btnEdit.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Ellipsis) });
|
||||
|
||||
@@ -4841,7 +4900,7 @@ namespace Lskj.Control
|
||||
if (model.FieldType == 116)
|
||||
{
|
||||
RepositoryItemCheckedComboBoxEdit rccbe = col.ColumnEdit as RepositoryItemCheckedComboBoxEdit;
|
||||
FrmModelLookUp modelLookUp = rccbe.Buttons[1].Tag as FrmModelLookUp;
|
||||
FrmModelLookUp2 modelLookUp = rccbe.Buttons[1].Tag as FrmModelLookUp2;
|
||||
if (modelLookUp.SingleChoiceMode)
|
||||
{
|
||||
value = GetValueByCaption(model, col.ColumnEdit, cellValue, out IsTextEqualValue);
|
||||
@@ -5959,6 +6018,7 @@ namespace Lskj.Control
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:表格打开模块返回id</para>
|
||||
/// <para>创建人:曹屹峰</para>
|
||||
@@ -5975,6 +6035,60 @@ namespace Lskj.Control
|
||||
CheckedComboBoxEdit btnEdit = (CheckedComboBoxEdit)sender;
|
||||
FrmModelLookUp modelLookUp = e.Button.Tag as FrmModelLookUp;
|
||||
|
||||
GridColumnModel model = modelLookUp.Tag as GridColumnModel;
|
||||
modelLookUp.EditText = btnEdit.Text;
|
||||
modelLookUp.CurrentOperColumnKey = Model.ModuleCode + "_" + model.FieldName;
|
||||
if (model.FieldType == ControlType.LabMultiSelectValue || model.FieldType == ControlType.LabMultiSelectValueParam)
|
||||
{
|
||||
modelLookUp.EditValue = btnEdit.EditValue + "";
|
||||
modelLookUp.EditText = string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
modelLookUp.EditText = btnEdit.Text;
|
||||
modelLookUp.EditValue = string.Empty;
|
||||
}
|
||||
//多选关联单据头
|
||||
modelLookUp.SourceSQL = model.SqlSource.Replace("#", "");
|
||||
//单据头关联取值
|
||||
if (this.ParentControl != null)
|
||||
{
|
||||
modelLookUp.SourceSQL = this.ParentControl.ReplaceControlValue(modelLookUp.SourceSQL);
|
||||
}
|
||||
|
||||
modelLookUp.SourceSQL = ReplaceHelper.ReplaceRowParam(this.gridView.GetFocusedDataRow(), modelLookUp.SourceSQL);
|
||||
//modelLookUp.DataSource = BaseImpl.GetDataTableResult(modelLookUp.SourceSQL);
|
||||
modelLookUp.InitControls(modelLookUp.UnionModuleCodel);
|
||||
DialogResult result = modelLookUp.ShowDialog();
|
||||
if (result == DialogResult.OK)
|
||||
{
|
||||
btnEdit.EditValue = modelLookUp.EditValue;
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex, Model.ModuleCode);
|
||||
MessageUtil.Show(Message, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:表格打开模块返回id 新版</para>
|
||||
/// <para>创建人:曹屹峰</para>
|
||||
/// <para>创建日期:2021-08-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
protected void OnModuleChoiceNew(object sender, ButtonPressedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
CheckedComboBoxEdit btnEdit = (CheckedComboBoxEdit)sender;
|
||||
FrmModelLookUp2 modelLookUp = e.Button.Tag as FrmModelLookUp2;
|
||||
|
||||
GridColumnModel model = modelLookUp.Tag as GridColumnModel;
|
||||
modelLookUp.EditText = btnEdit.Text;
|
||||
modelLookUp.CurrentOperColumnKey = Model.ModuleCode + "_" + model.FieldName;
|
||||
|
||||
@@ -263,35 +263,4 @@ namespace Lskj.Control
|
||||
if (this.isMultiClick)
|
||||
{
|
||||
this.TextEdit.Popup.AddVisible = true;
|
||||
this.TextEdit.Popup.OnAddMouseClick += new EventHandler(Popup_OnAddMouseClick);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:添加操作后</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-04-03 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
protected void Popup_OnAddMouseClick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.TextEdit.SetValue();
|
||||
this.TextEdit.HidePopup();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
this.TextEdit.Popup.OnAddMouseClick += new Even
|
||||
@@ -57,6 +57,7 @@ namespace Lskj.Control
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
@@ -255,45 +256,4 @@ namespace Lskj.Control
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="dataSource">数据源</param>
|
||||
public void SetDataSource(DataTable dataSource)
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (DataRow item in dataSource.Rows)
|
||||
{
|
||||
ComboBoxModel model = new ComboBoxModel
|
||||
{
|
||||
ValueMember = ValueField,
|
||||
DisplayMember = TextField,
|
||||
RowItem = item
|
||||
};
|
||||
this._sources.Add(model);
|
||||
this.txtEdit.Properties.Items.Add(model);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
class ComboBoxModel
|
||||
{
|
||||
public string ValueMember;
|
||||
public string DisplayMember;
|
||||
public DataRow RowItem;
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return this.RowItem[DisplayMember] + "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
/// <para>版本:
|
||||
@@ -7,15 +7,22 @@
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
******************************/
|
||||
using DevExpress.XtraEditors;
|
||||
using Lskj.Business.Impl;
|
||||
using Lskj.Control.Model;
|
||||
using Lskj.Control.MultiModelLookUp;
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using DevExpress.XtraEditors.Controls;
|
||||
using DevExpress.XtraEditors;
|
||||
using Lskj.Data;
|
||||
using Lskj.Control.Model;
|
||||
using Lskj.Control.MultiGridLookUp;
|
||||
using Lskj.Business.Impl;
|
||||
using Lskj.Util;
|
||||
using Lskj.Control.MultiModelLookUp;
|
||||
|
||||
namespace Lskj.Control
|
||||
{
|
||||
@@ -70,18 +77,6 @@ namespace Lskj.Control
|
||||
/// </summary>
|
||||
/// <value>The Union ModuleCodel.</value>
|
||||
public string UnionModuleCodel;
|
||||
/// <summary>
|
||||
/// 条件
|
||||
/// </summary>
|
||||
public string SplicingConditions;
|
||||
/// <summary>
|
||||
///模块选择返回框,是否单选模式
|
||||
/// </summary>
|
||||
public bool IsRadio { get; set; }
|
||||
/// <summary>
|
||||
///模块选择返回框,配置列加载模式(默认根据sql动态加载列)
|
||||
/// </summary>
|
||||
public bool ConfigureColumnMode { get; set; }
|
||||
|
||||
public LabelMultiAutoTextEdit2()
|
||||
{
|
||||
@@ -281,14 +276,12 @@ namespace Lskj.Control
|
||||
/// <param name="dataSource">数据源</param>
|
||||
public void SetDataSource(DataTable dataSource)
|
||||
{
|
||||
_lookUpForm = new FrmModelLookUp(UnionModuleCodel, IsRadio);
|
||||
_lookUpForm.ConfigureColumnMode = ConfigureColumnMode;
|
||||
_lookUpForm = new FrmModelLookUp(UnionModuleCodel);
|
||||
_lookUpForm.ValueField = ValueField;
|
||||
_lookUpForm.ValueMember = ValueMember;
|
||||
_lookUpForm.TextField = TextField;
|
||||
|
||||
//_lookUpForm.SourceSQL = SourceSQL;
|
||||
//_lookUpForm.DataSource = dataSource;
|
||||
_lookUpForm.SourceSQL = SourceSQL;
|
||||
_lookUpForm.DataSource = dataSource;
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:清空选中的值</para>
|
||||
@@ -318,6 +311,16 @@ namespace Lskj.Control
|
||||
{
|
||||
try
|
||||
{
|
||||
//_lookUpForm = new FrmModelLookUp();
|
||||
//_lookUpForm.ValueField = ValueField;
|
||||
//_lookUpForm.ValueMember = ValueMember;
|
||||
//_lookUpForm.TextField = TextField;
|
||||
//_lookUpForm.SourceSQL = Model.SourceSql;
|
||||
//_lookUpForm.UnionModuleCodel = UnionModuleCodel;
|
||||
//_lookUpForm.EditValue = this.EditValue;
|
||||
//_lookUpForm.IsType = Model.FieldType;
|
||||
//_lookUpForm.EditText = this.TextEdit.Text;
|
||||
//_lookUpForm.DataSource = BaseImpl.GetDataTableResult(_lookUpForm.SourceSQL);
|
||||
if (_lookUpForm != null)
|
||||
{
|
||||
if (_lookUpForm != null)
|
||||
@@ -327,14 +330,7 @@ namespace Lskj.Control
|
||||
_lookUpForm.EditText = this.TextEdit.Text;
|
||||
}
|
||||
|
||||
string sqlValue = _lookUpForm.SysModel.MenuSql + Model.SplicingConditions;
|
||||
string sqlValue = string.Empty;
|
||||
if (this.ControlObj != null)
|
||||
{
|
||||
sqlValue = this.ControlObj.ReplaceControlValue(sqlValue);
|
||||
sqlValue = sqlValue.Replace("#", "");
|
||||
|
||||
//_lookUpForm.DataSource = MainImpl.GetDataTableResult(sqlValue);
|
||||
}
|
||||
_lookUpForm.NewSourceSQL = sqlValue;
|
||||
_lookUpForm.AddModuleResult = Model.AddModuleResult;
|
||||
_lookUpForm
|
||||
sqlValue = this.Cont
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
namespace Lskj.Control
|
||||
{
|
||||
partial class LabelMultiAutoTextEdit4
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region 组件设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LabelMultiAutoTextEdit4));
|
||||
this.lblText = new System.Windows.Forms.Label();
|
||||
this.plRight = new System.Windows.Forms.Panel();
|
||||
this.btnMore = new DevExpress.XtraEditors.SimpleButton();
|
||||
this.plLeft = new System.Windows.Forms.Panel();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.txtEdit = new DevExpress.XtraEditors.MemoEdit();
|
||||
this.plRight.SuspendLayout();
|
||||
this.plLeft.SuspendLayout();
|
||||
this.panel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.txtEdit.Properties)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// lblText
|
||||
//
|
||||
this.lblText.AutoSize = true;
|
||||
this.lblText.Location = new System.Drawing.Point(5, 4);
|
||||
this.lblText.Name = "lblText";
|
||||
this.lblText.Size = new System.Drawing.Size(29, 12);
|
||||
this.lblText.TabIndex = 0;
|
||||
this.lblText.Text = "名称";
|
||||
//
|
||||
// plRight
|
||||
//
|
||||
this.plRight.Controls.Add(this.btnMore);
|
||||
this.plRight.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.plRight.Location = new System.Drawing.Point(136, 0);
|
||||
this.plRight.Name = "plRight";
|
||||
this.plRight.Size = new System.Drawing.Size(26, 21);
|
||||
this.plRight.TabIndex = 5;
|
||||
//
|
||||
// btnMore
|
||||
//
|
||||
this.btnMore.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnMore.Appearance.Options.UseFont = true;
|
||||
this.btnMore.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.btnMore.Image = ((System.Drawing.Image)(resources.GetObject("btnMore.Image")));
|
||||
this.btnMore.Location = new System.Drawing.Point(0, 0);
|
||||
this.btnMore.Name = "btnMore";
|
||||
this.btnMore.Size = new System.Drawing.Size(26, 21);
|
||||
this.btnMore.TabIndex = 2;
|
||||
this.btnMore.Click += new System.EventHandler(this.btnMore_Click);
|
||||
//
|
||||
// plLeft
|
||||
//
|
||||
this.plLeft.Controls.Add(this.lblText);
|
||||
this.plLeft.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.plLeft.Location = new System.Drawing.Point(0, 0);
|
||||
this.plLeft.Name = "plLeft";
|
||||
this.plLeft.Size = new System.Drawing.Size(40, 21);
|
||||
this.plLeft.TabIndex = 4;
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.txtEdit);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel1.Location = new System.Drawing.Point(40, 0);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(96, 21);
|
||||
this.panel1.TabIndex = 6;
|
||||
//
|
||||
// txtEdit
|
||||
//
|
||||
this.txtEdit.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.txtEdit.Location = new System.Drawing.Point(0, 0);
|
||||
this.txtEdit.Name = "txtEdit";
|
||||
this.txtEdit.Size = new System.Drawing.Size(96, 21);
|
||||
this.txtEdit.TabIndex = 0;
|
||||
//
|
||||
// LabelMultiAutoTextEdit
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms
|
||||
@@ -0,0 +1,347 @@
|
||||
/******************************
|
||||
* 说明:自定义多选搜索框
|
||||
* 创建人:龚宇超
|
||||
* 创建日期:2017-08-08
|
||||
* 修改人:
|
||||
* 修改日期:
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
******************************/
|
||||
using DevExpress.XtraEditors;
|
||||
using Lskj.Business.Impl;
|
||||
using Lskj.Control.Model;
|
||||
using Lskj.Control.MultiModelLookUp;
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.Control
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义多选搜索框
|
||||
/// </summary>
|
||||
public partial class LabelMultiAutoTextEdit4 : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// The _look up form
|
||||
/// </summary>
|
||||
private FrmModelLookUp2 _lookUpForm = null;
|
||||
/// <summary>
|
||||
/// 绑定ValueMember
|
||||
/// </summary>
|
||||
public string ValueMember = string.Empty;
|
||||
/// <summary>
|
||||
/// 隐藏值字段
|
||||
/// </summary>
|
||||
public string ValueField = string.Empty;
|
||||
/// <summary>
|
||||
/// 显示值字段
|
||||
/// </summary>
|
||||
public string TextField = string.Empty;
|
||||
/// <summary>
|
||||
/// 备注字段
|
||||
/// </summary>
|
||||
public string RemarkField = string.Empty;
|
||||
/// <summary>
|
||||
/// 数据源SQL
|
||||
/// </summary>
|
||||
public string SourceSQL = string.Empty;
|
||||
/// <summary>
|
||||
/// 隐藏值
|
||||
/// </summary>
|
||||
//public string EditValue = string.Empty;
|
||||
/// <summary>
|
||||
/// The contro object
|
||||
/// </summary>
|
||||
public MyControl ControlObj;
|
||||
/// <summary>
|
||||
/// 文本
|
||||
/// </summary>
|
||||
/// <value>The label.</value>
|
||||
public Label Label { get { return lblText; } }
|
||||
/// <summary>
|
||||
/// 自动搜索框控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit { get { return txtEdit; } }
|
||||
/// <summary>
|
||||
/// 配置的关联ModuleCodel值
|
||||
/// </summary>
|
||||
/// <value>The Union ModuleCodel.</value>
|
||||
public string UnionModuleCodel;
|
||||
/// <summary>
|
||||
/// 条件
|
||||
/// </summary>
|
||||
public string SplicingConditions;
|
||||
/// <summary>
|
||||
///模块选择返回框,是否单选模式
|
||||
/// </summary>
|
||||
public bool IsRadio { get; set; }
|
||||
/// <summary>
|
||||
///模块选择返回框,配置列加载模式(默认根据sql动态加载列)
|
||||
/// </summary>
|
||||
public bool ConfigureColumnMode { get; set; }
|
||||
|
||||
private string editValue;
|
||||
|
||||
public LabelMultiAutoTextEdit4()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public override string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lblText.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lblText.Text = value;
|
||||
if (FontSize > 0)
|
||||
{
|
||||
this.plLeft.Dock = DockStyle.Left;
|
||||
this.plLeft.AutoSize = false;
|
||||
this.lblText.AutoSize = false;
|
||||
this.lblText.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblText.Location = new System.Drawing.Point(0, 0);
|
||||
this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.txtEdit.Properties.AutoHeight = false;
|
||||
this.plLeft.Width = value.Length * GetCharWidth();
|
||||
|
||||
GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.plLeft.Width = this.lblText.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
public override float FontSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.FontSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.FontSize = value;
|
||||
if (value > 0)
|
||||
{
|
||||
this.lblText.Font = new Font(this.lblText.Font.FontFamily, value);
|
||||
this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.EditValue = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <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(',');
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
public override string NullText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Properties.NullValuePrompt;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true;
|
||||
this.TextEdit.Properties.NullValuePrompt = value;
|
||||
}
|
||||
base.NullText = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
public override bool ReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.ReadOnly;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.txtEdit.Properties.ReadOnly = value;
|
||||
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:需要单独验证是否修改</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-11-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if this instance is update; otherwise, <c>false</c>.</returns>
|
||||
public override bool IsUpdate()
|
||||
{
|
||||
if (Model.FieldType == ControlType.LabMultiSelectValue ||
|
||||
Model.FieldType == ControlType.LabMultiSelectValueParam)
|
||||
{
|
||||
return !this.Model.Text.Equals(this.EditValue, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
else
|
||||
{
|
||||
return base.IsUpdate();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置数据源</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="dataSource">数据源</param>
|
||||
public void InitialFrame()
|
||||
{
|
||||
_lookUpForm = new FrmModelLookUp2(UnionModuleCodel, IsRadio);
|
||||
_lookUpForm.ConfigureColumnMode = ConfigureColumnMode;
|
||||
_lookUpForm.ValueField = ValueField;
|
||||
_lookUpForm.ValueMember = ValueMember;
|
||||
_lookUpForm.TextField = TextField;
|
||||
//_lookUpForm.SourceSQL = SourceSQL;
|
||||
//_lookUpForm.DataSource = dataSource;
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:清空选中的值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-08-24 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public void ClearSelectForm()
|
||||
{
|
||||
// _lookUpForm.ClearSelect();
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:打开界面</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-03-20 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
private void btnMore_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_lookUpForm != null)
|
||||
{
|
||||
if (_lookUpForm != null)
|
||||
{
|
||||
_lookUpForm.EditValue = this.EditValue;
|
||||
_lookUpForm.IsType = Model.FieldType;
|
||||
_lookUpForm.EditText = this.TextEdit.Text;
|
||||
}
|
||||
|
||||
string sqlValue = _lookUpForm.SysModel.MenuSql + Model.SplicingConditions;
|
||||
if (this.ControlObj != null)
|
||||
{
|
||||
sqlValue = this.ControlObj.ReplaceControlValue(sqlValue);
|
||||
sqlValue = sqlValue.Replace("#", "");
|
||||
|
||||
//_lookUpForm.DataSource = MainImpl.GetDataTableResult(sqlValue);
|
||||
}
|
||||
_lookUpForm.NewSourceSQL = sqlValue;
|
||||
_lookUpForm.AddModuleResult = Model.AddModuleResult;
|
||||
_lookUpForm.In
|
||||
@@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="btnMore.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
|
||||
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAC8UlEQVQ4T6WSaUhUURTHb0lj4yy+kRIk
|
||||
xbRQTL9kfdCSIkIIgoiCwBRbRKTU8ENpgZUoalSaqagpmksomeaamqbiOC65oTi5pjaa+zozzTjjm5l/
|
||||
11HKoE/14ffuue/d87uc8w4B8F+QaUlAycg7F/ZLtgUGC46wsga/ku40EelIEZG2RIY0JzCkKc6cNDw1
|
||||
J7Wx5qQqSkgqIoS/BSOFLuyG8hsMOjWrVQyjL8+JJYTs3oHJX9h8vyWQZlkAhnUYNF2AKhua2UdoeclA
|
||||
HM+g4Zk56mKFqI4WojJSiLLHAlRFW7LNqYfKNyVGQW8GFehXgR/pgCIahtVw6BeCoZsLhl5RAd1SDtiZ
|
||||
OGxMhEEz5IeVlnPIv8unmYRjFHSnigB2CvrFMOhmb4OV+UA7ehHaAU9oek9A3ekKVaszlGIHKOrtIf9o
|
||||
i9wQo4BrFLQnMTCoe2nSFaxLz+NNiB3SfDkU0x3rNte22d6/um4KInnBQLdcA1XHSQyVXUJ9mjftiZaW
|
||||
paSNnaPhIPSqJujW8sEuPoF2KhDr414YKHWlPdknI43PGWgnMyGvc0RF9HHMj9ZDv5ZOa48BO3+fJvjT
|
||||
hAtQDblB0UfL6LGBvNMaJeF8NMYz/qQqUgC1NArj70+hOv40vbgCG1M3oZX5QjN2GaphTyj7j0HeZY/V
|
||||
NkssSywxXGSB4gc8RdYtLiGF93hQtAehIdkdkz2p0Ex4QT3oAZXUHcreo1jrcMCKxAqLjSIs1IkwV82g
|
||||
KoqPoodmCTl3zAjJCuBiptYH5TEOdAYSoOw6APlna6y2WmGpaT8WPgkwV8PHTCUP30t4GM7loTDUTOdo
|
||||
vdsmL4QKMvz4rDjtDPo/BGKpzQ0zNTxM08NTpTzIinmYeGuGsQIuvuZyMZLJRXUEF5lBe8X0NwpfB9IS
|
||||
ikPt6lJuCJDobYrEq5tw/iDpV7z1LdmHYzjrbOJBBXsSvTl02ZptIcWKYk2xpdhTDlMcKI4Upx0cpNCr
|
||||
yS7jIG0+/h2Qn42FYhSZQkV1AAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -787,17 +787,23 @@
|
||||
<Compile Include="LabelIntExtendEdit.Designer.cs">
|
||||
<DependentUpon>LabelIntExtendEdit.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LabelMultiAutoTextEdit2.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="LabelMultiAutoTextEdit2.Designer.cs">
|
||||
<DependentUpon>LabelMultiAutoTextEdit2.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LabelMultiAutoTextEdit3.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="LabelMultiAutoTextEdit3.Designer.cs">
|
||||
<DependentUpon>LabelMultiAutoTextEdit3.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LabelMultiAutoTextEdit2.cs">
|
||||
<Compile Include="LabelMultiAutoTextEdit4.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="LabelMultiAutoTextEdit2.Designer.cs">
|
||||
<DependentUpon>LabelMultiAutoTextEdit2.cs</DependentUpon>
|
||||
<Compile Include="LabelMultiAutoTextEdit4.Designer.cs">
|
||||
<DependentUpon>LabelMultiAutoTextEdit4.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LabelRadioButtonGroupEdit.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
@@ -878,17 +884,23 @@
|
||||
<Compile Include="MultiGridLookUp\FrmLookUp.Designer.cs">
|
||||
<DependentUpon>FrmLookUp.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MultiModelLookUp\FrmModelLookUp.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MultiModelLookUp\FrmModelLookUp.Designer.cs">
|
||||
<DependentUpon>FrmModelLookUp.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MultiModelLookUp\FrmRowsModelLookUp.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MultiModelLookUp\FrmRowsModelLookUp.Designer.cs">
|
||||
<DependentUpon>FrmRowsModelLookUp.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MultiModelLookUp\FrmModelLookUp.cs">
|
||||
<Compile Include="MultiModelLookUp\FrmModelLookUp2.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MultiModelLookUp\FrmModelLookUp.Designer.cs">
|
||||
<DependentUpon>FrmModelLookUp.cs</DependentUpon>
|
||||
<Compile Include="MultiModelLookUp\FrmModelLookUp2.Designer.cs">
|
||||
<DependentUpon>FrmModelLookUp2.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MultiModelLookUp\FrmRowsModelLookUpNew.cs">
|
||||
<SubType>Form</SubType>
|
||||
@@ -1459,11 +1471,14 @@
|
||||
<EmbeddedResource Include="LabelIntExtendEdit.resx">
|
||||
<DependentUpon>LabelIntExtendEdit.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="LabelMultiAutoTextEdit2.resx">
|
||||
<DependentUpon>LabelMultiAutoTextEdit2.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="LabelMultiAutoTextEdit3.resx">
|
||||
<DependentUpon>LabelMultiAutoTextEdit3.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="LabelMultiAutoTextEdit2.resx">
|
||||
<DependentUpon>LabelMultiAutoTextEdit2.cs</DependentUpon>
|
||||
<EmbeddedResource Include="LabelMultiAutoTextEdit4.resx">
|
||||
<DependentUpon>LabelMultiAutoTextEdit4.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="LabelRadioButtonGroupEdit.resx">
|
||||
<DependentUpon>LabelRadioButtonGroupEdit.cs</DependentUpon>
|
||||
@@ -1489,11 +1504,14 @@
|
||||
<EmbeddedResource Include="MultiGridLookUp\FrmLookUp.resx">
|
||||
<DependentUpon>FrmLookUp.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MultiModelLookUp\FrmModelLookUp.resx">
|
||||
<DependentUpon>FrmModelLookUp.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MultiModelLookUp\FrmRowsModelLookUp.resx">
|
||||
<DependentUpon>FrmRowsModelLookUp.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MultiModelLookUp\FrmModelLookUp.resx">
|
||||
<DependentUpon>FrmModelLookUp.cs</DependentUpon>
|
||||
<EmbeddedResource Include="MultiModelLookUp\FrmModelLookUp2.resx">
|
||||
<DependentUpon>FrmModelLookUp2.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MultiModelLookUp\FrmRowsModelLookUpNew.resx">
|
||||
<DependentUpon>FrmRowsModelLookUpNew.cs</DependentUpon>
|
||||
|
||||
@@ -298,11 +298,18 @@ namespace Lskj.Control.Model
|
||||
break;
|
||||
case ControlType.LabSelectReturnId:
|
||||
case ControlType.LabSelectReturnText:
|
||||
LabelMultiAutoTextEdit2 moduleReturnsId = ctrol as LabelMultiAutoTextEdit2;
|
||||
LabelMultiAutoTextEdit4 moduleReturnsId = ctrol as LabelMultiAutoTextEdit4;
|
||||
moduleReturnsId.TextEdit.Size = new Size(Convert.ToInt32(moduleReturnsId.TextEdit.Width * widthZoomValue), Convert.ToInt32(moduleReturnsId.TextEdit.Height * heightZoomValue));
|
||||
moduleReturnsId.TextEdit.Font = new Font(moduleReturnsId.TextEdit.Font.OriginalFontName, Convert.ToSingle(moduleReturnsId.TextEdit.Font.Size * fontZoomValue * fontZoomValue));
|
||||
moduleReturnsId.TextEdit.Tag = "Changed";
|
||||
break;
|
||||
case ControlType.LabSelectReturnIdNew:
|
||||
case ControlType.LabSelectReturnTextNew:
|
||||
LabelMultiAutoTextEdit4 moduleReturnsIdNew = ctrol as LabelMultiAutoTextEdit4;
|
||||
moduleReturnsIdNew.TextEdit.Size = new Size(Convert.ToInt32(moduleReturnsIdNew.TextEdit.Width * widthZoomValue), Convert.ToInt32(moduleReturnsIdNew.TextEdit.Height * heightZoomValue));
|
||||
moduleReturnsIdNew.TextEdit.Font = new Font(moduleReturnsIdNew.TextEdit.Font.OriginalFontName, Convert.ToSingle(moduleReturnsIdNew.TextEdit.Font.Size * fontZoomValue * fontZoomValue));
|
||||
moduleReturnsIdNew.TextEdit.Tag = "Changed";
|
||||
break;
|
||||
case ControlType.LabText:
|
||||
// 文本控件
|
||||
LabelTextEdit textEdit = ctrol as LabelTextEdit;
|
||||
@@ -516,28 +523,4 @@ namespace Lskj.Control.Model
|
||||
/// <para>说明:页签控件个数改变时更改标题字体大小</para>
|
||||
/// <para>创建人:唐德馨</para>
|
||||
/// <para>创建日期:2021-09-03</para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
private static void TabPages_CollectionChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DevExpress.XtraTab.XtraTabPage tabPage = e.Element as DevExpress.XtraTab.XtraTabPage;
|
||||
if (e.Action.ToString().Equals("Add"))
|
||||
{
|
||||
tabPage.Appearance.Header.Font = new Font(tabPage.Appearance.Header.Font.OriginalFontName, Convert.ToSingle(tabPage.Appearance.Header.Font.Size * fontZoomValue * fontZoomValue));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = Lskj.Business.Impl.ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message, ex.Message);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
//
|
||||
@@ -400,6 +400,14 @@ namespace Lskj.Control.Model
|
||||
/// 自动模糊匹配弹出模块
|
||||
/// </summary>
|
||||
public const int LabAutoSelectControl = 159;
|
||||
/// <summary>
|
||||
/// 模块选择返回ID(新版)
|
||||
/// </summary>
|
||||
public const int LabSelectReturnIdNew = 160;
|
||||
/// <summary>
|
||||
/// 模块选择返回Text(新版)
|
||||
/// </summary>
|
||||
public const int LabSelectReturnTextNew = 161;
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -469,32 +477,4 @@ namespace Lskj.Control.Model
|
||||
modelType = 7;
|
||||
break;
|
||||
case "AuditPopupBasicInfoGridView"://单据弹出加载附加信息
|
||||
modelType = 8;
|
||||
break;
|
||||
default:
|
||||
modelType = 0;
|
||||
break;
|
||||
}
|
||||
return modelType;
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:是否为日期类型</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期: </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="fieldType">Type of the field.</param>
|
||||
/// <returns><c>true</c> if the specified field type is date; otherwise, <c>false</c>.</returns>
|
||||
public static bool IsDate(int fieldType)
|
||||
{
|
||||
return fieldType == LabDate ||
|
||||
fieldType == LabDateTime ||
|
||||
fieldType == LabDateTimeShort ||
|
||||
fieldType == LabTime ||
|
||||
fieldType == LabShortTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
modelType =
|
||||
@@ -326,6 +326,12 @@ namespace Lskj.Control.Model
|
||||
/// 条件
|
||||
/// </summary>
|
||||
public string SplicingConditions;
|
||||
|
||||
/// <summary>
|
||||
/// 禁显状态(true是禁显)
|
||||
/// </summary>
|
||||
public bool isVislble;
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
@@ -401,4 +407,5 @@ namespace Lskj.Control.Model
|
||||
this.IsRadio = item.Table.Columns.Contains("IsRadio") && !string.IsNullOrWhiteSpace(item["IsRadio"] + "") ? "1".Equals(item["IsRadio"] + "") : false;
|
||||
this.SearchBoxAddition = item.Table.Columns.Contains("SearchBoxAddition") && !string.IsNullOrWhiteSpace(item["SearchBoxAddition"] + "") ? "1".Equals(item["SearchBoxAddition"] + "") : false;
|
||||
this.RepeatedVerification = item.Table.Columns.Contains("RepeatedVerification") && !string.IsNullOrWhiteSpace(item["RepeatedVerification"] + "") ? "1".Equals(item["RepeatedVerification"] + "") : false;
|
||||
this.SelectionConditions = item.Table.Columns.Contains("SelectionConditions") ? item
|
||||
this.SelectionConditions = item.Table.Columns.Contains("SelectionConditions") ? item["SelectionConditions"] + "" : string.Empty;
|
||||
this._frozenFlag = item.Table.Columns.Contains("frozenFlag") && ("1".Equals(item["frozenFlag"] + "") || "Tr
|
||||
@@ -1399,8 +1399,15 @@ namespace Lskj.Control.Model
|
||||
{
|
||||
model.SourceSql += "and 1<>1";
|
||||
}
|
||||
DataTable table = BaseImpl.GetDataTableResult(model.SourceSql);
|
||||
|
||||
DataTable table = (model.FieldType == ControlType.LabSelectReturnIdNew || model.FieldType == ControlType.LabSelectReturnTextNew) ? new DataTable() : BaseImpl.GetDataTableResult(model.SourceSql);
|
||||
if (mControlSourceDic.ContainsKey(model))
|
||||
{
|
||||
table = mControlSourceDic[model].Result;
|
||||
}
|
||||
else
|
||||
{
|
||||
table = BaseImpl.GetDataTableResult(model.SourceSql);
|
||||
}
|
||||
//if (model.FieldType != ControlType.LabAutoCompleteValueParam && model.FieldType != ControlType.LabAutoCompleteTextParam && model.FieldType != ControlType.LabAutoCompleteValue && model.FieldType != ControlType.LabAutoCompleteText)
|
||||
// table = MainImpl.GetDataTableResult(model.SourceSql);
|
||||
//else
|
||||
@@ -2059,6 +2066,11 @@ namespace Lskj.Control.Model
|
||||
LabelMultiAutoTextEdit2 moduleReturnsId = ctr as LabelMultiAutoTextEdit2;
|
||||
value = ControlType.LabSelectReturnId == model.FieldType ? moduleReturnsId.EditValue : moduleReturnsId.EditText;
|
||||
break;
|
||||
case ControlType.LabSelectReturnIdNew:
|
||||
case ControlType.LabSelectReturnTextNew:
|
||||
LabelMultiAutoTextEdit4 moduleReturnsIdNew = ctr as LabelMultiAutoTextEdit4;
|
||||
value = ControlType.LabSelectReturnIdNew == model.FieldType ? moduleReturnsIdNew.EditValue : moduleReturnsIdNew.EditText;
|
||||
break;
|
||||
case ControlType.DynamicallyGeneratedSql:
|
||||
LabelMultiAutoTextEdit3 moduleSqlGenerated = ctr as LabelMultiAutoTextEdit3;
|
||||
value = moduleSqlGenerated.EditText;
|
||||
@@ -4165,18 +4177,35 @@ namespace Lskj.Control.Model
|
||||
moduleReturnsId.ControlObj = this;
|
||||
moduleReturnsId.UnionModuleCodel = model.AddModuleId;
|
||||
moduleReturnsId.SourceSQL = model.SourceSql;
|
||||
moduleReturnsId.SplicingConditions = model.SplicingConditions;
|
||||
moduleReturnsId.IsRadio = model.IsRadio;
|
||||
moduleReturnsId.ConfigureColumnMode = model.ConfigureColumnMode;
|
||||
|
||||
|
||||
// DataTable dataSource = new DataTable();
|
||||
//moduleReturnsId.SetDataSource(dataSource);
|
||||
|
||||
moduleReturnsId.TextEdit.KeyDown += new KeyEventHandler(OnTextEditKeyDown);
|
||||
moduleReturnsId.TextEdit.TextChanged += new EventHandler(OnTextEditTextChanged);
|
||||
if (!isLoadBorder) moduleReturnsId.TextEdit.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||
baseControl = moduleReturnsId;
|
||||
break;
|
||||
case ControlType.LabSelectReturnIdNew:
|
||||
case ControlType.LabSelectReturnTextNew:
|
||||
LabelMultiAutoTextEdit4 moduleReturnsIdNew = new LabelMultiAutoTextEdit4();
|
||||
moduleReturnsIdNew.ValueMember = ControlType.LabSelectReturnIdNew == model.FieldType ? model.ValueMember : model.TextMember;
|
||||
moduleReturnsIdNew.ValueField = model.ValueMember;
|
||||
moduleReturnsIdNew.TextField = model.TextMember;
|
||||
moduleReturnsIdNew.ControlObj = this;
|
||||
moduleReturnsIdNew.UnionModuleCodel = model.AddModuleId;
|
||||
moduleReturnsIdNew.SourceSQL = model.SourceSql;
|
||||
moduleReturnsIdNew.SplicingConditions = model.SplicingConditions;
|
||||
moduleReturnsIdNew.IsRadio = model.IsRadio;
|
||||
moduleReturnsIdNew.ConfigureColumnMode = model.ConfigureColumnMode;
|
||||
moduleReturnsIdNew.InitialFrame();
|
||||
|
||||
// DataTable dataSource = new DataTable();
|
||||
//moduleReturnsIdNew.SetDataSource(dataSource);
|
||||
moduleReturnsIdNew.TextEdit.KeyDown += new KeyEventHandler(OnTextEditKeyDown);
|
||||
moduleReturnsIdNew.TextEdit.TextChanged += new EventHandler(OnTextEditTextChanged);
|
||||
if (!isLoadBorder) moduleReturnsIdNew.TextEdit.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||
baseControl = moduleReturnsIdNew;
|
||||
break;
|
||||
case ControlType.DynamicallyGeneratedSql:
|
||||
LabelMultiAutoTextEdit3 moduleSqlGenerated = new LabelMultiAutoTextEdit3();
|
||||
// moduleSqlGenerated.SetDataSource();
|
||||
@@ -4241,6 +4270,8 @@ namespace Lskj.Control.Model
|
||||
this.mControlList.Add(model);
|
||||
return baseControl;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 限制數值框粘貼不能粘貼中文
|
||||
/// </summary>
|
||||
|
||||
@@ -1411,7 +1411,7 @@ namespace Lskj.Control
|
||||
//Tips = "条件判断错误:\r\n" + Tips;
|
||||
//string Message = ErrorMessage.PromptErrorMessage(ex, "", Tips);
|
||||
////MessageUtil.Show("条件判断错误:\r\n" + Tips);
|
||||
LogHelper.Instance.WriteError(ex);
|
||||
if(!ex.Message.Equals("该字符串未被识别为有效的布尔值。")) LogHelper.Instance.WriteError(ex);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -3233,7 +3233,7 @@ namespace Lskj.Control
|
||||
{
|
||||
this.SysModel = sysModel;
|
||||
this.Model = model;
|
||||
|
||||
this.gcMain.DisableFieldSources = this.SysModel.DisableFieldSources;
|
||||
//if (this.Model is DynamicModuleDetailModelInfo)
|
||||
//{
|
||||
// DynamicModuleDetailModelInfo dynamic = this.Model as DynamicModuleDetailModelInfo;
|
||||
@@ -5063,4 +5063,42 @@ namespace Lskj.Control
|
||||
int focusedRowHandle = this.gcMain.GridView.FocusedRowHandle;
|
||||
GridColumn[] Columns = this.gcMain.GridView.GetSelectedCells(focusedRowHandle);//当前选中的单元格
|
||||
//判断是否为最后一行,最后一列
|
||||
if (Columns.Length > 0 && Columns[0].VisibleIndex == this.gcMain.GridView.Columns.
|
||||
if (Columns.Length > 0 && Columns[0].VisibleIndex == this.gcMain.GridView.Columns.Count - 1 && focusedRowHandle == this.gcMain.GridView.RowCount - 1)
|
||||
{
|
||||
this.AddGridViewRecord();
|
||||
}
|
||||
//判断表格是否为空
|
||||
if (this.gcMain.GridView.RowCount == 0)
|
||||
{
|
||||
this.AddGridViewRecord();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 切换时保存(作为明细页签被切换时)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool SaveWhenSwitching()
|
||||
{
|
||||
this.SaveResults = false;
|
||||
if (this.pl_buttom.Visible && this.btnSave.Visible && this.btnSave.Enabled)
|
||||
{
|
||||
this.SaveGridRecord(false);
|
||||
}
|
||||
return SaveResults;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using DevExpress.XtraEditors;
|
||||
using DevExpress.Utils.Menu;
|
||||
using DevExpress.XtraEditors;
|
||||
using DevExpress.XtraGrid.Columns;
|
||||
using DevExpress.XtraGrid.Menu;
|
||||
using DevExpress.XtraGrid.Views.Grid;
|
||||
using Lskj.Business;
|
||||
using Lskj.Business.Impl;
|
||||
@@ -9,10 +11,12 @@ using Lskj.Model;
|
||||
using Lskj.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.Control.MultiModelLookUp
|
||||
@@ -20,7 +24,14 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
public partial class FrmModelLookUp : BaseForm
|
||||
{
|
||||
#region 私有字段
|
||||
|
||||
/// <summary>
|
||||
/// 复选框字段名称
|
||||
/// </summary>
|
||||
private string _checkFieldName = "_check";
|
||||
/// <summary>
|
||||
/// The _id
|
||||
/// </summary>
|
||||
private string _id = "_id";
|
||||
#endregion
|
||||
#region 公有字段
|
||||
/// <summary>
|
||||
@@ -60,7 +71,7 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
/// </summary>
|
||||
public string RemarkField = "remark";
|
||||
/// <summary>
|
||||
/// 数据源(初始)
|
||||
/// 数据源
|
||||
/// </summary>
|
||||
/// <value>The source SQL.</value>
|
||||
public string SourceSQL { get; set; }
|
||||
@@ -138,19 +149,7 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
/// 左侧树结构、表格主键
|
||||
/// </summary>
|
||||
public string ParentKeyField;
|
||||
/// <summary>
|
||||
/// 数据源(替换参数后)
|
||||
/// </summary>
|
||||
/// <value>The source SQL.</value>
|
||||
public string NewSourceSQL;
|
||||
/// <summary>
|
||||
/// 关联返回参数的字段组合
|
||||
/// </summary>
|
||||
public string AddModuleResult;
|
||||
/// <summary>
|
||||
/// 返回关联的字典
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ModuleResultDic = new Dictionary<string, string>();
|
||||
|
||||
#endregion
|
||||
public FrmModelLookUp(string ModuleCodel)
|
||||
{
|
||||
@@ -189,23 +188,29 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
//设置关联模块
|
||||
bool result = SetAssociatedModules();
|
||||
|
||||
|
||||
|
||||
//单选模式,不显示明细表,主表双击选中后退出选择界面
|
||||
if (SingleChoiceMode)
|
||||
{
|
||||
this.splitMain_Right.PanelVisibility = SplitPanelVisibility.Panel1;
|
||||
this.gcMain.GridView.DoubleClick += new EventHandler(OnRowCellClickRadio);
|
||||
//设置上方条件
|
||||
DataTable queryTable = BaseModuleImpl.GetCustomQueryFields(this.SysModel.CondKey);//加载自定义配置字段
|
||||
this.SearchObj = new MyControl(this.SysModel.MenuSql, this.gcMain, LeftTreeViewEx, LeftGridEx);
|
||||
this.SearchObj.ParentUnionField = this.ParentUnionField;
|
||||
this.pl_top.Height = this.SearchObj.InitSearchControl(queryTable, this.pl_top);
|
||||
this.SearchObj.OnSearchAfterCallBack += SearchObj_OnSearchAfterCallBack;
|
||||
this.SourceSQL = this.SysModel.MenuSql;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.gcMain.GridView.DoubleClick += new EventHandler(OnRowCellClick);
|
||||
this.gcDetail.GridView.DoubleClick += new EventHandler(OnDoubleClick);
|
||||
this.pl_top.Height = 0;
|
||||
this.Resize += new System.EventHandler(maximization);
|
||||
this.splitMain_Right.SplitterMoved += new EventHandler(PositionChange);
|
||||
}
|
||||
|
||||
this.SourceSQL = this.SysModel.MenuSql;
|
||||
|
||||
this.gcDetail.GridView.OptionsSelection.EnableAppearanceFocusedCell = false;
|
||||
|
||||
this.gcDetail.GridView.OptionsView.ColumnAutoWidth = true;
|
||||
@@ -279,7 +284,7 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
{
|
||||
success = this.gcMain.GridView.UpdateCustomColumnToDatabase(this.CurrentOperColumnKey);
|
||||
}
|
||||
//this.SetDetailDataSource();
|
||||
this.SetDetailDataSource();
|
||||
MessageUtil.Show(success ? ResourceKeys.SaveSuccess : ResourceKeys.SaveFault);
|
||||
}
|
||||
catch (SqlException sex)
|
||||
@@ -312,17 +317,16 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
/// </summary>
|
||||
private void SetDetailDataSource()
|
||||
{
|
||||
//return;
|
||||
//DataTable table = this.DataSource.Copy();
|
||||
//DataRow[] rows = table.Select(_checkFieldName + "=True");
|
||||
DataTable table = this.DataSource.Copy();
|
||||
DataRow[] rows = table.Select(_checkFieldName + "=True");
|
||||
|
||||
//if (rows != null && rows.Length > 0)
|
||||
// this.gcDetail.GridControl.DataSource = rows.CopyToDataTable();
|
||||
//else
|
||||
//{
|
||||
// this.gcDetail.GridControl.DataSource = table;
|
||||
// this.gcDetail.GridControl.DataSourceTable().Clear();
|
||||
//}
|
||||
if (rows != null && rows.Length > 0)
|
||||
this.gcDetail.GridControl.DataSource = rows.CopyToDataTable();
|
||||
else
|
||||
{
|
||||
this.gcDetail.GridControl.DataSource = table;
|
||||
this.gcDetail.GridControl.DataSourceTable().Clear();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -364,17 +368,22 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
/// </summary>
|
||||
private void SetReadOnlyColumns()
|
||||
{
|
||||
if (this.ConfigureColumnMode)//&& SingleChoiceMode
|
||||
if (this.ConfigureColumnMode && SingleChoiceMode)
|
||||
{
|
||||
DataTable _gridColumns = BaseModuleImpl.GetBaseGridColumns(this.UnionModuleCodel);
|
||||
this.gcMain.SetReadOnlyColumns(_gridColumns, GridCustomColumnStruct.BaseMainGridView + this.SysModel.FormKey);
|
||||
this.gcDetail.SetReadOnlyColumns(_gridColumns, GridCustomColumnStruct.BaseMainGridView + this.SysModel.FormKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.gcMain.GridView.Columns.Clear();
|
||||
this.gcDetail.GridView.Columns.Clear();
|
||||
|
||||
GridColumn checkColumn = new GridColumn();
|
||||
checkColumn.Name = checkColumn.FieldName = this._checkFieldName;
|
||||
checkColumn.Caption = "选";
|
||||
checkColumn.Width = 30;
|
||||
checkColumn.Visible = true;
|
||||
checkColumn.OptionsColumn.AllowEdit = false;
|
||||
|
||||
GridColumn valueColumn = new GridColumn();
|
||||
valueColumn.FieldName = valueColumn.Name = ValueField;
|
||||
@@ -394,8 +403,8 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
|
||||
|
||||
|
||||
this.gcMain.GridView.Columns.AddRange(new GridColumn[] { valueColumn, textColumn });
|
||||
this.gcDetail.GridView.Columns.AddRange(new GridColumn[] { valueColumn, textColumn });
|
||||
this.gcMain.GridView.Columns.AddRange(new GridColumn[] { checkColumn, valueColumn, textColumn });
|
||||
this.gcDetail.GridView.Columns.AddRange(new GridColumn[] { checkColumn, valueColumn, textColumn });
|
||||
|
||||
if (DataSource.Columns.IndexOf("remark") != -1)
|
||||
{
|
||||
@@ -622,17 +631,11 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
/// <param name="menuCode">The menu code.</param>
|
||||
public void InitControls(string UnionModuleCodel)
|
||||
{
|
||||
|
||||
this.SysModel.MenuSql = this.NewSourceSQL;
|
||||
//设置上方条件
|
||||
this.pl_top.Controls.Clear();
|
||||
DataTable queryTable = BaseModuleImpl.GetCustomQueryFields(this.SysModel.CondKey);//加载自定义配置字段
|
||||
this.SearchObj = new MyControl(this.SysModel.MenuSql, this.gcMain, LeftTreeViewEx, LeftGridEx);
|
||||
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;
|
||||
|
||||
//单选模式以模块sql为为准
|
||||
if (SingleChoiceMode)
|
||||
{
|
||||
this.SourceSQL = this.SysModel.MenuSql;
|
||||
}
|
||||
if (LeftTreeViewEx != null && LeftTreeViewEx.TreeView.Nodes.Count > 0)
|
||||
{
|
||||
LeftTreeViewEx.TreeView.SelectedNode = LeftTreeViewEx.TreeView.Nodes[0];//重新打开时默认选中第一条
|
||||
@@ -643,7 +646,7 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
LeftGridEx.GridView.SelectRow(0);
|
||||
}
|
||||
|
||||
this.DataSource = BaseImpl.GetDataTableResult(this.NewSourceSQL);
|
||||
this.DataSource = BaseImpl.GetDataTableResult(this.SourceSQL);
|
||||
this.SetSelectionBox();
|
||||
//创建表格列
|
||||
if (isFirst)
|
||||
@@ -661,7 +664,7 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
|
||||
private void SearchObj_OnSearchAfterCallBack(object sender, EventArgs e)
|
||||
{
|
||||
//this.SetSelectionBox();
|
||||
this.SetSelectionBox();
|
||||
//this.SetReadOnlyColumns();
|
||||
}
|
||||
|
||||
@@ -715,7 +718,8 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
DataRow rowItem = rowItem = this.DataSource.Rows.Cast<DataRow>().FirstOrDefault(x => x[isValue ? ValueMember : TextField] + "" == spilts[i].Trim());
|
||||
if (rowItem != null)
|
||||
{
|
||||
(this.gcDetail.GridControl.DataSource as DataTable).Rows.Add(rowItem.ItemArray);
|
||||
rowItem[_checkFieldName] = check;
|
||||
rowItem.AcceptChanges();
|
||||
}
|
||||
}
|
||||
this.SetDetailDataSource();
|
||||
@@ -798,10 +802,11 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
DataRow rowItem = this.gcMain.GridView.GetFocusedDataRow();
|
||||
if (rowItem != null)
|
||||
{
|
||||
(this.gcDetail.GridControl.DataSource as DataTable).Rows.Add(rowItem.ItemArray);
|
||||
rowItem[_checkFieldName] = "True".Equals(rowItem[_checkFieldName] + "") ? 0 : 1;
|
||||
//rowItem[_checkFieldName] = rowItem.Table.Columns.Contains(_checkFieldName) : "True".Equals(rowItem[_checkFieldName] + "") ? 0 : 1 ? 0;
|
||||
rowItem.AcceptChanges();
|
||||
}
|
||||
|
||||
this.SetDetailDataSource();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -819,6 +824,8 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
{
|
||||
|
||||
DataRow dr = this.gcMain.GridView.GetFocusedDataRow();
|
||||
//DataRow[] rowItems = this.DataSource.Select(_checkFieldName + "=True");
|
||||
|
||||
if (dr != null)
|
||||
{
|
||||
this.EditValue = dr[ValueMember] + "";
|
||||
@@ -848,7 +855,13 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
{
|
||||
if (this.gcDetail.GridView.RowCount == 0) return;
|
||||
DataRow rowItem = this.gcDetail.GridView.GetFocusedDataRow();
|
||||
(this.gcDetail.GridControl.DataSource as DataTable).Rows.Remove(rowItem);
|
||||
DataRow[] sourceRowItems = this.DataSource.Select(_id + "=" + rowItem[_id] + "");
|
||||
if (rowItem != null && sourceRowItems != null && sourceRowItems.Length > 0)
|
||||
{
|
||||
sourceRowItems[0][_checkFieldName] = 0;
|
||||
sourceRowItems[0].AcceptChanges();
|
||||
}
|
||||
this.SetDetailDataSource();
|
||||
}
|
||||
#endregion
|
||||
#region 关闭时清空唯一键
|
||||
@@ -884,49 +897,20 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
private void btnOk_Click(object sender, EventArgs e)
|
||||
{
|
||||
EditValue = string.Empty;
|
||||
EditText = string.Empty;
|
||||
ModuleResultDic.Clear();
|
||||
DataTable sourceTable = this.gcDetail.GridControl.DataSource as DataTable;
|
||||
foreach (DataRow item in sourceTable.Rows)
|
||||
this.EditValue = string.Empty;
|
||||
this.EditText = string.Empty;
|
||||
|
||||
DataRow[] rowItems = this.DataSource.Select(_checkFieldName + "=True");
|
||||
|
||||
foreach (DataRow item in rowItems)
|
||||
{
|
||||
this.EditValue += item[ValueMember] + ",";
|
||||
this.EditText += item[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 = "";
|
||||
foreach (DataRow item in sourceTable.Rows)
|
||||
{
|
||||
if (item.Table.Columns.Contains(beforeAs))
|
||||
{
|
||||
value += item[beforeAs] + ",";
|
||||
}
|
||||
}
|
||||
ModuleResultDic.Add(afterAs, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
string value = "";
|
||||
foreach (DataRow item in sourceTable.Rows)
|
||||
{
|
||||
if (item.Table.Columns.Contains(resultField))
|
||||
{
|
||||
value += item[resultField] + ",";
|
||||
}
|
||||
}
|
||||
ModuleResultDic.Add(resultField, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//this.EditValue = this.EditValue.Trim(',');
|
||||
//this.EditText = this.EditText.Trim(',');
|
||||
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
@@ -961,8 +945,9 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
DataTable DataSource = this.gcMain.GridView.GetGridViewFilteredAndSortedDataToDataTable();
|
||||
foreach (DataRow item in DataSource.Rows)
|
||||
{
|
||||
//DataRow rowItem = this.DataSource.Select("1=1").FirstOrDefault(x => (item[_id] + "").Equals(x[_id] + ""));
|
||||
(this.gcDetail.GridControl.DataSource as DataTable).Rows.Add(item.ItemArray);
|
||||
DataRow rowItem = this.DataSource.Select("1=1").FirstOrDefault(x => (item[_id] + "").Equals(x[_id] + ""));
|
||||
rowItem[_checkFieldName] = 1;
|
||||
rowItem.AcceptChanges();
|
||||
}
|
||||
this.SetDetailDataSource();
|
||||
}
|
||||
@@ -977,7 +962,16 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
private void btn_cancelAll_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
(this.gcDetail.GridControl.DataSource as DataTable).Clear();
|
||||
DataTable dt = this.DataSource.Clone();
|
||||
foreach (DataRow item in this.DataSource.Rows)
|
||||
{
|
||||
if ("True".Equals(item[_checkFieldName] + ""))
|
||||
{
|
||||
|
||||
item[_checkFieldName] = 0;
|
||||
}
|
||||
}
|
||||
this.SetDetailDataSource();
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -1038,4 +1032,17 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
case 2: // 左侧为表格
|
||||
this.gridLeft.Visible = true;
|
||||
this.treeLeft.Visible = false;
|
||||
this.InitlizeSpiltL
|
||||
this.InitlizeSpiltLocation();
|
||||
this.SetLeftGridView();
|
||||
//this.ModuleGridObj.SaveEvent += new Lskj.Control.ModuleGridEx.SaveEventHander(SetDetailGridView);
|
||||
this.LeftGridEx = this.gridLeft;
|
||||
break;
|
||||
case 3: // 左侧为空
|
||||
default:
|
||||
this.splitMain.PanelVisibility = SplitPanelVisibility.Panel2;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
@@ -0,0 +1,343 @@
|
||||
namespace Lskj.Control.MultiModelLookUp
|
||||
{
|
||||
partial class FrmModelLookUp2
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.splitMain = new DevExpress.XtraEditors.SplitContainerControl();
|
||||
this.pl_left = new DevExpress.XtraEditors.PanelControl();
|
||||
this.pl_left_main = new System.Windows.Forms.Panel();
|
||||
this.pl_gridandtree_container = new DevExpress.XtraEditors.PanelControl();
|
||||
this.treeLeft = new Lskj.Control.TreeViewEx();
|
||||
this.gridLeft = new Lskj.Control.GridControlEx();
|
||||
this.pl_left_top = new DevExpress.XtraEditors.PanelControl();
|
||||
this.splitMain_Right = new DevExpress.XtraEditors.SplitContainerControl();
|
||||
this.gcMain = new Lskj.Control.GridControlEx();
|
||||
this.pl_top = new DevExpress.XtraEditors.PanelControl();
|
||||
this.gcDetail = new Lskj.Control.GridControlEx();
|
||||
this.panelControl1 = new DevExpress.XtraEditors.PanelControl();
|
||||
this.btnCancel = new DevExpress.XtraEditors.SimpleButton();
|
||||
this.btn_selectAll = new DevExpress.XtraEditors.SimpleButton();
|
||||
this.btn_cancelAll = new DevExpress.XtraEditors.SimpleButton();
|
||||
this.btnOk = new DevExpress.XtraEditors.SimpleButton();
|
||||
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.tsmi_all = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.tsmi_reserve = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.tsmi_cancel = new System.Windows.Forms.ToolStripMenuItem();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitMain)).BeginInit();
|
||||
this.splitMain.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_left)).BeginInit();
|
||||
this.pl_left.SuspendLayout();
|
||||
this.pl_left_main.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_gridandtree_container)).BeginInit();
|
||||
this.pl_gridandtree_container.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_left_top)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitMain_Right)).BeginInit();
|
||||
this.splitMain_Right.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_top)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.panelControl1)).BeginInit();
|
||||
this.panelControl1.SuspendLayout();
|
||||
this.contextMenuStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitMain
|
||||
//
|
||||
this.splitMain.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitMain.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitMain.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.splitMain.Name = "splitMain";
|
||||
this.splitMain.Panel1.Controls.Add(this.pl_left);
|
||||
this.splitMain.Panel1.Text = "Panel1";
|
||||
this.splitMain.Panel2.Controls.Add(this.splitMain_Right);
|
||||
this.splitMain.Panel2.Text = "Panel2";
|
||||
this.splitMain.Size = new System.Drawing.Size(1131, 499);
|
||||
this.splitMain.SplitterPosition = 260;
|
||||
this.splitMain.TabIndex = 0;
|
||||
this.splitMain.Text = "splitContainerControl1";
|
||||
//
|
||||
// pl_left
|
||||
//
|
||||
this.pl_left.Appearance.BackColor = System.Drawing.Color.Transparent;
|
||||
this.pl_left.Appearance.Options.UseBackColor = true;
|
||||
this.pl_left.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||
this.pl_left.Controls.Add(this.pl_left_main);
|
||||
this.pl_left.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pl_left.Location = new System.Drawing.Point(0, 0);
|
||||
this.pl_left.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.pl_left.Name = "pl_left";
|
||||
this.pl_left.Size = new System.Drawing.Size(260, 499);
|
||||
this.pl_left.TabIndex = 1;
|
||||
//
|
||||
// pl_left_main
|
||||
//
|
||||
this.pl_left_main.BackColor = System.Drawing.Color.Transparent;
|
||||
this.pl_left_main.Controls.Add(this.pl_gridandtree_container);
|
||||
this.pl_left_main.Controls.Add(this.pl_left_top);
|
||||
this.pl_left_main.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pl_left_main.Location = new System.Drawing.Point(0, 0);
|
||||
this.pl_left_main.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.pl_left_main.Name = "pl_left_main";
|
||||
this.pl_left_main.Size = new System.Drawing.Size(260, 499);
|
||||
this.pl_left_main.TabIndex = 6;
|
||||
//
|
||||
// pl_gridandtree_container
|
||||
//
|
||||
this.pl_gridandtree_container.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||
this.pl_gridandtree_container.Controls.Add(this.treeLeft);
|
||||
this.pl_gridandtree_container.Controls.Add(this.gridLeft);
|
||||
this.pl_gridandtree_container.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pl_gridandtree_container.Location = new System.Drawing.Point(0, 45);
|
||||
this.pl_gridandtree_container.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.pl_gridandtree_container.Name = "pl_gridandtree_container";
|
||||
this.pl_gridandtree_container.Size = new System.Drawing.Size(260, 454);
|
||||
this.pl_gridandtree_container.TabIndex = 9;
|
||||
//
|
||||
// treeLeft
|
||||
//
|
||||
this.treeLeft.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.treeLeft.Location = new System.Drawing.Point(0, 0);
|
||||
this.treeLeft.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.treeLeft.Name = "treeLeft";
|
||||
this.treeLeft.Size = new System.Drawing.Size(260, 454);
|
||||
this.treeLeft.TabIndex = 7;
|
||||
this.treeLeft.Visible = false;
|
||||
//
|
||||
// gridLeft
|
||||
//
|
||||
this.gridLeft.AdapterObj = null;
|
||||
this.gridLeft.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.gridLeft.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gridLeft.Location = new System.Drawing.Point(0, 0);
|
||||
this.gridLeft.Margin = new System.Windows.Forms.Padding(5);
|
||||
this.gridLeft.Name = "gridLeft";
|
||||
this.gridLeft.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
|
||||
this.gridLeft.Size = new System.Drawing.Size(260, 454);
|
||||
this.gridLeft.TabIndex = 6;
|
||||
//
|
||||
// pl_left_top
|
||||
//
|
||||
this.pl_left_top.Appearance.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.pl_left_top.Appearance.Options.UseBackColor = true;
|
||||
this.pl_left_top.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||
this.pl_left_top.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.pl_left_top.Location = new System.Drawing.Point(0, 0);
|
||||
this.pl_left_top.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.pl_left_top.Name = "pl_left_top";
|
||||
this.pl_left_top.Size = new System.Drawing.Size(260, 45);
|
||||
this.pl_left_top.TabIndex = 8;
|
||||
//
|
||||
// splitMain_Right
|
||||
//
|
||||
this.splitMain_Right.CollapsePanel = DevExpress.XtraEditors.SplitCollapsePanel.Panel2;
|
||||
this.splitMain_Right.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitMain_Right.Horizontal = false;
|
||||
this.splitMain_Right.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitMain_Right.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.splitMain_Right.Name = "splitMain_Right";
|
||||
this.splitMain_Right.Panel1.Controls.Add(this.gcMain);
|
||||
this.splitMain_Right.Panel1.Controls.Add(this.pl_top);
|
||||
this.splitMain_Right.Panel1.Text = "Panel1";
|
||||
this.splitMain_Right.Panel2.Controls.Add(this.gcDetail);
|
||||
this.splitMain_Right.Panel2.Controls.Add(this.panelControl1);
|
||||
this.splitMain_Right.Panel2.Text = "Panel2";
|
||||
this.splitMain_Right.Size = new System.Drawing.Size(866, 499);
|
||||
this.splitMain_Right.SplitterPosition = 243;
|
||||
this.splitMain_Right.TabIndex = 4;
|
||||
this.splitMain_Right.Text = "splitContainerControl1";
|
||||
//
|
||||
// gcMain
|
||||
//
|
||||
this.gcMain.AdapterObj = null;
|
||||
this.gcMain.BackColor = System.Drawing.Color.Transparent;
|
||||
this.gcMain.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gcMain.Location = new System.Drawing.Point(0, 34);
|
||||
this.gcMain.Margin = new System.Windows.Forms.Padding(5);
|
||||
this.gcMain.Name = "gcMain";
|
||||
this.gcMain.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
|
||||
this.gcMain.Size = new System.Drawing.Size(866, 209);
|
||||
this.gcMain.TabIndex = 12;
|
||||
//
|
||||
// pl_top
|
||||
//
|
||||
this.pl_top.Appearance.BackColor = System.Drawing.Color.Transparent;
|
||||
this.pl_top.Appearance.Options.UseBackColor = true;
|
||||
this.pl_top.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||
this.pl_top.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.pl_top.Location = new System.Drawing.Point(0, 0);
|
||||
this.pl_top.Name = "pl_top";
|
||||
this.pl_top.Size = new System.Drawing.Size(866, 34);
|
||||
this.pl_top.TabIndex = 11;
|
||||
//
|
||||
// gcDetail
|
||||
//
|
||||
this.gcDetail.AdapterObj = null;
|
||||
this.gcDetail.BackColor = System.Drawing.Color.Transparent;
|
||||
this.gcDetail.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gcDetail.Location = new System.Drawing.Point(0, 0);
|
||||
this.gcDetail.Margin = new System.Windows.Forms.Padding(6);
|
||||
this.gcDetail.Name = "gcDetail";
|
||||
this.gcDetail.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
|
||||
this.gcDetail.Size = new System.Drawing.Size(866, 204);
|
||||
this.gcDetail.TabIndex = 13;
|
||||
//
|
||||
// panelControl1
|
||||
//
|
||||
this.panelControl1.Controls.Add(this.btnCancel);
|
||||
this.panelControl1.Controls.Add(this.btn_selectAll);
|
||||
this.panelControl1.Controls.Add(this.btn_cancelAll);
|
||||
this.panelControl1.Controls.Add(this.btnOk);
|
||||
this.panelControl1.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.panelControl1.Location = new System.Drawing.Point(0, 204);
|
||||
this.panelControl1.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.panelControl1.Name = "panelControl1";
|
||||
this.panelControl1.Size = new System.Drawing.Size(866, 47);
|
||||
this.panelControl1.TabIndex = 8;
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnCancel.Location = new System.Drawing.Point(772, 5);
|
||||
this.btnCancel.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(79, 35);
|
||||
this.btnCancel.TabIndex = 24;
|
||||
this.btnCancel.Text = "取消(&C)";
|
||||
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
|
||||
//
|
||||
// btn_selectAll
|
||||
//
|
||||
this.btn_selectAll.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btn_selectAll.Appearance.Options.UseFont = true;
|
||||
this.btn_selectAll.Location = new System.Drawing.Point(16, 5);
|
||||
this.btn_selectAll.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.btn_selectAll.Name = "btn_selectAll";
|
||||
this.btn_selectAll.Size = new System.Drawing.Size(76, 35);
|
||||
this.btn_selectAll.TabIndex = 23;
|
||||
this.btn_selectAll.TabStop = false;
|
||||
this.btn_selectAll.Text = "全选";
|
||||
this.btn_selectAll.Click += new System.EventHandler(this.btn_selectAll_Click);
|
||||
//
|
||||
// btn_cancelAll
|
||||
//
|
||||
this.btn_cancelAll.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btn_cancelAll.Appearance.Options.UseFont = true;
|
||||
this.btn_cancelAll.Location = new System.Drawing.Point(100, 5);
|
||||
this.btn_cancelAll.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.btn_cancelAll.Name = "btn_cancelAll";
|
||||
this.btn_cancelAll.Size = new System.Drawing.Size(76, 35);
|
||||
this.btn_cancelAll.TabIndex = 23;
|
||||
this.btn_cancelAll.TabStop = false;
|
||||
this.btn_cancelAll.Text = "全取消";
|
||||
this.btn_cancelAll.Click += new System.EventHandler(this.btn_cancelAll_Click);
|
||||
//
|
||||
// btnOk
|
||||
//
|
||||
this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnOk.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnOk.Appearance.Options.UseFont = true;
|
||||
this.btnOk.Location = new System.Drawing.Point(688, 5);
|
||||
this.btnOk.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.btnOk.Name = "btnOk";
|
||||
this.btnOk.Size = new System.Drawing.Size(76, 35);
|
||||
this.btnOk.TabIndex = 23;
|
||||
this.btnOk.TabStop = false;
|
||||
this.btnOk.Text = "确定(&O)";
|
||||
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
|
||||
//
|
||||
// contextMenuStrip1
|
||||
//
|
||||
this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.tsmi_all,
|
||||
this.tsmi_reserve,
|
||||
this.toolStripSeparator1,
|
||||
this.tsmi_cancel});
|
||||
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
||||
this.contextMenuStrip1.Size = new System.Drawing.Size(101, 76);
|
||||
//
|
||||
// tsmi_all
|
||||
//
|
||||
this.tsmi_all.Name = "tsmi_all";
|
||||
this.tsmi_all.Size = new System.Drawing.Size(100, 22);
|
||||
this.tsmi_all.Text = "全选";
|
||||
//
|
||||
// tsmi_reserve
|
||||
//
|
||||
this.tsmi_reserve.Name = "tsmi_reserve";
|
||||
this.tsmi_reserve.Size = new System.Drawing.Size(100, 22);
|
||||
this.tsmi_reserve.Text = "反选";
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
this.toolStripSeparator1.Size = new System.Drawing.Size(97, 6);
|
||||
//
|
||||
// tsmi_cancel
|
||||
//
|
||||
this.tsmi_cancel.Name = "tsmi_cancel";
|
||||
this.tsmi_cancel.Size = new System.Drawing.Size(100, 22);
|
||||
this.tsmi_cancel.Text = "取消";
|
||||
//
|
||||
// FrmModelLookUp
|
||||
//
|
||||
this.Appearance.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.Appearance.Options.UseBackColor = true;
|
||||
this.Appearance.Options.UseFont = true;
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.ClientSize = new System.Drawing.Size(1131, 499);
|
||||
this.Controls.Add(this.splitMain);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Margin = new System.Windows.Forms.Padding(5);
|
||||
this.Name = "FrmModelLookUp";
|
||||
this.Text = "提示:双击选择";
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitMain)).EndInit();
|
||||
this.splitMain.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_left)).EndInit();
|
||||
this.pl_left.ResumeLayout(false);
|
||||
this.pl_left_main.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_gridandtree_container)).EndInit();
|
||||
this.pl_gridandtree_container.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_left_top)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitMain_Right)).EndInit();
|
||||
this.splitMain_Right.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_top)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.panelControl1)).EndInit();
|
||||
this.panelControl1.ResumeLayout(false);
|
||||
this.contextMenuStrip1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DevExpress.XtraEditors.SplitContainerControl splitMain;
|
||||
private DevExpress.XtraEditors.PanelControl pl_left;
|
||||
private System.Windows.Forms.Panel pl_left_main;
|
||||
private DevExpress.XtraEditors.PanelControl pl_gridandtree_container;
|
||||
private GridControlEx grid
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -1142,37 +1142,4 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
private void btn_cancelAll_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
DataTable dt = this.DataSource.Clone();
|
||||
foreach (DataRow item in this.DataSource.Rows)
|
||||
{
|
||||
if ("True".Equals(item[_checkFieldName] + ""))
|
||||
{
|
||||
|
||||
item[_checkFieldName] = 0;
|
||||
}
|
||||
}
|
||||
this.btnOk_Click(sender, e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 释放时清理数据源
|
||||
/// <summary>
|
||||
/// <para>说明:释放时清理数据源</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-03-16 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
private void OnFrmModelLookUp_Disposed(object sender, EventArgs e)
|
||||
{
|
||||
if (this.DataSource != null)
|
||||
{
|
||||
this.DataSource = null;
|
||||
}
|
||||
GC.Collect();
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
DataTabl
|
||||
@@ -864,34 +864,4 @@ namespace Lskj.Control.MultiModelLookUp
|
||||
this.gcMain.GridView.SelectionChanged -= OnGridViewSelectionChanged;
|
||||
if (SingleChoiceMode)
|
||||
{
|
||||
//清除所有选择
|
||||
this.gcMain.GridView.ClearSelection();
|
||||
}
|
||||
if (e.Action == CollectionChangeAction.Add)//选中
|
||||
{
|
||||
this.gcMain.GridView.SelectRow(e.ControllerRow);
|
||||
}
|
||||
this.gcMain.GridView.SelectionChanged += OnGridViewSelectionChanged;
|
||||
}
|
||||
#endregion
|
||||
#region 释放时清理数据源
|
||||
/// <summary>
|
||||
/// <para>说明:释放时清理数据源</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-03-16 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
private void OnFrmModelLookUp_Disposed(object sender, EventArgs e)
|
||||
{
|
||||
if (this.DataSource != null)
|
||||
{
|
||||
this.DataSource = null;
|
||||
}
|
||||
GC.Collect();
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
//清除所有选
|
||||
@@ -667,8 +667,8 @@ namespace Lskj.Control
|
||||
case ControlType.LabPic:
|
||||
InitPicEdit(column);
|
||||
break;
|
||||
case ControlType.LabSelectReturnId:
|
||||
case ControlType.LabSelectReturnText:
|
||||
case ControlType.LabSelectReturnIdNew:
|
||||
case ControlType.LabSelectReturnTextNew:
|
||||
InitSelectReturnId(column, model);
|
||||
break;
|
||||
case ControlType.LabSelectReturnRows:
|
||||
@@ -1194,12 +1194,12 @@ namespace Lskj.Control
|
||||
/// </summary>
|
||||
private void InitSelectReturnId(TreeListColumn gridColumn, GridColumnModel model)
|
||||
{
|
||||
FrmModelLookUp modelLookUp = new FrmModelLookUp(model.addModuleld);
|
||||
FrmModelLookUp2 modelLookUp = new FrmModelLookUp2(model.addModuleld);
|
||||
modelLookUp.ValueField = model.ValueMember;
|
||||
modelLookUp.TextField = model.TextMember;
|
||||
modelLookUp.SourceSQL = model.SqlSource;
|
||||
modelLookUp.IsType = model.FieldType;
|
||||
modelLookUp.ValueMember = model.FieldType == ControlType.LabSelectReturnId ? model.ValueMember : model.TextMember;
|
||||
modelLookUp.ValueMember = model.FieldType == ControlType.LabSelectReturnIdNew ? model.ValueMember : model.TextMember;
|
||||
modelLookUp.Tag = model;
|
||||
|
||||
RepositoryItemCheckedComboBoxEdit btnEdit = new RepositoryItemCheckedComboBoxEdit();
|
||||
@@ -1208,7 +1208,7 @@ namespace Lskj.Control
|
||||
btnEdit.AllowNullInput = DefaultBoolean.False;
|
||||
btnEdit.DisplayMember = model.TextMember;
|
||||
btnEdit.SeparatorChar = ',';
|
||||
btnEdit.ValueMember = model.FieldType == ControlType.LabSelectReturnId ? model.ValueMember : model.TextMember;
|
||||
btnEdit.ValueMember = model.FieldType == ControlType.LabSelectReturnIdNew ? model.ValueMember : model.TextMember;
|
||||
btnEdit.DataSource = MainImpl.GetDataTableResult(model.SqlSource);
|
||||
btnEdit.Buttons[0].Visible = false; // 不能移除,移除后事件不起作用.
|
||||
btnEdit.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Ellipsis) });
|
||||
@@ -1242,7 +1242,7 @@ namespace Lskj.Control
|
||||
modelLookUp.TextField = model.TextMember;
|
||||
modelLookUp.SourceSQL = model.SqlSource;
|
||||
modelLookUp.IsType = model.FieldType;
|
||||
modelLookUp.ValueMember = model.FieldType == ControlType.LabSelectReturnId ? model.ValueMember : model.TextMember;
|
||||
modelLookUp.ValueMember = model.FieldType == ControlType.LabSelectReturnIdNew ? model.ValueMember : model.TextMember;
|
||||
modelLookUp.selectField = gridColumn.FieldName;
|
||||
modelLookUp.Tag = model;
|
||||
|
||||
@@ -2378,7 +2378,7 @@ namespace Lskj.Control
|
||||
try
|
||||
{
|
||||
CheckedComboBoxEdit btnEdit = (CheckedComboBoxEdit)sender;
|
||||
FrmModelLookUp modelLookUp = e.Button.Tag as FrmModelLookUp;
|
||||
FrmModelLookUp2 modelLookUp = e.Button.Tag as FrmModelLookUp2;
|
||||
|
||||
GridColumnModel model = modelLookUp.Tag as GridColumnModel;
|
||||
modelLookUp.EditText = btnEdit.Text;
|
||||
@@ -2693,36 +2693,4 @@ namespace Lskj.Control
|
||||
}
|
||||
table.Rows.Add(newRow);
|
||||
//this.gridView.FocusedRowHandle = _rowNumber - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
//this.gcMain.UpdateCurrentRow();
|
||||
}
|
||||
}
|
||||
this.gcMain.ShowEditor();
|
||||
e.Handled = true;
|
||||
//SendKeys.Send("{Esc}");
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 去除多选框中的空格
|
||||
/// </summary>
|
||||
private object ReplaceMultiSpace(object text)
|
||||
{
|
||||
if (string.IsNullOrEmpty(text + ""))
|
||||
{
|
||||
return text;
|
||||
}
|
||||
string[] keyValues = (text + "").Split(',');
|
||||
string returnText = "";
|
||||
foreach (string keyValue in keyValues)
|
||||
{
|
||||
string newKeyValue = keyValue.Trim();
|
||||
returnText += string.Format("{0},", newKeyValue);
|
||||
}
|
||||
returnText = returnText.TrimEnd(',');
|
||||
return returnText + ",";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -483,6 +483,10 @@ namespace Lskj.Control
|
||||
case ControlType.LabSelectReturnText:
|
||||
InitSelectReturnId(column, model);
|
||||
break;
|
||||
case ControlType.LabSelectReturnIdNew:
|
||||
case ControlType.LabSelectReturnTextNew:
|
||||
InitSelectReturnIdNew(column, model);
|
||||
break;
|
||||
case ControlType.LabSelectReturnRows:
|
||||
InitSelectReturnRows(column, model);
|
||||
break;
|
||||
@@ -1036,6 +1040,47 @@ namespace Lskj.Control
|
||||
this.mControlList.Add(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:创建 模块返回ID</para>
|
||||
/// <para>创建人:曹屹峰</para>
|
||||
/// <para>创建日期:2021-08-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
private void InitSelectReturnIdNew(TreeListColumn gridColumn, GridColumnModel model)
|
||||
{
|
||||
FrmModelLookUp2 modelLookUp = new FrmModelLookUp2(model.addModuleld);
|
||||
modelLookUp.ValueField = model.ValueMember;
|
||||
modelLookUp.TextField = model.TextMember;
|
||||
modelLookUp.SourceSQL = model.SqlSource;
|
||||
modelLookUp.IsType = model.FieldType;
|
||||
modelLookUp.ValueMember = model.FieldType == ControlType.LabSelectReturnIdNew ? model.ValueMember : model.TextMember;
|
||||
modelLookUp.Tag = model;
|
||||
|
||||
RepositoryItemCheckedComboBoxEdit btnEdit = new RepositoryItemCheckedComboBoxEdit();
|
||||
btnEdit.NullText = "";
|
||||
btnEdit.PopupBorderStyle = PopupBorderStyles.Flat;
|
||||
btnEdit.AllowNullInput = DefaultBoolean.False;
|
||||
btnEdit.DisplayMember = model.TextMember;
|
||||
btnEdit.SeparatorChar = ',';
|
||||
btnEdit.ValueMember = model.FieldType == ControlType.LabSelectReturnIdNew ? model.ValueMember : model.TextMember;
|
||||
btnEdit.DataSource = MainImpl.GetDataTableResult(model.SqlSource);
|
||||
btnEdit.Buttons[0].Visible = false; // 不能移除,移除后事件不起作用.
|
||||
btnEdit.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Ellipsis) });
|
||||
|
||||
btnEdit.Tag = model;
|
||||
btnEdit.Buttons[1].Tag = modelLookUp;
|
||||
btnEdit.ButtonClick += new ButtonPressedEventHandler(OnModuleChoiceNew);
|
||||
|
||||
gridControl.RepositoryItems.Add(btnEdit);
|
||||
gridColumn.OptionsColumn.ReadOnly = true;
|
||||
gridColumn.ColumnEdit = btnEdit;
|
||||
|
||||
this.mControlList.Add(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:创建 模块返回行数据</para>
|
||||
/// <para>创建人:唐德馨</para>
|
||||
@@ -2526,7 +2571,6 @@ namespace Lskj.Control
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:表格打开模块返回id</para>
|
||||
/// <para>创建人:曹屹峰</para>
|
||||
@@ -2543,6 +2587,59 @@ namespace Lskj.Control
|
||||
CheckedComboBoxEdit btnEdit = (CheckedComboBoxEdit)sender;
|
||||
FrmModelLookUp modelLookUp = e.Button.Tag as FrmModelLookUp;
|
||||
|
||||
GridColumnModel model = modelLookUp.Tag as GridColumnModel;
|
||||
modelLookUp.EditText = btnEdit.Text;
|
||||
modelLookUp.CurrentOperColumnKey = Model.ModuleCode + "_" + model.FieldName;
|
||||
if (model.FieldType == ControlType.LabMultiSelectValue || model.FieldType == ControlType.LabMultiSelectValueParam)
|
||||
{
|
||||
modelLookUp.EditValue = btnEdit.EditValue + "";
|
||||
modelLookUp.EditText = string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
modelLookUp.EditText = btnEdit.Text;
|
||||
modelLookUp.EditValue = string.Empty;
|
||||
}
|
||||
//多选关联单据头
|
||||
modelLookUp.SourceSQL = model.SqlSource.Replace("#", "");
|
||||
//单据头关联取值
|
||||
if (this.ParentControl != null)
|
||||
{
|
||||
modelLookUp.SourceSQL = this.ParentControl.ReplaceControlValue(modelLookUp.SourceSQL);
|
||||
}
|
||||
|
||||
modelLookUp.SourceSQL = ReplaceHelper.ReplaceRowParam(this.GetViewFocusedDataRow(), modelLookUp.SourceSQL);
|
||||
//modelLookUp.DataSource = BaseImpl.GetDataTableResult(modelLookUp.SourceSQL);
|
||||
modelLookUp.InitControls(modelLookUp.UnionModuleCodel);
|
||||
DialogResult result = modelLookUp.ShowDialog();
|
||||
if (result == DialogResult.OK)
|
||||
{
|
||||
btnEdit.EditValue = modelLookUp.EditValue;
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex, Model.ModuleCode);
|
||||
MessageUtil.Show(Message, ex.Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:表格打开模块返回id</para>
|
||||
/// <para>创建人:曹屹峰</para>
|
||||
/// <para>创建日期:2021-08-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
protected void OnModuleChoiceNew(object sender, ButtonPressedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
CheckedComboBoxEdit btnEdit = (CheckedComboBoxEdit)sender;
|
||||
FrmModelLookUp2 modelLookUp = e.Button.Tag as FrmModelLookUp2;
|
||||
|
||||
GridColumnModel model = modelLookUp.Tag as GridColumnModel;
|
||||
modelLookUp.EditText = btnEdit.Text;
|
||||
modelLookUp.CurrentOperColumnKey = Model.ModuleCode + "_" + model.FieldName;
|
||||
|
||||
Reference in New Issue
Block a user