Files
xinjiang/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/SafetyManagementData.aspx.cs
T

723 lines
36 KiB
C#
Raw Normal View History

2026-09-07 15:06:45 +08:00
using BLL;
2026-09-16 15:32:11 +08:00
using Newtonsoft.Json.Linq;
2026-09-07 15:06:45 +08:00
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.ReportManage.SafeEnvBudget
{
public partial class SafetyManagementData : PageBase
{
#region
2026-09-16 15:32:11 +08:00
///// <summary>
///// 项目id
///// </summary>
//public string ProjectId
//{
// get
// {
// return (string)ViewState["ProjectId"];
// }
// set
// {
// ViewState["ProjectId"] = value;
// }
//}
2026-09-07 15:06:45 +08:00
#endregion
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
2026-09-16 15:32:11 +08:00
this.txtStartTime.Text = string.Format("{0:yyyy-MM}", DateTime.Now);
2026-09-07 15:06:45 +08:00
Funs.DropDownPageSize(this.ddlPageSize);
2026-09-16 15:32:11 +08:00
///单位
UnitService.InitBranchUnitDropDownList(this.drpUnitId, true, true);
if (!string.IsNullOrWhiteSpace(this.CurrUser.UnitId) && this.CurrUser.Base_Unit.IsBranch == true)
{//分公司只能查看本分公司填报数据
this.drpUnitId.SelectedValue = this.CurrUser.UnitId;
this.drpUnitId.Readonly = true;
2026-09-07 15:06:45 +08:00
}
2026-09-16 15:32:11 +08:00
//this.ProjectId = this.CurrUser.LoginProjectId;
//if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.ProjectId)
//{
// this.ProjectId = Request.Params["projectId"];
//}
2026-09-07 15:06:45 +08:00
////权限按钮方法
this.GetButtonPower();
btnNew.OnClientClick = Window1.GetShowReference("SafetyManagementDataEdit.aspx") + "return false;";
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
// 绑定表格
BindGrid();
}
}
private DataTable GetSourceDataTable()
{
string strSql = @" select s.DataId,
s.ProjectId,
s.UnitId,
s.ReportDate,
s.ConAndEPCCount,
s.SurveyAndDesignCount,
s.WorkingHours,
s.SafeDrivingMileage,
s.SubSupervise_InspectionItems,
s.SubSupervise_Inspections,
s.SubSupervise_HSE_Total,
s.SubSupervise_HSE_Larger,
s.SubSupervise_HSE_Generally,
s.SubSupervise_HSE_Slight,
s.SubSupervise_Quality_Total,
s.SubSupervise_Quality_Larger,
s.SubSupervise_Quality_Generally,
s.SubSupervise_Quality_Slight,
s.SubVideo_InspectionItems,
s.SubVideo_InspectionsMin,
s.SubVideo_HSE_Total,
s.SubVideo_HSE_Larger,
s.SubVideo_HSE_Generally,
s.SubVideo_HSE_Slight,
s.SubVideo_Quality_Total,
s.SubVideo_Quality_Larger,
s.SubVideo_Quality_Generally,
s.SubVideo_Quality_Slight,
s.HQ_InspectionItems,
s.HQ_Inspections,
s.HQ_HSE_Total,
s.HQ_HSE_Larger,
s.HQ_HSE_Generally,
s.HQ_HSE_Slight,
s.HQ_Quality_Total,
s.HQ_Quality_Larger,
s.HQ_Quality_Generally,
s.HQ_Quality_Slight,
s.Quality_Employee_Count,
s.Quality_Employee_Score,
s.Quality_Contractor_Count,
s.Quality_Contractor_Score,
s.Quality_Employee_Fine,
s.Quality_Employee_FineAmount,
s.Quality_Contractor_Fine,
s.Quality_Contractor_FineAmount,
s.Quality_Contractor_Deduction,
s.Quality_Contractor_DeductionAmount,
s.Quality_ProjectDepartment_Fine,
s.Quality_ProjectDepartment_FineAmount,
s.HSE_Employee_Count,
s.HSE_Employee_Score,
s.HSE_Contractor_Count,
s.HSE_Contractor_Score,
s.HSE_Employee_Fine,
s.HSE_Employee_FineAmount,
s.HSE_Contractor_Fine,
s.HSE_Contractor_FineAmount,
s.HSE_Contractor_Deduction,
s.HSE_Contractor_DeductionAmount,
s.HSE_ProjectDepartment_Fine,
s.HSE_ProjectDepartment_FineAmount,
s.LeaderSupervision_HSECheck_Leaders,
s.LeaderSupervision_HSECheck_Count,
s.LeaderSupervision_HSECheck_Hazards,
s.LeaderSupervision_SafetyLectures_Leaders,
s.LeaderSupervision_SafetyLectures_Count,
s.LeaderSupervision_SafetyLectures_Attendees,
s.LeaderSupervision_Activities_Leaders,
s.LeaderSupervision_Activities_Count,
s.HSEMeasures_OfficesCount,
s.HSEMeasures_TrainingBooths,
s.HSEMeasures_Toolboxs,
s.HSEMeasures_Consultant_Projects,
s.HSEMeasures_Consultant_Count,
s.HSEMeasures_FiveStar_Star2,
s.HSEMeasures_FiveStar_Star3,
s.HSEMeasures_FiveStar_Star4,
s.HSEMeasures_FiveStar_Star5,
s.HSEMeasures_Contractor_Interviewees,
s.HSEMeasures_PilotProject_Headquarters,
s.HSEMeasures_PilotProject_Branch,
s.Construction_Teams_Totals,
s.Construction_Teams_Compliant,
s.Construction_ModelTeams_Headquarters,
s.Construction_ModelTeams_CPECC,
s.Construction_ModelTeams_Group,
s.HSETraining_ThreeCategory,
s.HSETraining_TrainingPersons,
s.HSETraining_ContractorTraining,
s.CompileMan,
s.CompileDate,
u.UnitName
from SafetyManagementData as s
2026-09-16 15:32:11 +08:00
left join Base_Unit as u on u.UnitId = s.UnitId where 1=1 ";// s.ProjectId=@projectId
2026-09-07 15:06:45 +08:00
List<SqlParameter> listStr = new List<SqlParameter>();
2026-09-16 15:32:11 +08:00
//listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId));
//if (!string.IsNullOrWhiteSpace(this.CurrUser.UnitId) && this.CurrUser.Base_Unit.IsBranch == true)
//{//分公司人员只能看本分公司单位填报数据
// string unitId = this.CurrUser.UnitId;
// strSql += " AND s.UnitId=@UnitId";
// listStr.Add(new SqlParameter("@UnitId", unitId));
//}
if (!string.IsNullOrEmpty(this.drpUnitId.SelectedValue) && this.drpUnitId.SelectedValue != Const._Null)
{
strSql += " AND s.UnitId=@UnitId";
listStr.Add(new SqlParameter("@UnitId", this.drpUnitId.SelectedValue));
}
2026-09-07 15:06:45 +08:00
if (!string.IsNullOrEmpty(this.txtStartTime.Text.Trim()))
{
strSql += " AND s.ReportDate >= @StartTime";
listStr.Add(new SqlParameter("@StartTime", Funs.GetNewDateTime(this.txtStartTime.Text.Trim())));
}
if (!string.IsNullOrEmpty(this.txtEndTime.Text.Trim()))
{
strSql += " AND s.ReportDate <= @EndTime";
listStr.Add(new SqlParameter("@EndTime", Funs.GetNewDateTime(this.txtEndTime.Text.Trim())));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
return tb;
}
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
DataTable tb = GetSourceDataTable();
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
2026-09-16 15:32:11 +08:00
JObject summary = new JObject();
int ConAndEPCCount = 0;
int SurveyAndDesignCount = 0;
int WorkingHours = 0;
int SafeDrivingMileage = 0;
int SubSupervise_InspectionItems = 0;
int SubSupervise_Inspections = 0;
int SubSupervise_HSE_Total = 0;
int SubSupervise_HSE_Larger = 0;
int SubSupervise_HSE_Generally = 0;
int SubSupervise_HSE_Slight = 0;
int SubSupervise_Quality_Total = 0;
int SubSupervise_Quality_Larger = 0;
int SubSupervise_Quality_Generally = 0;
int SubSupervise_Quality_Slight = 0;
int SubVideo_InspectionItems = 0;
int SubVideo_InspectionsMin = 0;
int SubVideo_HSE_Total = 0;
int SubVideo_HSE_Larger = 0;
int SubVideo_HSE_Generally = 0;
int SubVideo_HSE_Slight = 0;
int SubVideo_Quality_Total = 0;
int SubVideo_Quality_Larger = 0;
int SubVideo_Quality_Generally = 0;
int SubVideo_Quality_Slight = 0;
int HQ_InspectionItems = 0;
int HQ_Inspections = 0;
int HQ_HSE_Total = 0;
int HQ_HSE_Larger = 0;
int HQ_HSE_Generally = 0;
int HQ_HSE_Slight = 0;
int HQ_Quality_Total = 0;
int HQ_Quality_Larger = 0;
int HQ_Quality_Generally = 0;
int HQ_Quality_Slight = 0;
int Quality_Employee_Count = 0;
int Quality_Employee_Score = 0;
int Quality_Contractor_Count = 0;
int Quality_Contractor_Score = 0;
int Quality_Employee_Fine = 0;
int Quality_Employee_FineAmount = 0;
int Quality_Contractor_Fine = 0;
int Quality_Contractor_FineAmount = 0;
int Quality_Contractor_Deduction = 0;
int Quality_Contractor_DeductionAmount = 0;
int Quality_ProjectDepartment_Fine = 0;
int Quality_ProjectDepartment_FineAmount = 0;
int HSE_Employee_Count = 0;
int HSE_Employee_Score = 0;
int HSE_Contractor_Count = 0;
int HSE_Contractor_Score = 0;
int HSE_Employee_Fine = 0;
int HSE_Employee_FineAmount = 0;
int HSE_Contractor_Fine = 0;
int HSE_Contractor_FineAmount = 0;
int HSE_Contractor_Deduction = 0;
int HSE_Contractor_DeductionAmount = 0;
int HSE_ProjectDepartment_Fine = 0;
int HSE_ProjectDepartment_FineAmount = 0;
int LeaderSupervision_HSECheck_Leaders = 0;
int LeaderSupervision_HSECheck_Count = 0;
int LeaderSupervision_HSECheck_Hazards = 0;
int LeaderSupervision_SafetyLectures_Leaders = 0;
int LeaderSupervision_SafetyLectures_Count = 0;
int LeaderSupervision_SafetyLectures_Attendees = 0;
int LeaderSupervision_Activities_Leaders = 0;
int LeaderSupervision_Activities_Count = 0;
int HSEMeasures_OfficesCount = 0;
int HSEMeasures_TrainingBooths = 0;
int HSEMeasures_Toolboxs = 0;
int HSEMeasures_Consultant_Projects = 0;
int HSEMeasures_Consultant_Count = 0;
int HSEMeasures_FiveStar_Star2 = 0;
int HSEMeasures_FiveStar_Star3 = 0;
int HSEMeasures_FiveStar_Star4 = 0;
int HSEMeasures_FiveStar_Star5 = 0;
int HSEMeasures_Contractor_Interviewees = 0;
int HSEMeasures_PilotProject_Headquarters = 0;
int HSEMeasures_PilotProject_Branch = 0;
int Construction_Teams_Totals = 0;
int Construction_Teams_Compliant = 0;
int Construction_ModelTeams_Headquarters = 0;
int Construction_ModelTeams_CPECC = 0;
int Construction_ModelTeams_Group = 0;
int HSETraining_ThreeCategory = 0;
int HSETraining_TrainingPersons = 0;
int HSETraining_ContractorTraining = 0;
foreach (DataRow row in tb.Rows)
{
ConAndEPCCount += Funs.GetNewIntOrZero(row["ConAndEPCCount"].ToString());
SurveyAndDesignCount += Funs.GetNewIntOrZero(row["SurveyAndDesignCount"].ToString());
WorkingHours += Funs.GetNewIntOrZero(row["WorkingHours"].ToString());
SafeDrivingMileage += Funs.GetNewIntOrZero(row["SafeDrivingMileage"].ToString());
SubSupervise_InspectionItems += Funs.GetNewIntOrZero(row["SubSupervise_InspectionItems"].ToString());
SubSupervise_Inspections += Funs.GetNewIntOrZero(row["SubSupervise_Inspections"].ToString());
SubSupervise_HSE_Total += Funs.GetNewIntOrZero(row["SubSupervise_HSE_Total"].ToString());
SubSupervise_HSE_Larger += Funs.GetNewIntOrZero(row["SubSupervise_HSE_Larger"].ToString());
SubSupervise_HSE_Generally += Funs.GetNewIntOrZero(row["SubSupervise_HSE_Generally"].ToString());
SubSupervise_HSE_Slight += Funs.GetNewIntOrZero(row["SubSupervise_HSE_Slight"].ToString());
SubSupervise_Quality_Total += Funs.GetNewIntOrZero(row["SubSupervise_Quality_Total"].ToString());
SubSupervise_Quality_Larger += Funs.GetNewIntOrZero(row["SubSupervise_Quality_Larger"].ToString());
SubSupervise_Quality_Generally += Funs.GetNewIntOrZero(row["SubSupervise_Quality_Generally"].ToString());
SubSupervise_Quality_Slight += Funs.GetNewIntOrZero(row["SubSupervise_Quality_Slight"].ToString());
SubVideo_InspectionItems += Funs.GetNewIntOrZero(row["SubVideo_InspectionItems"].ToString());
SubVideo_InspectionsMin += Funs.GetNewIntOrZero(row["SubVideo_InspectionsMin"].ToString());
SubVideo_HSE_Total += Funs.GetNewIntOrZero(row["SubVideo_HSE_Total"].ToString());
SubVideo_HSE_Larger += Funs.GetNewIntOrZero(row["SubVideo_HSE_Larger"].ToString());
SubVideo_HSE_Generally += Funs.GetNewIntOrZero(row["SubVideo_HSE_Generally"].ToString());
SubVideo_HSE_Slight += Funs.GetNewIntOrZero(row["SubVideo_HSE_Slight"].ToString());
SubVideo_Quality_Total += Funs.GetNewIntOrZero(row["SubVideo_Quality_Total"].ToString());
SubVideo_Quality_Larger += Funs.GetNewIntOrZero(row["SubVideo_Quality_Larger"].ToString());
SubVideo_Quality_Generally += Funs.GetNewIntOrZero(row["SubVideo_Quality_Generally"].ToString());
SubVideo_Quality_Slight += Funs.GetNewIntOrZero(row["SubVideo_Quality_Slight"].ToString());
HQ_InspectionItems += Funs.GetNewIntOrZero(row["HQ_InspectionItems"].ToString());
HQ_Inspections += Funs.GetNewIntOrZero(row["HQ_Inspections"].ToString());
HQ_HSE_Total += Funs.GetNewIntOrZero(row["HQ_HSE_Total"].ToString());
HQ_HSE_Larger += Funs.GetNewIntOrZero(row["HQ_HSE_Larger"].ToString());
HQ_HSE_Generally += Funs.GetNewIntOrZero(row["HQ_HSE_Generally"].ToString());
HQ_HSE_Slight += Funs.GetNewIntOrZero(row["HQ_HSE_Slight"].ToString());
HQ_Quality_Total += Funs.GetNewIntOrZero(row["HQ_Quality_Total"].ToString());
HQ_Quality_Larger += Funs.GetNewIntOrZero(row["HQ_Quality_Larger"].ToString());
HQ_Quality_Generally += Funs.GetNewIntOrZero(row["HQ_Quality_Generally"].ToString());
HQ_Quality_Slight += Funs.GetNewIntOrZero(row["HQ_Quality_Slight"].ToString());
Quality_Employee_Count += Funs.GetNewIntOrZero(row["Quality_Employee_Count"].ToString());
Quality_Employee_Score += Funs.GetNewIntOrZero(row["Quality_Employee_Score"].ToString());
Quality_Contractor_Count += Funs.GetNewIntOrZero(row["Quality_Contractor_Count"].ToString());
Quality_Contractor_Score += Funs.GetNewIntOrZero(row["Quality_Contractor_Score"].ToString());
Quality_Employee_Fine += Funs.GetNewIntOrZero(row["Quality_Employee_Fine"].ToString());
Quality_Employee_FineAmount += Funs.GetNewIntOrZero(row["Quality_Employee_FineAmount"].ToString());
Quality_Contractor_Fine += Funs.GetNewIntOrZero(row["Quality_Contractor_Fine"].ToString());
Quality_Contractor_FineAmount += Funs.GetNewIntOrZero(row["Quality_Contractor_FineAmount"].ToString());
Quality_Contractor_Deduction += Funs.GetNewIntOrZero(row["Quality_Contractor_Deduction"].ToString());
Quality_Contractor_DeductionAmount += Funs.GetNewIntOrZero(row["Quality_Contractor_DeductionAmount"].ToString());
Quality_ProjectDepartment_Fine += Funs.GetNewIntOrZero(row["Quality_ProjectDepartment_Fine"].ToString());
Quality_ProjectDepartment_FineAmount += Funs.GetNewIntOrZero(row["Quality_ProjectDepartment_FineAmount"].ToString());
HSE_Employee_Count += Funs.GetNewIntOrZero(row["HSE_Employee_Count"].ToString());
HSE_Employee_Score += Funs.GetNewIntOrZero(row["HSE_Employee_Score"].ToString());
HSE_Contractor_Count += Funs.GetNewIntOrZero(row["HSE_Contractor_Count"].ToString());
HSE_Contractor_Score += Funs.GetNewIntOrZero(row["HSE_Contractor_Score"].ToString());
HSE_Employee_Fine += Funs.GetNewIntOrZero(row["HSE_Employee_Fine"].ToString());
HSE_Employee_FineAmount += Funs.GetNewIntOrZero(row["HSE_Employee_FineAmount"].ToString());
HSE_Contractor_Fine += Funs.GetNewIntOrZero(row["HSE_Contractor_Fine"].ToString());
HSE_Contractor_FineAmount += Funs.GetNewIntOrZero(row["HSE_Contractor_FineAmount"].ToString());
HSE_Contractor_Deduction += Funs.GetNewIntOrZero(row["HSE_Contractor_Deduction"].ToString());
HSE_Contractor_DeductionAmount += Funs.GetNewIntOrZero(row["HSE_Contractor_DeductionAmount"].ToString());
HSE_ProjectDepartment_Fine += Funs.GetNewIntOrZero(row["HSE_ProjectDepartment_Fine"].ToString());
HSE_ProjectDepartment_FineAmount += Funs.GetNewIntOrZero(row["HSE_ProjectDepartment_FineAmount"].ToString());
LeaderSupervision_HSECheck_Leaders += Funs.GetNewIntOrZero(row["LeaderSupervision_HSECheck_Leaders"].ToString());
LeaderSupervision_HSECheck_Count += Funs.GetNewIntOrZero(row["LeaderSupervision_HSECheck_Count"].ToString());
LeaderSupervision_HSECheck_Hazards += Funs.GetNewIntOrZero(row["LeaderSupervision_HSECheck_Hazards"].ToString());
LeaderSupervision_SafetyLectures_Leaders += Funs.GetNewIntOrZero(row["LeaderSupervision_SafetyLectures_Leaders"].ToString());
LeaderSupervision_SafetyLectures_Count += Funs.GetNewIntOrZero(row["LeaderSupervision_SafetyLectures_Count"].ToString());
LeaderSupervision_SafetyLectures_Attendees += Funs.GetNewIntOrZero(row["LeaderSupervision_SafetyLectures_Attendees"].ToString());
LeaderSupervision_Activities_Leaders += Funs.GetNewIntOrZero(row["LeaderSupervision_Activities_Leaders"].ToString());
LeaderSupervision_Activities_Count += Funs.GetNewIntOrZero(row["LeaderSupervision_Activities_Count"].ToString());
HSEMeasures_OfficesCount += Funs.GetNewIntOrZero(row["HSEMeasures_OfficesCount"].ToString());
HSEMeasures_TrainingBooths += Funs.GetNewIntOrZero(row["HSEMeasures_TrainingBooths"].ToString());
HSEMeasures_Toolboxs += Funs.GetNewIntOrZero(row["HSEMeasures_Toolboxs"].ToString());
HSEMeasures_Consultant_Projects += Funs.GetNewIntOrZero(row["HSEMeasures_Consultant_Projects"].ToString());
HSEMeasures_Consultant_Count += Funs.GetNewIntOrZero(row["HSEMeasures_Consultant_Count"].ToString());
HSEMeasures_FiveStar_Star2 += Funs.GetNewIntOrZero(row["HSEMeasures_FiveStar_Star2"].ToString());
HSEMeasures_FiveStar_Star3 += Funs.GetNewIntOrZero(row["HSEMeasures_FiveStar_Star3"].ToString());
HSEMeasures_FiveStar_Star4 += Funs.GetNewIntOrZero(row["HSEMeasures_FiveStar_Star4"].ToString());
HSEMeasures_FiveStar_Star5 += Funs.GetNewIntOrZero(row["HSEMeasures_FiveStar_Star5"].ToString());
HSEMeasures_Contractor_Interviewees += Funs.GetNewIntOrZero(row["HSEMeasures_Contractor_Interviewees"].ToString());
HSEMeasures_PilotProject_Headquarters += Funs.GetNewIntOrZero(row["HSEMeasures_PilotProject_Headquarters"].ToString());
HSEMeasures_PilotProject_Branch += Funs.GetNewIntOrZero(row["HSEMeasures_PilotProject_Branch"].ToString());
Construction_Teams_Totals += Funs.GetNewIntOrZero(row["Construction_Teams_Totals"].ToString());
Construction_Teams_Compliant += Funs.GetNewIntOrZero(row["Construction_Teams_Compliant"].ToString());
Construction_ModelTeams_Headquarters += Funs.GetNewIntOrZero(row["Construction_ModelTeams_Headquarters"].ToString());
Construction_ModelTeams_CPECC += Funs.GetNewIntOrZero(row["Construction_ModelTeams_CPECC"].ToString());
Construction_ModelTeams_Group += Funs.GetNewIntOrZero(row["Construction_ModelTeams_Group"].ToString());
HSETraining_ThreeCategory += Funs.GetNewIntOrZero(row["HSETraining_ThreeCategory"].ToString());
HSETraining_TrainingPersons += Funs.GetNewIntOrZero(row["HSETraining_TrainingPersons"].ToString());
HSETraining_ContractorTraining += Funs.GetNewIntOrZero(row["HSETraining_ContractorTraining"].ToString());
}
summary.Add("ReportDate", "合计");
summary.Add("ConAndEPCCount", ConAndEPCCount);
summary.Add("SurveyAndDesignCount", SurveyAndDesignCount);
summary.Add("WorkingHours", WorkingHours);
summary.Add("SafeDrivingMileage", SafeDrivingMileage);
summary.Add("SubSupervise_InspectionItems", SubSupervise_InspectionItems);
summary.Add("SubSupervise_Inspections", SubSupervise_Inspections);
summary.Add("SubSupervise_HSE_Total", SubSupervise_HSE_Total);
summary.Add("SubSupervise_HSE_Larger", SubSupervise_HSE_Larger);
summary.Add("SubSupervise_HSE_Generally", SubSupervise_HSE_Generally);
summary.Add("SubSupervise_HSE_Slight", SubSupervise_HSE_Slight);
summary.Add("SubSupervise_Quality_Total", SubSupervise_Quality_Total);
summary.Add("SubSupervise_Quality_Larger", SubSupervise_Quality_Larger);
summary.Add("SubSupervise_Quality_Generally", SubSupervise_Quality_Generally);
summary.Add("SubSupervise_Quality_Slight", SubSupervise_Quality_Slight);
summary.Add("SubVideo_InspectionItems", SubVideo_InspectionItems);
summary.Add("SubVideo_InspectionsMin", SubVideo_InspectionsMin);
summary.Add("SubVideo_HSE_Total", SubVideo_HSE_Total);
summary.Add("SubVideo_HSE_Larger", SubVideo_HSE_Larger);
summary.Add("SubVideo_HSE_Generally", SubVideo_HSE_Generally);
summary.Add("SubVideo_HSE_Slight", SubVideo_HSE_Slight);
summary.Add("SubVideo_Quality_Total", SubVideo_Quality_Total);
summary.Add("SubVideo_Quality_Larger", SubVideo_Quality_Larger);
summary.Add("SubVideo_Quality_Generally", SubVideo_Quality_Generally);
summary.Add("SubVideo_Quality_Slight", SubVideo_Quality_Slight);
summary.Add("HQ_InspectionItems", HQ_InspectionItems);
summary.Add("HQ_Inspections", HQ_Inspections);
summary.Add("HQ_HSE_Total", HQ_HSE_Total);
summary.Add("HQ_HSE_Larger", HQ_HSE_Larger);
summary.Add("HQ_HSE_Generally", HQ_HSE_Generally);
summary.Add("HQ_HSE_Slight", HQ_HSE_Slight);
summary.Add("HQ_Quality_Total", HQ_Quality_Total);
summary.Add("HQ_Quality_Larger", HQ_Quality_Larger);
summary.Add("HQ_Quality_Generally", HQ_Quality_Generally);
summary.Add("HQ_Quality_Slight", HQ_Quality_Slight);
summary.Add("Quality_Employee_Count", Quality_Employee_Count);
summary.Add("Quality_Employee_Score", Quality_Employee_Score);
summary.Add("Quality_Contractor_Count", Quality_Contractor_Count);
summary.Add("Quality_Contractor_Score", Quality_Contractor_Score);
summary.Add("Quality_Employee_Fine", Quality_Employee_Fine);
summary.Add("Quality_Employee_FineAmount", Quality_Employee_FineAmount);
summary.Add("Quality_Contractor_Fine", Quality_Contractor_Fine);
summary.Add("Quality_Contractor_FineAmount", Quality_Contractor_FineAmount);
summary.Add("Quality_Contractor_Deduction", Quality_Contractor_Deduction);
summary.Add("Quality_Contractor_DeductionAmount", Quality_Contractor_DeductionAmount);
summary.Add("Quality_ProjectDepartment_Fine", Quality_ProjectDepartment_Fine);
summary.Add("Quality_ProjectDepartment_FineAmount", Quality_ProjectDepartment_FineAmount);
summary.Add("HSE_Employee_Count", HSE_Employee_Count);
summary.Add("HSE_Employee_Score", HSE_Employee_Score);
summary.Add("HSE_Contractor_Count", HSE_Contractor_Count);
summary.Add("HSE_Contractor_Score", HSE_Contractor_Score);
summary.Add("HSE_Employee_Fine", HSE_Employee_Fine);
summary.Add("HSE_Employee_FineAmount", HSE_Employee_FineAmount);
summary.Add("HSE_Contractor_Fine", HSE_Contractor_Fine);
summary.Add("HSE_Contractor_FineAmount", HSE_Contractor_FineAmount);
summary.Add("HSE_Contractor_Deduction", HSE_Contractor_Deduction);
summary.Add("HSE_Contractor_DeductionAmount", HSE_Contractor_DeductionAmount);
summary.Add("HSE_ProjectDepartment_Fine", HSE_ProjectDepartment_Fine);
summary.Add("HSE_ProjectDepartment_FineAmount", HSE_ProjectDepartment_FineAmount);
summary.Add("LeaderSupervision_HSECheck_Leaders", LeaderSupervision_HSECheck_Leaders);
summary.Add("LeaderSupervision_HSECheck_Count", LeaderSupervision_HSECheck_Count);
summary.Add("LeaderSupervision_HSECheck_Hazards", LeaderSupervision_HSECheck_Hazards);
summary.Add("LeaderSupervision_SafetyLectures_Leaders", LeaderSupervision_SafetyLectures_Leaders);
summary.Add("LeaderSupervision_SafetyLectures_Count", LeaderSupervision_SafetyLectures_Count);
summary.Add("LeaderSupervision_SafetyLectures_Attendees", LeaderSupervision_SafetyLectures_Attendees);
summary.Add("LeaderSupervision_Activities_Leaders", LeaderSupervision_Activities_Leaders);
summary.Add("LeaderSupervision_Activities_Count", LeaderSupervision_Activities_Count);
summary.Add("HSEMeasures_OfficesCount", HSEMeasures_OfficesCount);
summary.Add("HSEMeasures_TrainingBooths", HSEMeasures_TrainingBooths);
summary.Add("HSEMeasures_Toolboxs", HSEMeasures_Toolboxs);
summary.Add("HSEMeasures_Consultant_Projects", HSEMeasures_Consultant_Projects);
summary.Add("HSEMeasures_Consultant_Count", HSEMeasures_Consultant_Count);
summary.Add("HSEMeasures_FiveStar_Star2", HSEMeasures_FiveStar_Star2);
summary.Add("HSEMeasures_FiveStar_Star3", HSEMeasures_FiveStar_Star3);
summary.Add("HSEMeasures_FiveStar_Star4", HSEMeasures_FiveStar_Star4);
summary.Add("HSEMeasures_FiveStar_Star5", HSEMeasures_FiveStar_Star5);
summary.Add("HSEMeasures_Contractor_Interviewees", HSEMeasures_Contractor_Interviewees);
summary.Add("HSEMeasures_PilotProject_Headquarters", HSEMeasures_PilotProject_Headquarters);
summary.Add("HSEMeasures_PilotProject_Branch", HSEMeasures_PilotProject_Branch);
summary.Add("Construction_Teams_Totals", Construction_Teams_Totals);
summary.Add("Construction_Teams_Compliant", Construction_Teams_Compliant);
summary.Add("Construction_ModelTeams_Headquarters", Construction_ModelTeams_Headquarters);
summary.Add("Construction_ModelTeams_CPECC", Construction_ModelTeams_CPECC);
summary.Add("Construction_ModelTeams_Group", Construction_ModelTeams_Group);
summary.Add("HSETraining_ThreeCategory", HSETraining_ThreeCategory);
summary.Add("HSETraining_TrainingPersons", HSETraining_TrainingPersons);
summary.Add("HSETraining_ContractorTraining", HSETraining_ContractorTraining);
Grid1.SummaryData = summary;
2026-09-07 15:06:45 +08:00
}
#endregion
#region
/// <summary>
/// 分页
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
Grid1.PageIndex = e.NewPageIndex;
BindGrid();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
BindGrid();
}
/// <summary>
/// 分页显示条数下拉框
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
BindGrid();
}
/// <summary>
/// 关闭弹出窗
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindGrid();
}
#endregion
#region Grid双击事件
/// <summary>
/// Grid行双击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
btnMenuModify_Click(null, null);
}
#endregion
#region
/// <summary>
/// 编辑按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuModify_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
string rowId = Grid1.SelectedRowID;
if (!string.IsNullOrEmpty(rowId))
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SafetyManagementDataEdit.aspx?dataId={0}", rowId, "编辑 - ")));
}
}
#endregion
#region
/// <summary>
/// 批量删除
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuDel_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length > 0)
{
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
var data = BLL.SafetyManagementDataService.GetSafetyManagementDataById(rowID);
if (data != null)
{
BLL.LogService.AddSys_Log(this.CurrUser, data.DataId, data.DataId, BLL.Const.ProjectSafetyManagementDataMenuId, BLL.Const.BtnDelete);
BLL.SafetyManagementDataService.DeleteSafetyManagementDataByDataId(rowID);
}
}
BindGrid();
ShowNotify("删除数据成功!");
}
}
#endregion
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
try
{
if (Request.Params["value"] == "0")
{
return;
}
2026-09-16 15:32:11 +08:00
var buttonList = BLL.CommonService.GetAllButtonList(null, this.CurrUser.UserId, BLL.Const.ProjectSafetyManagementDataMenuId);
//var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ProjectSafetyManagementDataMenuId);
2026-09-07 15:06:45 +08:00
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))
{
this.btnNew.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnModify))
{
this.btnMenuModify.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnDelete))
{
this.btnMenuDel.Hidden = false;
}
}
}
catch (Exception e)
{
}
}
#endregion
#region
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void TextBox_TextChanged(object sender, EventArgs e)
{
DateTime? startTime = Funs.GetNewDateTime(this.txtStartTime.Text.Trim());
DateTime? endTime = Funs.GetNewDateTime(this.txtEndTime.Text.Trim());
if (startTime > endTime)
{
Alert.ShowInTop("开始日期不能大于结束日期!", MessageBoxIcon.Warning);
return;
}
this.BindGrid();
}
#endregion
#region
/// 导出按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e)
{
Response.ClearContent();
string fileName = System.Web.HttpUtility.UrlEncode($"安全管理数据" + Funs.GetNewFileName(), System.Text.Encoding.UTF8);
Response.AddHeader("content-disposition", "attachment; filename=" + fileName + ".xls");
Response.ContentType = "application/excel";
Response.ContentEncoding = System.Text.Encoding.UTF8;
DataTable dtAll = GetSourceDataTable();
string html = GetGridMultiHeaderTableHtml(Grid1, dtAll);
Response.Write(html);
Response.End();
}
/// <summary>
/// 多表头导出
/// </summary>
public string GetGridMultiHeaderTableHtml(Grid grid, DataTable dtSource)
{
StringBuilder sb = new StringBuilder();
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
MultiHeaderTable mht = new MultiHeaderTable();
mht.ResolveMultiHeaderTable(grid.Columns);
foreach (List<object[]> rows in mht.MultiTable)
{
sb.Append("<tr>");
foreach (object[] cell in rows)
{
int rowspan = Convert.ToInt32(cell[0]);
int colspan = Convert.ToInt32(cell[1]);
GridColumn column = cell[2] as GridColumn;
if (column.Hidden == false)
{
sb.AppendFormat("<th{0}{1}{2}>{3}</th>",
rowspan != 1 ? " rowspan=\"" + rowspan + "\"" : "",
colspan != 1 ? " colspan=\"" + colspan + "\"" : "",
colspan != 1 ? " style=\"text-align:center;\"" : "",
column.HeaderText);
}
}
sb.Append("</tr>");
}
int rowIndex = 0;
foreach (DataRow dr in dtSource.Rows)
{
sb.Append("<tr>");
foreach (GridColumn column in mht.Columns)
{
if (column.ColumnID == "ckbIsSelected" || column.ColumnID == "Punish" || column.ColumnID == "Del")
continue;
string cellValue = "";
if (column.ColumnID == "tfNumber")
{
//导出序号:全部数据的序号
cellValue = (rowIndex + 1).ToString();
}
else if (column.ColumnID == "ReportDate")
{
cellValue = string.Format("{0:yyyy-MM}", dr[column.ColumnID]);
}
else
{
if (!string.IsNullOrEmpty(column.ColumnID) && dtSource.Columns.Contains(column.ColumnID))
{
cellValue = dr[column.ColumnID] == DBNull.Value ? "" : dr[column.ColumnID].ToString();
}
}
sb.AppendFormat("<td style=\"mso-number-format:'\\@';\">{0}</td>", System.Web.HttpUtility.HtmlEncode(cellValue));
//sb.AppendFormat("<td>{0}</td>", System.Web.HttpUtility.HtmlEncode(cellValue));
}
sb.Append("</tr>");
rowIndex++;
}
sb.Append("</table>");
return sb.ToString();
}
#endregion
}
}