SVN-Revision: r279
This commit is contained in:
tdx
2025-02-21 06:52:01 +00:00
parent ba85d23227
commit b46e9f1c0d
8 changed files with 27 additions and 513 deletions
@@ -1,28 +1,24 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using DevExpress.Utils.Menu;
using DevExpress.XtraEditors;
using System.Drawing;
using DevExpress.XtraGrid.Views.Grid;
using System.Windows.Forms;
using System.Data;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Menu;
using DevExpress.XtraGrid.Views.Grid;
using Lskj.Business;
using Lskj.Business.Impl;
using Lskj.Control.Model;
using System.Threading;
using Lskj.Util;
using System.Text.RegularExpressions;
using Lskj.Data;
using DevExpress.XtraGrid.Menu;
using DevExpress.Utils.Menu;
using System.Data.SqlClient;
using Lskj.Business;
using Lskj.Model;
using Lskj.Core;
using System.Threading.Tasks;
using Lskj.Data;
using Lskj.Model;
using Lskj.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading;
using System.Windows.Forms;
namespace Lskj.Control
{
@@ -284,8 +280,7 @@ namespace Lskj.Control
/// <summary>
/// 是否是主页模块搜索框
/// </summary>
public bool IsHomepage=false;
public bool IsHomepage = false;
/// <summary>
/// <para>说明:隐藏弹出框</para>
@@ -338,10 +333,9 @@ namespace Lskj.Control
public AutoGridLookUp()
{
InitializeComponent();
InitializePopup();
InitializeEvent();
//this.Properties.Buttons[0].Kind = DevExpress.XtraEditors.Controls.ButtonPredefines.Down;
this.Disposed += OnDisposed;
}
/// <summary>
@@ -356,7 +350,6 @@ namespace Lskj.Control
private void InitializeEvent()
{
//this.Disposed += new EventHandler(OnAutoGridLookUp_Disposed);
this.GotFocus += new EventHandler(OnAutoGridLookUpGotFocus);
this.LostFocus += new EventHandler(OnAutoGridLookUpLostFocus);
this.KeyUp += new KeyEventHandler(OnAutoGridLookUpKeyUp);
@@ -369,10 +362,7 @@ namespace Lskj.Control
this._popup.GridControlObj.LostFocus += new EventHandler(OnAutoGridLookUpLostFocus);
this._popup.OnGridViewMouseClick += new EventHandler(OnPopupGridViewMouseClick);
this._popup.OnGridViewEnter += new KeyEventHandler(OnPopupGridViewEnter);
}
/// <summary>
/// <para>说明:初始化弹出框</para>
/// <para>创建人:龚宇超</para>
@@ -1001,7 +991,8 @@ namespace Lskj.Control
foreach (DataColumn dcol in table.Columns)
{
if ((dcol.ColumnName.Substring(0, 1) != "_") && (dcol.ColumnName.ToLower() != ValueField.ToLower()) && (dcol.ColumnName.ToLower() != TextMember.ToLower()) && (dcol.ColumnName.ToLower() != RemarkField.ToLower()) && ((int)dcol.ColumnName[0] > 127))
string lowerColumnName = dcol.ColumnName.ToLower();
if ((lowerColumnName.Substring(0, 1) != "_") && !lowerColumnName.Equals(ValueField, StringComparison.OrdinalIgnoreCase) && !lowerColumnName.Equals(TextMember, StringComparison.OrdinalIgnoreCase) && !lowerColumnName.Equals(RemarkField, StringComparison.OrdinalIgnoreCase) && ((int)dcol.ColumnName[0] > 127))
{
GridColumn otherColumn = new GridColumn();
otherColumn.Name = otherColumn.FieldName = otherColumn.Caption = dcol.ColumnName;
@@ -1033,7 +1024,7 @@ namespace Lskj.Control
try
{
AutoGridPopup popupObj = obj as AutoGridPopup;
string[] columnsWidth = Model != null&&Model.LookUpFieldsWidth!=null ? Model.LookUpFieldsWidth.Trim().TrimEnd(',').Split(',') : null;
string[] columnsWidth = Model != null && Model.LookUpFieldsWidth != null ? Model.LookUpFieldsWidth.Trim().TrimEnd(',').Split(',') : null;
if (Model != null && !string.IsNullOrWhiteSpace(Model.LookUpFieldsWidth) && columnsWidth.Length > 0)
{
if (this.InvokeRequired)
@@ -1367,19 +1358,15 @@ namespace Lskj.Control
BoolValue = true;
break;
}
}
return BoolValue;
}
catch (Exception ex)
{
return false;
}
}
/// <summary>
/// 值改变时刷新
/// </summary>
@@ -1406,7 +1393,6 @@ namespace Lskj.Control
// EditValue = this.Text;
//}
this.PopShowFlag = true;
}
private void HandPopupSqlValueNew(object searchText)
@@ -1509,10 +1495,8 @@ namespace Lskj.Control
}
}
}
sqlValue = ControlObj.ReplaceControlValue(sourceSql.Replace("#", ""));
}
if (!this._working)
{
Thread thread = new Thread(new ParameterizedThreadStart(RefreshPopupDataSourceNew));
@@ -1555,14 +1539,12 @@ namespace Lskj.Control
}
}
DateTime endTime = DateTime.Now;
if (this._queryQueue.Count > 0)
{
// 在检索过程中还存在输入数据,则拿最后一次数据在进行匹配一次
Thread thread = new Thread(new ParameterizedThreadStart(RefreshPopupDataSourceNew));
thread.IsBackground = true;
thread.Start(this._queryQueue.Last());
this._queryQueue.Clear();
}
else
@@ -1570,23 +1552,4 @@ namespace Lskj.Control
if (this.InvokeRequired)
{
this.Invoke(new EventHandler(delegate
{
int second = Convert.ToInt32((endTime - beginTime).TotalSeconds);
string tipMsg = "数据筛选完成.";
this.Popup.LabelObj.Text = second > 0 ? string.Format(tipMsg + "(耗时{0}秒)", second) : tipMsg;
this.Popup.GridControlObj.DataSource = table;
//this.DataSourceTable = table.Copy();
this._working = false;
this.CalcFormAndGrid(true);
}));
}
}
}
catch (Exception ex)
{
}
}
}
}