20230831 WBS
This commit is contained in:
@@ -1,27 +1,15 @@
|
||||
using BLL;
|
||||
using FineUIPro.Web.CQMS.WBS;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.DigData
|
||||
{
|
||||
public partial class ProjectWBSDW : PageBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string WorkPackageId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["WorkPackageId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["WorkPackageId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 项目ID
|
||||
/// </summary>
|
||||
@@ -50,23 +38,21 @@ namespace FineUIPro.Web.DigData
|
||||
////权限按钮方法
|
||||
// this.ucTree.WorkPackageCode = this.WorkPackageCode;
|
||||
this.ucTree.ProjectId = this.ProjectId;
|
||||
|
||||
this.btnNew.OnClientClick = Window1.GetShowReference("ShowProjectWBS.aspx") + "return false;";
|
||||
this.btnNew.OnClientClick = Window1.GetShowReference("ShowProjectWBSPackage.aspx") + "return false;";
|
||||
}
|
||||
}
|
||||
|
||||
protected void changeTree(object sender, EventArgs e)
|
||||
{
|
||||
this.WorkPackageId = this.ucTree.WorkPackageId;
|
||||
this.hdWorkPackageId.Text = this.ucTree.WorkPackageId;
|
||||
initControlItem();
|
||||
}
|
||||
protected void changeTree2(object sender, EventArgs e)
|
||||
{
|
||||
string a = this.ucTree.WorkPackageId;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ckType_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.gpHSSE.Hidden = true;
|
||||
@@ -74,29 +60,7 @@ namespace FineUIPro.Web.DigData
|
||||
this.gpJDGL.Hidden = true;
|
||||
this.gpHTGL.Hidden = true;
|
||||
this.gpLW.Hidden = true;
|
||||
foreach (var item in this.ckType.SelectedValueArray)
|
||||
{
|
||||
if (item == "HSSE")
|
||||
{
|
||||
this.gpHSSE.Hidden = false;
|
||||
}
|
||||
if (item == "CQMS")
|
||||
{
|
||||
this.gpCQMS.Hidden = false;
|
||||
}
|
||||
if (item == "JDGL")
|
||||
{
|
||||
this.gpJDGL.Hidden = false;
|
||||
}
|
||||
if (item == "HTGL")
|
||||
{
|
||||
this.gpHTGL.Hidden = false;
|
||||
}
|
||||
if (item == "LW")
|
||||
{
|
||||
this.gpLW.Hidden = false;
|
||||
}
|
||||
}
|
||||
SetData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -104,11 +68,80 @@ namespace FineUIPro.Web.DigData
|
||||
/// </summary>
|
||||
protected void initControlItem()
|
||||
{
|
||||
var getControlItem = from x in Funs.DB.WBS_ControlItemAndCycle where x.WorkPackageId == this.WorkPackageId select x;
|
||||
cblControlItem.DataValueField = "ControlItemCode";
|
||||
var getControlItem = from x in Funs.DB.WBS_ControlItemAndCycle
|
||||
where x.WorkPackageId == this.hdWorkPackageId.Text
|
||||
select x;
|
||||
cblControlItem.DataValueField = "ControlItemAndCycleId";
|
||||
cblControlItem.DataTextField = "ControlItemContent";
|
||||
cblControlItem.DataSource = getControlItem;
|
||||
cblControlItem.DataBind();
|
||||
cblControlItem.DataBind();
|
||||
SetData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void cblControlItem_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
SetData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 数据展示
|
||||
/// </summary>
|
||||
private void SetData()
|
||||
{
|
||||
string workPackageId = this.hdWorkPackageId.Text;
|
||||
string controlItemAndCycleId = this.cblControlItem.SelectedValue;
|
||||
if (workPackageId == "1" || workPackageId == "2")
|
||||
{
|
||||
workPackageId = "Type" + workPackageId;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(workPackageId))
|
||||
{
|
||||
foreach (var item in this.ckType.SelectedValueArray)
|
||||
{
|
||||
if (item == "HSSE")
|
||||
{
|
||||
this.gpHSSE.Hidden = false;
|
||||
this.lbExpertArgument.Text = (from x in Funs.DB.Solution_LargerHazardListItem
|
||||
join y in Funs.DB.Solution_LargerHazardList on x.LargerHazardListId equals y.LargerHazardListId
|
||||
where y.ProjectId == this.ProjectId && x.WorkPackageId.Contains(workPackageId) && y.States == Const.State_1
|
||||
&& (controlItemAndCycleId == null || x.WorkPackageId.Contains(controlItemAndCycleId))
|
||||
select x).Count().ToString();
|
||||
}
|
||||
if (item == "CQMS")
|
||||
{
|
||||
this.gpCQMS.Hidden = false;
|
||||
var getDetail = from x in Funs.DB.Check_SpotCheckDetail
|
||||
join y in Funs.DB.Check_SpotCheck on x.SpotCheckCode equals y.SpotCheckCode
|
||||
where y.ProjectId == this.ProjectId && x.WorkPackageId.Contains(workPackageId) //&& y.States == Const.State_1
|
||||
&& (controlItemAndCycleId == null || x.WorkPackageId.Contains(controlItemAndCycleId))
|
||||
select x;
|
||||
int all = getDetail.Count();
|
||||
this.lbSpotCheck1.Text = all.ToString();
|
||||
|
||||
int okCount = getDetail.Where(x => x.IsOK == true).Count();
|
||||
this.lbSpotCheck2.Text= okCount.ToString();
|
||||
|
||||
this.lbSpotCheck.Text= all > 0 ? Math.Round(okCount * 1.0 / (all * 1.0)).ToString() : "0";
|
||||
}
|
||||
if (item == "JDGL")
|
||||
{
|
||||
this.gpJDGL.Hidden = false;
|
||||
}
|
||||
if (item == "HTGL")
|
||||
{
|
||||
this.gpHTGL.Hidden = false;
|
||||
}
|
||||
if (item == "LW")
|
||||
{
|
||||
this.gpLW.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user