SVN-Revision: r949
This commit is contained in:
cyf
2025-08-14 08:47:36 +00:00
parent 648ff1099d
commit 18b823a11e
6 changed files with 135 additions and 68 deletions
@@ -24,6 +24,11 @@ namespace Lskj.Control
{
public partial class AutoGridLookUp : TextEdit
{
/// <summary>
/// 只查询名称
/// </summary>
public bool OnlyQueryName = false;
/// <summary>
/// 是否能直接弹出框
/// </summary>
@@ -311,7 +316,7 @@ namespace Lskj.Control
public void ShowPopup()
{
if (!this.Properties.ReadOnly && this.Enabled && !this.IsShowPopup && this.ContainsFocus)
{
{
if (AutoShowPopup && this._popup != null)
{
this.IsShowPopup = true;
@@ -529,11 +534,22 @@ namespace Lskj.Control
{
string sql = "select top 500 * from ({0}) temp where {1} like '%{3}%' or {2} like '%{3}%' ";
sqlValue = string.Format(sql + remarkCond + AddConditions, replace ? SourceSQL.Replace("#", "") : SourceSQL, ValueField, TextMember, (searchText + "").Replace("[", "[[]"));
if (OnlyQueryName)
{
sql = "select top 500 * from ({0}) temp where {1} like '%{2}%' ";
sqlValue = string.Format(sql + remarkCond + AddConditions, replace ? SourceSQL.Replace("#", "") : SourceSQL, TextMember, (searchText + "").Replace("[", "[[]"));
}
}
else
{
string sql = "select top 500 * from ({0}) temp where {1} like '%{3}%' or {2} like '%{3}%' or dbo.P_getpy({2}) like '%{3}%' ";
sqlValue = string.Format(sql + remarkCond + AddConditions, replace ? SourceSQL.Replace("#", "") : SourceSQL, ValueField, TextMember, (searchText + "").Replace("[", "[[]"));
if (OnlyQueryName)
{
sql = "select top 500 * from ({0}) temp where {1} like '%{2}%' or dbo.P_getpy({1}) like '%{2}%' ";
sqlValue = string.Format(sql + remarkCond + AddConditions, replace ? SourceSQL.Replace("#", "") : SourceSQL, TextMember, (searchText + "").Replace("[", "[[]"));
}
}
if (Model != null && !string.IsNullOrEmpty(Model.AddOrderByCond))
{
@@ -1454,12 +1470,23 @@ namespace Lskj.Control
{
string sql = "select top 500 * from ({0}) temp where {1} like '%{3}%' or {2} like '%{3}%' ";
sqlValue = string.Format(sql + remarkCond + AddConditions, SourceSQL, ValueField, TextMember, (searchText + "").Replace("[", "[[]"));
if (OnlyQueryName)
{
sql = "select top 500 * from ({0}) temp where {1} like '%{2}%' ";
sqlValue = string.Format(sql + remarkCond + AddConditions, SourceSQL, TextMember, (searchText + "").Replace("[", "[[]"));
}
}
else
{
string sql = "select top 500 * from ({0}) temp where {1} like '%{3}%' or {2} like '%{3}%' or dbo.P_getpy({2}) like '%{3}%' ";
sqlValue = string.Format(sql + remarkCond + AddConditions, SourceSQL, ValueField, TextMember, (searchText + "").Replace("[", "[[]"));
if (OnlyQueryName)
{
sql = "select top 500 * from ({0}) temp where {1} like '%{2}%' or dbo.P_getpy({1}) like '%{2}%' ";
sqlValue = string.Format(sql + remarkCond + AddConditions,SourceSQL, TextMember, (searchText + "").Replace("[", "[[]"));
}
}
if (Model != null && !string.IsNullOrEmpty(Model.AddOrderByCond))
{