119 lines
4.3 KiB
C#
119 lines
4.3 KiB
C#
using BLL;
|
|
using System;
|
|
using System.Data;
|
|
using System.Linq;
|
|
|
|
namespace FineUIPro.Web.DigData
|
|
{
|
|
public partial class WBSDW : PageBase
|
|
{
|
|
/// <summary>
|
|
/// 加载页面
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
}
|
|
}
|
|
|
|
protected void changeTree(object sender, EventArgs e)
|
|
{
|
|
this.hdWorkPackageCode.Text = this.ucTree.WorkPackageCode;
|
|
//新增UnitId
|
|
//this.UnitId = this.ucTree.UnitId;
|
|
////判断 当有WorkPackageCode的时候单位id为空
|
|
//if (!string.IsNullOrEmpty(this.WorkPackageCode))
|
|
//{
|
|
// this.UnitId = "";
|
|
//}
|
|
// this.BindGrid();
|
|
initControlItem();
|
|
}
|
|
|
|
|
|
protected void ckType_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
this.gpHSSE.Hidden = true;
|
|
this.gpCQMS.Hidden = true;
|
|
this.gpJDGL.Hidden = true;
|
|
this.gpHTGL.Hidden = true;
|
|
this.gpLW.Hidden = true;
|
|
SetData();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 加载工作包
|
|
/// </summary>
|
|
protected void initControlItem()
|
|
{
|
|
var getControlItem = from x in Funs.DB.WBS_ControlItemInit
|
|
where x.WorkPackageCode == this.hdWorkPackageCode.Text
|
|
select x;
|
|
cblControlItem.DataValueField = "ControlItemCode";
|
|
cblControlItem.DataTextField = "ControlItemContent";
|
|
cblControlItem.DataSource = getControlItem;
|
|
cblControlItem.DataBind();
|
|
SetData();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 数据展示
|
|
/// </summary>
|
|
private void SetData()
|
|
{
|
|
string workPackageId = this.hdWorkPackageCode.Text;
|
|
if (workPackageId == "1" || workPackageId == "2")
|
|
{
|
|
workPackageId = "Type" + workPackageId;
|
|
}
|
|
else
|
|
{
|
|
workPackageId="["+ 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 x.WorkPackageId.Contains(workPackageId) && y.States == Const.State_1
|
|
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 x.WorkPackageId.Contains(workPackageId) //&& y.States == Const.State_1
|
|
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;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |