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

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

View File

@ -1,14 +1,41 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
public class PunchlistFromService
{
/// <summary>
/// Turnover System Code下拉框
/// </summary>
/// <param name="projectId">项目id</param>
/// <param name="dropName">下拉框名字</param>
/// <param name="isShowPlease">是否显示请选择</param>
public static void InitTurnoverSystemCodeUnitDropDownList(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease)
{
dropName.DataValueField = "string";
dropName.DataTextField = "string";
dropName.DataSource = GetTurnoverSystemCodeUnitDropDownList(projectId);
dropName.DataBind();
if (isShowPlease)
{
Funs.FineUIPleaseSelect(dropName);
}
}
/// <summary>
/// 获取Turnover System Code下拉框
/// </summary>
/// <param name="projectId">项目id</param>
/// <returns></returns>
public static List<string> GetTurnoverSystemCodeUnitDropDownList(string projectId)
{
var list = (from x in Funs.DB.Transfer_PunchlistFrom
where x.ProjectId == projectId
select x.Sub_Sys_No).Distinct().OrderBy(x => x).ToList();
return list;
}
/// <summary>
/// 责任单位下拉框
@ -18,7 +45,6 @@ namespace BLL
/// <param name="isShowPlease">是否显示请选择</param>
public static void InitActionByUnitDropDownList(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease)
{
var sss = GetActionByUnitDropDownList(projectId);
dropName.DataValueField = "string";
dropName.DataTextField = "string";
dropName.DataSource = GetActionByUnitDropDownList(projectId);

View File

@ -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%"

View File

@ -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>

View File

@ -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";

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 控件。

View File

@ -11,7 +11,7 @@
<FineUIPro DebugMode="true" Theme="Cupertino"/>
<appSettings>
<!--连接字符串-->
<add key="ConnectionString" value="Server=.\SQL2012;Database=SGGLDB_WH;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Connect Timeout=1200"/>
<add key="ConnectionString" value="Server=.;Database=SGGLDB_WH;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Connect Timeout=1200"/>
<!--<add key="ConnectionString" value="Server=.\MSSQLSERVER01;Database=SGGLDB_WH;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Connect Timeout=1200"/>-->
<!--系统名称-->
<add key="SystemName" value="智慧施工管理信息系统V1.0"/>
@ -77,7 +77,7 @@
<add verb="GET" path="res.axd" type="FineUIPro.ResourceHandler, FineUIPro" validate="false"/>
<add path="ChartImg.axd" verb="GET,POST,HEAD" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
<compilation debug="false" targetFramework="4.6.1"/>
<compilation debug="true" targetFramework="4.6.1"/>
<httpRuntime requestValidationMode="2.0" maxRequestLength="2147483647" executionTimeout="36000"/>
<authentication mode="Forms">
<forms loginUrl="Login.aspx" name="PUBLISHERCOOKIE" protection="All" timeout="1440" path="/"/>