20241017 共检通知单增加单位工程、分部工程、分项工程
This commit is contained in:
@@ -18,11 +18,36 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
//测试阶段,仅hfnbd账号使用
|
||||
if (this.CurrUser.UserId == BLL.Const.hfnbdId)
|
||||
{
|
||||
this.fr1.Hidden = false;
|
||||
this.fr2.Hidden = false;
|
||||
}
|
||||
GetButtonPower();
|
||||
BLL.UnitService.InitUnitByProjectIdUnitTypeDropDownList(drpUnit, this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2, true);//施工分包商
|
||||
BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpCNProfessionalId, true);//专业
|
||||
UserService.InitUserProjectIdUnitTypeDropDownList(this.drpAcceptanceCheckMan, this.CurrUser.LoginProjectId, string.Empty, false);
|
||||
//UserService.InitUserNameProjectIdUnitTypeDropDownList(this.drpAcceptanceCheckMan, this.CurrUser.LoginProjectId, string.Empty, false);
|
||||
|
||||
//单位工程
|
||||
var q = (from x in Funs.DB.WBS_DivisionDivide
|
||||
join y in Funs.DB.WBS_UnitWork on x.UnitWorkId equals y.UnitWorkId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& (y.SuperUnitWork == null || y.SuperUnitWork == "0")
|
||||
select new
|
||||
{
|
||||
y.UnitWorkId,
|
||||
UnitWorkName = y.UnitWorkCode + "-" + y.UnitWorkName
|
||||
}).Distinct().ToList();
|
||||
this.drpUnitWorkId.DataTextField = "UnitWorkName";
|
||||
this.drpUnitWorkId.DataValueField = "UnitWorkId";
|
||||
this.drpUnitWorkId.DataSource = q;
|
||||
this.drpUnitWorkId.DataBind();
|
||||
Funs.FineUIPleaseSelect(this.drpUnitWorkId);
|
||||
Funs.FineUIPleaseSelect(this.drpBranch);
|
||||
Funs.FineUIPleaseSelect(this.drpProEngineering);
|
||||
|
||||
this.hdInspectionNoticeId.Text = Request.Params["inspectionId"];
|
||||
if (!string.IsNullOrEmpty(Request.Params["View"]))
|
||||
{
|
||||
@@ -46,6 +71,79 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
{
|
||||
this.drpAcceptanceCheckMan.SelectedValueArray = inspectionManagement.AcceptanceCheckMan.Split(',');
|
||||
}
|
||||
//单位工程、分部工程、分项工程
|
||||
if (!string.IsNullOrEmpty(inspectionManagement.UnitWorkId))
|
||||
{
|
||||
this.drpUnitWorkId.SelectedValue = inspectionManagement.UnitWorkId;
|
||||
if (!string.IsNullOrEmpty(inspectionManagement.Branch))
|
||||
{
|
||||
//分部工程
|
||||
var a = (from x in Funs.DB.WBS_DivisionDivide
|
||||
join y in Funs.DB.Division_SubProjects on x.DivisionId equals y.DivisionId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.UnitWorkId == this.drpUnitWorkId.SelectedValue
|
||||
&& y.ParentId == null
|
||||
select new
|
||||
{
|
||||
y.DivisionId,
|
||||
y.BranchEngineeringName
|
||||
}).Distinct().ToList();
|
||||
this.drpBranch.DataTextField = "BranchEngineeringName";
|
||||
this.drpBranch.DataValueField = "DivisionId";
|
||||
this.drpBranch.DataSource = a;
|
||||
this.drpBranch.DataBind();
|
||||
Funs.FineUIPleaseSelect(this.drpBranch);
|
||||
this.drpBranch.SelectedIndex = 0;
|
||||
|
||||
this.drpBranch.SelectedValue = inspectionManagement.Branch;
|
||||
|
||||
if (!string.IsNullOrEmpty(inspectionManagement.ControlPointType))
|
||||
{
|
||||
//分项工程
|
||||
var b = (from x in Funs.DB.WBS_DivisionDivide
|
||||
join y in Funs.DB.Division_SubProjects on x.DivisionId equals y.DivisionId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.UnitWorkId == this.drpUnitWorkId.SelectedValue
|
||||
&& y.ParentId == this.drpBranch.SelectedValue
|
||||
&& y.ParentId != null
|
||||
select new
|
||||
{
|
||||
y.DivisionId,
|
||||
y.ProEngineeringName,
|
||||
y.SubBranchEngineeringName
|
||||
}).Distinct().ToList();
|
||||
if (b.Where(w => w.SubBranchEngineeringName == null).Count() > 0)
|
||||
{
|
||||
this.drpProEngineering.DataTextField = "ProEngineeringName";
|
||||
this.drpProEngineering.DataValueField = "DivisionId";
|
||||
this.drpProEngineering.DataSource = b;
|
||||
}
|
||||
else
|
||||
{
|
||||
var c = (from x in Funs.DB.WBS_DivisionDivide
|
||||
join y in Funs.DB.Division_SubProjects on x.DivisionId equals y.DivisionId
|
||||
join z in Funs.DB.Division_SubProjects on y.ParentId equals z.DivisionId
|
||||
join w in Funs.DB.Division_SubProjects on z.ParentId equals w.DivisionId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.UnitWorkId == this.drpUnitWorkId.SelectedValue
|
||||
&& z.ParentId == this.drpBranch.SelectedValue
|
||||
select new
|
||||
{
|
||||
y.DivisionId,
|
||||
y.ProEngineeringName
|
||||
}).Distinct().ToList();
|
||||
this.drpProEngineering.DataTextField = "ProEngineeringName";
|
||||
this.drpProEngineering.DataValueField = "DivisionId";
|
||||
this.drpProEngineering.DataSource = c;
|
||||
}
|
||||
this.drpProEngineering.DataBind();
|
||||
Funs.FineUIPleaseSelect(this.drpProEngineering);
|
||||
this.drpProEngineering.SelectedIndex = 0;
|
||||
|
||||
this.drpProEngineering.SelectedValue = inspectionManagement.ControlPointType;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.txtNoticeCode.Text = inspectionManagement.NoticeCode;
|
||||
this.Grid1.DataSource = BLL.InspectionManagementDetailService.GetInspectionDetails(this.hdInspectionNoticeId.Text.Trim());
|
||||
this.Grid1.DataBind();
|
||||
@@ -58,7 +156,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
if (requestArg.StartsWith("ReloadGrid$"))
|
||||
{
|
||||
this.hdItemsString.Text = requestArg.Substring("ReloadGrid$".Length);
|
||||
Window1_Close(null,null);
|
||||
Window1_Close(null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,7 +170,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.drpUnit.SelectedValue==BLL.Const._Null)
|
||||
if (this.drpUnit.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
Alert.ShowInTop("请先选择施工分包商!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
@@ -112,6 +210,19 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
CheckManIds = CheckManIds.Substring(0, CheckManIds.LastIndexOf(","));
|
||||
}
|
||||
inspectionManagement.AcceptanceCheckMan = CheckManIds;
|
||||
|
||||
if (this.drpUnitWorkId.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
inspectionManagement.UnitWorkId = this.drpUnitWorkId.SelectedValue;
|
||||
}
|
||||
if (this.drpBranch.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
inspectionManagement.Branch = this.drpBranch.SelectedValue;
|
||||
}
|
||||
if (this.drpProEngineering.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
inspectionManagement.ControlPointType = this.drpProEngineering.SelectedValue;
|
||||
}
|
||||
//inspectionManagement.AcceptanceCheckMan = this.txtAcceptanceCheckMan.Text.Trim();
|
||||
if (string.IsNullOrEmpty(Request.Params["inspectionId"]))
|
||||
{
|
||||
@@ -146,7 +257,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
{
|
||||
//编号不能重复
|
||||
var InspectionManagementModel = Funs.DB.ProcessControl_InspectionManagement.FirstOrDefault(x => x.NoticeCode == this.txtNoticeCode.Text.Trim()
|
||||
&& x.InspectionId!= Request.Params["inspectionId"]);
|
||||
&& x.InspectionId != Request.Params["inspectionId"]);
|
||||
if (InspectionManagementModel != null)
|
||||
{
|
||||
ShowNotify("共检通知单编号已存在,不能重复!", MessageBoxIcon.Warning);
|
||||
@@ -192,6 +303,12 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Grid1行内事件
|
||||
/// <summary>
|
||||
/// Grid1行内事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
|
||||
{
|
||||
string itemId = Grid1.DataKeys[e.RowIndex][0].ToString();
|
||||
@@ -210,6 +327,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
Grid1.DataBind();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 搜索
|
||||
/// <summary>
|
||||
@@ -250,7 +368,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
{
|
||||
detail.CreateDate = Convert.ToDateTime(createDate);
|
||||
}
|
||||
|
||||
|
||||
details.Add(detail);
|
||||
}
|
||||
return details;
|
||||
@@ -400,5 +518,88 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
return name;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region DropDownList下拉选择事件
|
||||
/// <summary>
|
||||
/// 单位工程下拉选择事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void drpUnitWorkId_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.drpBranch.Items.Clear();
|
||||
if (this.drpUnitWorkId.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
var q = (from x in Funs.DB.WBS_DivisionDivide
|
||||
join y in Funs.DB.Division_SubProjects on x.DivisionId equals y.DivisionId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.UnitWorkId == this.drpUnitWorkId.SelectedValue
|
||||
&& y.ParentId == null
|
||||
select new
|
||||
{
|
||||
y.DivisionId,
|
||||
y.BranchEngineeringName
|
||||
}).Distinct().ToList();
|
||||
this.drpBranch.DataTextField = "BranchEngineeringName";
|
||||
this.drpBranch.DataValueField = "DivisionId";
|
||||
this.drpBranch.DataSource = q;
|
||||
this.drpBranch.DataBind();
|
||||
Funs.FineUIPleaseSelect(this.drpBranch);
|
||||
}
|
||||
this.drpBranch.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分部工程下拉选择事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void drpBranch_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.drpProEngineering.Items.Clear();
|
||||
if (this.drpBranch.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
var q = (from x in Funs.DB.WBS_DivisionDivide
|
||||
join y in Funs.DB.Division_SubProjects on x.DivisionId equals y.DivisionId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.UnitWorkId == this.drpUnitWorkId.SelectedValue
|
||||
&& y.ParentId == this.drpBranch.SelectedValue
|
||||
&& y.ParentId != null
|
||||
select new
|
||||
{
|
||||
y.DivisionId,
|
||||
y.ProEngineeringName,
|
||||
y.SubBranchEngineeringName
|
||||
}).Distinct().ToList();
|
||||
if (q.Where(w => w.SubBranchEngineeringName == null).Count() > 0)
|
||||
{
|
||||
this.drpProEngineering.DataTextField = "ProEngineeringName";
|
||||
this.drpProEngineering.DataValueField = "DivisionId";
|
||||
this.drpProEngineering.DataSource = q;
|
||||
}
|
||||
else
|
||||
{
|
||||
var a = (from x in Funs.DB.WBS_DivisionDivide
|
||||
join y in Funs.DB.Division_SubProjects on x.DivisionId equals y.DivisionId
|
||||
join z in Funs.DB.Division_SubProjects on y.ParentId equals z.DivisionId
|
||||
join w in Funs.DB.Division_SubProjects on z.ParentId equals w.DivisionId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.UnitWorkId == this.drpUnitWorkId.SelectedValue
|
||||
&& z.ParentId == this.drpBranch.SelectedValue
|
||||
select new
|
||||
{
|
||||
y.DivisionId,
|
||||
y.ProEngineeringName
|
||||
}).Distinct().ToList();
|
||||
this.drpProEngineering.DataTextField = "ProEngineeringName";
|
||||
this.drpProEngineering.DataValueField = "DivisionId";
|
||||
this.drpProEngineering.DataSource = a;
|
||||
}
|
||||
this.drpProEngineering.DataBind();
|
||||
Funs.FineUIPleaseSelect(this.drpProEngineering);
|
||||
}
|
||||
this.drpProEngineering.SelectedIndex = 0;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user