using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using BLL; namespace FineUIPro.Web.common { public partial class mainProject : PageBase { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Model.SGGLDB db = Funs.DB; //未遂事故 var wsAccidentList1 = from x in db.Accident_AccidentPersonRecord join y in db.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId where y.AccidentTypeName.Contains("未遂") && x.ProjectId == this.CurrUser.LoginProjectId select x; var wsAccidentList2 = from x in db.Accident_AccidentReportOther join y in db.Sys_Const on x.AccidentTypeId equals y.ConstValue where y.ConstText.Contains("未遂") && x.ProjectId == this.CurrUser.LoginProjectId select x; this.divWS.InnerHtml = (wsAccidentList1.Count() + wsAccidentList2.Count()).ToString(); //隐患整改 var getRectify = db.Check_RectifyNotices.Where(x => x.ProjectId == this.CurrUser.LoginProjectId); this.divYH.InnerHtml = getRectify.Count().ToString(); //安全人工时 int wHours = db.SitePerson_PersonInOutNumber.Where(x => x.ProjectId == this.CurrUser.LoginProjectId).Max(x => x.WorkHours) ?? 0; this.divRGS.InnerHtml = wHours.ToString(); //教育培训 var getTrainRecord = from x in db.EduTrain_TrainRecord where x.ProjectId == this.CurrUser.LoginProjectId select x; this.divPX.InnerHtml = getTrainRecord.Count().ToString(); //质量问题 var inspectionManagements = from x in db.ProcessControl_InspectionManagement where x.ProjectId == this.CurrUser.LoginProjectId select x; this.divZLWT.InnerHtml = inspectionManagements.Count().ToString(); //质量共检数据 this.divZLGJ.InnerHtml = inspectionManagements.Count().ToString(); //验收数据 this.divYS.InnerHtml = inspectionManagements.Count(x => x.IsOnceQualified == true).ToString(); //竣工资料 this.divJGZL.InnerHtml = inspectionManagements.Count(x => x.IsOnceQualified == true).ToString(); //NCR var NCRManagements = from x in db.Comprehensive_NCRManagement where x.ProjectId == this.CurrUser.LoginProjectId select x; this.divNCR.InnerHtml = NCRManagements.Count().ToString(); //变更单 var designChangeOrders = from x in db.Comprehensive_DesignChangeOrder where x.ProjectId == this.CurrUser.LoginProjectId select x; this.divBG.InnerHtml = designChangeOrders.Count().ToString(); //工程量完成情况 string quantityCompletionStr = "