提交代码

This commit is contained in:
高飞 2025-03-20 14:39:47 +08:00
parent 34b53e8ebb
commit ed56cc00df
3 changed files with 86 additions and 15 deletions

View File

@ -100,6 +100,45 @@ namespace BLL
}
}
/// <summary>
/// 部位下拉框
/// </summary>
/// <param name="dropName">下拉框名字</param>
/// <param name="isShowPlease">是否显示请选择</param>
public static void InitAllPartDropDownList(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease)
{
dropName.DataValueField = "Value";
dropName.DataTextField = "Text";
dropName.DataSource = GetAllPartListByProjectId(projectId);
dropName.DataBind();
if (isShowPlease)
{
Funs.FineUIPleaseSelect(dropName);
}
}
/// <summary>
/// 根据图纸Id获取部位下拉选择项
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
public static ListItem[] GetAllPartListByProjectId(string projectId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var q = (from x in db.QuantityManagement_Base
where x.ProjectId == projectId && x.State == BLL.Const.Base_Complete
orderby x.Part
select x.Part).Distinct().ToList();
ListItem[] list = new ListItem[q.Count()];
for (int i = 0; i < list.Count(); i++)
{
list[i] = new ListItem(q[i] ?? "", q[i]);
}
return list;
}
}
/// <summary>
/// 根据图纸Id获取部位下拉选择项
/// </summary>
@ -139,6 +178,39 @@ namespace BLL
}
}
/// <summary>
/// 项目内容下拉框
/// </summary>
/// <param name="dropName">下拉框名字</param>
/// <param name="isShowPlease">是否显示请选择</param>
public static void InitAllProjectContentDropDownList(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease)
{
dropName.DataValueField = "BaseId";
dropName.DataTextField = "ProjectContent";
dropName.DataSource = GetAllProjectContentListByProjectId(projectId);
dropName.DataBind();
if (isShowPlease)
{
Funs.FineUIPleaseSelect(dropName);
}
}
/// <summary>
/// 根据项目Id获取项目内容下拉选择项
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
public static List<Model.QuantityManagement_Base> GetAllProjectContentListByProjectId(string projectId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
return (from x in db.QuantityManagement_Base
where x.ProjectId == projectId && x.State == BLL.Const.Base_Complete
orderby x.ProjectContent
select x).ToList();
}
}
/// <summary>
/// 根据图纸Id和部位获取项目内容下拉选择项
/// </summary>

View File

@ -25,13 +25,13 @@
<f:DropDownList ID="drpProject" runat="server" Label="项目" Width="300px" LabelWidth="60px" EmptyText="请选择项目"
EnableEdit="true">
</f:DropDownList>
<f:DropDownList ID="drpWorkSection" OnSelectedIndexChanged="drpWorkSection_SelectedIndexChanged" AutoPostBack="true" runat="server" LabelWidth="120px" Required="true" Label="工段" LabelAlign="Right" EnableEdit="true">
<f:DropDownList ID="drpWorkSection" runat="server" LabelWidth="120px" Required="true" Label="工段" LabelAlign="Right" EnableEdit="true">
</f:DropDownList>
<f:DropDownList ID="drpDrawingNo" OnSelectedIndexChanged="drpDrawingNo_SelectedIndexChanged" AutoPostBack="true" runat="server" LabelWidth="120px" Required="true" Label="图号" LabelAlign="Right" EnableEdit="true">
<f:DropDownList ID="drpDrawingNo" runat="server" LabelWidth="120px" Required="true" Label="图号" LabelAlign="Right" EnableEdit="true">
</f:DropDownList>
<f:DropDownList ID="drpMajor" runat="server" LabelWidth="140px" Required="true" Label="专业" LabelAlign="Right" EnableEdit="true">
</f:DropDownList>
<f:DropDownList ID="drpPart" OnSelectedIndexChanged="drpPart_SelectedIndexChanged" AutoPostBack="true" runat="server" LabelWidth="120px" Required="true" Label="部位" LabelAlign="Right" EnableEdit="true">
<f:DropDownList ID="drpPart" runat="server" LabelWidth="120px" Required="true" Label="部位" LabelAlign="Right" EnableEdit="true">
</f:DropDownList>
<f:DropDownList ID="drpProjectContent" runat="server" LabelWidth="120px" Required="true" Label="项目内容" LabelAlign="Right" EnableEdit="true">
</f:DropDownList>

View File

@ -110,21 +110,25 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
{
if (!IsPostBack)
{
BLL.DrawingService.InitWorkSectionDropDownList(drpWorkSection, this.CurrUser.LoginProjectId, true);
string projectId = this.CurrUser.LoginProjectId;
if (!string.IsNullOrEmpty(Request.Params["ProjectId"]))
{
this.drpProject.SelectedValue = Request.Params["ProjectId"];
projectId = Request.Params["ProjectId"];
}
BLL.DrawingService.InitWorkSectionDropDownList(drpWorkSection, projectId, true);
BLL.DrawingService.InitDrawingChangeDropDownList(drpDrawingNo, projectId, true);
BLL.CNProfessionalService.InitCNProfessionalDownList(drpMajor, true);
BLL.TeamGroupService.InitTeamGroupProjectDropDownList(drpWorkTeam, this.CurrUser.LoginProjectId, true);
Funs.FineUIPleaseSelect(this.drpDrawingNo);
Funs.FineUIPleaseSelect(this.drpPart);
Funs.FineUIPleaseSelect(this.drpProjectContent);
BLL.BaseService.InitAllPartDropDownList(this.drpPart, projectId, true);
BLL.BaseService.InitAllProjectContentDropDownList(this.drpProjectContent, projectId, true);
BLL.TeamGroupService.InitTeamGroupProjectDropDownList(drpWorkTeam, projectId, true);
if (!string.IsNullOrEmpty(Request.Params["WorkSection"]))
{
this.drpWorkSection.SelectedValue = Request.Params["WorkSection"];
BLL.DrawingService.InitDrawingChangeDropDownList2(drpDrawingNo, this.CurrUser.LoginProjectId, Request.Params["WorkSection"], true);
}
if (!string.IsNullOrEmpty(Request.Params["DrawingId"]))
{
this.drpDrawingNo.SelectedValue = Request.Params["DrawingId"];
BLL.BaseService.InitPartDropDownList(this.drpPart, Request.Params["DrawingId"], true);
}
if (!string.IsNullOrEmpty(Request.Params["Major"]))
{
@ -133,7 +137,6 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
if (!string.IsNullOrEmpty(Request.Params["Part"]))
{
this.drpPart.SelectedValue = Request.Params["Part"];
BLL.BaseService.InitProjectContentDropDownList(this.drpProjectContent, this.drpDrawingNo.SelectedValue, this.drpPart.SelectedValue, true);
}
if (!string.IsNullOrEmpty(Request.Params["ProjectContent"]))
{
@ -150,10 +153,6 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
this.drpProject.Enabled = false;
this.drpProject.Hidden = true;
}
if (!string.IsNullOrEmpty(Request.Params["ProjectId"]))
{
this.drpProject.SelectedValue = Request.Params["ProjectId"];
}
GetButtonPower();
BindGrid();
}