移交管理查询优化,单选条件修改多选查询

This commit is contained in:
2025-02-24 15:36:00 +08:00
parent 062d7bf0fd
commit c3699e594e
6 changed files with 85 additions and 19 deletions
@@ -49,7 +49,7 @@
<f:Panel ID="Panel4" CssClass="blockpanel" runat="server" EnableCollapse="false"
BodyPadding="10px" ShowBorder="true" ShowHeader="false">
<Items>
<f:TabStrip ID="TabStrip1" CssClass="f-tabstrip-theme-simple" Height="650px" ShowBorder="true"
<f:TabStrip ID="TabStrip1" CssClass="f-tabstrip-theme-simple" Height="800px" ShowBorder="true"
TabPosition="Top" MarginBottom="5px" EnableTabCloseMenu="false" runat="server" AutoPostBack="true" OnTabIndexChanged="TabStrip1_TabIndexChanged">
<Tabs>
<f:Tab ID="Tab1" Title="图形" BodyPadding="5px" Layout="Fit" IconFont="Bookmark" runat="server" CssStyle="width:100%"
@@ -22,7 +22,9 @@
<f:Toolbar ID="ToolSearch" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:TextBox runat="server" ID="txtSystem_No" Label="System No" LabelWidth="100px" LabelAlign="Right" Width="180px"></f:TextBox>
<f:TextBox runat="server" ID="txtSub_Sys_No" Label="Turnover System Code" LabelWidth="180px" LabelAlign="Right"></f:TextBox>
<%--<f:TextBox runat="server" ID="txtSub_Sys_No" Label="Turnover System Code" LabelWidth="180px" LabelAlign="Right"></f:TextBox>--%>
<f:DropDownList ID="drpTurnoverSystemCode" runat="server" Label="Turnover System Code" AutoPostBack="true" AutoSelectFirstItem="false" EnableMultiSelect="true" EnableCheckBoxSelect="true" LabelWidth="180px">
</f:DropDownList>
<f:TextBox runat="server" ID="txtRaised_By" Label="Raised By" LabelWidth="90px" LabelAlign="Right" Width="150px"></f:TextBox>
<f:TextBox runat="server" ID="txtDisc" Label="Disc" LabelWidth="40px" LabelAlign="Right" Width="120px"></f:TextBox>
@@ -87,7 +89,7 @@
</f:Toolbar>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:DropDownList ID="ddlAction_By" runat="server" Label="责任单位" AutoPostBack="true" Width="220px" LabelWidth="80px">
<f:DropDownList ID="ddlAction_By" runat="server" Label="责任单位" AutoPostBack="true" AutoSelectFirstItem="false" EnableMultiSelect="true" EnableCheckBoxSelect="true" Width="220px" LabelWidth="80px">
</f:DropDownList>
<%--<f:TextBox runat="server" ID="txtAction_By" Label="责任单位" LabelWidth="80px" LabelAlign="Right" Width="180px"></f:TextBox>--%>
<f:TextBox runat="server" ID="txtPIC" Label="责任人PIC" LabelWidth="90px" LabelAlign="Right" Width="170px"></f:TextBox>
@@ -31,7 +31,8 @@ namespace FineUIPro.Web.Transfer
if (!IsPostBack)
{
GetButtonPower();
BLL.PunchlistFromService.InitActionByUnitDropDownList(this.ddlAction_By, this.CurrUser.LoginProjectId, true);
BLL.PunchlistFromService.InitTurnoverSystemCodeUnitDropDownList(this.drpTurnoverSystemCode, this.CurrUser.LoginProjectId, false);
BLL.PunchlistFromService.InitActionByUnitDropDownList(this.ddlAction_By, this.CurrUser.LoginProjectId, false);
BindGrid();
this.btnNew.OnClientClick = Window1.GetShowReference("PunchlistFromEdit.aspx") + "return false;";
@@ -58,10 +59,25 @@ namespace FineUIPro.Web.Transfer
strSql += " AND System_No like @System_No";
listStr.Add(new SqlParameter("@System_No", "%" + this.txtSystem_No.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.txtSub_Sys_No.Text.Trim()))
//if (!string.IsNullOrEmpty(this.txtSub_Sys_No.Text.Trim()))
//{
// strSql += " AND Sub_Sys_No like @Sub_Sys_No";
// listStr.Add(new SqlParameter("@Sub_Sys_No", "%" + this.txtSub_Sys_No.Text.Trim() + "%"));
//}
if (this.drpTurnoverSystemCode.SelectedItemArray.Count() > 1 || (this.drpTurnoverSystemCode.SelectedValue != BLL.Const._Null && this.drpTurnoverSystemCode.SelectedItemArray.Count() == 1))
{
strSql += " AND Sub_Sys_No like @Sub_Sys_No";
listStr.Add(new SqlParameter("@Sub_Sys_No", "%" + this.txtSub_Sys_No.Text.Trim() + "%"));
strSql += " AND (1=2 ";
int i = 0;
foreach (var item in this.drpTurnoverSystemCode.SelectedValueArray)
{
if (!string.IsNullOrEmpty(item) && item != BLL.Const._Null)
{
strSql += " OR Sub_Sys_No = @Sub_Sys_No" + i.ToString();
listStr.Add(new SqlParameter("@Sub_Sys_No" + i.ToString(), item));
}
i++;
}
strSql += ")";
}
//if (!string.IsNullOrEmpty(txtStartDate_Raised.Text.Trim()))
//{
@@ -123,11 +139,33 @@ namespace FineUIPro.Web.Transfer
// strSql += " AND Action_By = @Action_By";
// listStr.Add(new SqlParameter("@Action_By", txtAction_By.Text.Trim()));
//}
if (ddlAction_By.SelectedValue != BLL.Const._Null)
//if (ddlAction_By.SelectedValue != null && ddlAction_By.SelectedValue != BLL.Const._Null)
//{
// strSql += " AND Action_By = @Action_By";
// listStr.Add(new SqlParameter("@Action_By", ddlAction_By.SelectedValue.Trim()));
//}
if (this.ddlAction_By.SelectedItemArray.Count() > 1 || (this.ddlAction_By.SelectedValue != BLL.Const._Null && this.ddlAction_By.SelectedItemArray.Count() == 1))
{
strSql += " AND Action_By = @Action_By";
listStr.Add(new SqlParameter("@Action_By", ddlAction_By.SelectedValue.Trim()));
strSql += " AND (1=2 ";
int i = 0;
foreach (var item in this.ddlAction_By.SelectedValueArray)
{
if (!string.IsNullOrEmpty(item) && item != BLL.Const._Null)
{
strSql += " OR Action_By = @Action_By" + i.ToString();
listStr.Add(new SqlParameter("@Action_By" + i.ToString(), item));
}
i++;
}
strSql += ")";
}
//if (ddlAction_By.SelectedValue != null && ddlAction_By.SelectedValue != BLL.Const._Null)
//{
// strSql += " AND Action_By = @Action_By";
// listStr.Add(new SqlParameter("@Action_By", ddlAction_By.SelectedValue.Trim()));
//}
if (!string.IsNullOrEmpty(txtPIC.Text.Trim()))
{
strSql += " AND PIC = @PIC";
+2 -2
View File
@@ -69,13 +69,13 @@ namespace FineUIPro.Web.Transfer
protected global::FineUIPro.TextBox txtSystem_No;
/// <summary>
/// txtSub_Sys_No 控件。
/// drpTurnoverSystemCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtSub_Sys_No;
protected global::FineUIPro.DropDownList drpTurnoverSystemCode;
/// <summary>
/// txtRaised_By 控件。