20231024
This commit is contained in:
@@ -96,313 +96,319 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
|
||||
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
|
||||
{
|
||||
int cm = GetCurMonth();
|
||||
int cm = GetCurMonth();
|
||||
|
||||
for (int i = 1; i <= 12; i++)
|
||||
{
|
||||
if (i != cm)
|
||||
{
|
||||
//string monthC = "Month" + i.ToString();
|
||||
//RenderField month = Grid1.FindColumn(monthC) as RenderField;
|
||||
//e.CellCssClasses[month.ColumnIndex] = "f-grid-cell-uneditable";
|
||||
}
|
||||
else
|
||||
{
|
||||
string monthC = "Month" + i.ToString();
|
||||
RenderField month = Grid1.FindColumn(monthC) as RenderField;
|
||||
RenderField yearTotal = Grid1.FindColumn("YearTotal") as RenderField;
|
||||
RenderField projectTotal = Grid1.FindColumn("ProjectTotal") as RenderField;
|
||||
RenderField sumProjectTotal = Grid1.FindColumn("SumProjectTotal") as RenderField;
|
||||
|
||||
if (e.RowIndex == 0) // 成达公司现场人数
|
||||
{
|
||||
var person = from x in Funs.DB.SitePerson_Person
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && y.UnitCode == "CHENGDA"
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = person.Count();
|
||||
}
|
||||
}
|
||||
if (e.RowIndex == 1) // 成达公司HSE管理人数
|
||||
{
|
||||
var person = from x in Funs.DB.SitePerson_Person
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
join z in Funs.DB.Base_WorkPost on x.WorkPostId equals z.WorkPostId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && y.UnitCode == "CHENGDA"
|
||||
&& z.WorkPostName.Contains("安全")
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = person.Count();
|
||||
}
|
||||
}
|
||||
if (e.RowIndex == 2) // 分包商现场人数
|
||||
{
|
||||
var person = from x in Funs.DB.SitePerson_Person
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && y.UnitCode != "CHENGDA"
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = person.Count();
|
||||
}
|
||||
}
|
||||
if (e.RowIndex == 3) // 分包商HSE管理人数
|
||||
{
|
||||
var person = from x in Funs.DB.SitePerson_Person
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
join z in Funs.DB.Base_WorkPost on x.WorkPostId equals z.WorkPostId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && y.UnitCode != "CHENGDA"
|
||||
&& z.WorkPostName.Contains("安全")
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = person.Count();
|
||||
}
|
||||
}
|
||||
if (i != cm)
|
||||
{
|
||||
DateTime temp = DateTime.Parse(DateTime.Now.Year + "-" + i + "-10");
|
||||
if (temp.AddMonths(1) < DateTime.Now)
|
||||
{
|
||||
string monthC = "Month" + i.ToString();
|
||||
RenderField month = Grid1.FindColumn(monthC) as RenderField;
|
||||
e.CellCssClasses[month.ColumnIndex] = "f-grid-cell-uneditable";
|
||||
}
|
||||
|
||||
if (e.RowIndex == 4 || e.RowIndex == 5) // 人工时数,安全生产人工时数
|
||||
{
|
||||
DateTime? sDate = Convert.ToDateTime(tvControlItem.SelectedNode.Text + "-" + i.ToString());
|
||||
var dayReports = BLL.SitePerson_MonthReportService.getMonthReports(this.CurrUser.LoginProjectId, sDate);
|
||||
if (e.Values[month.ColumnIndex].ToString() == "" && dayReports.Count() > 0)
|
||||
{
|
||||
e.Values[month.ColumnIndex] = dayReports.First().DayWorkTime;
|
||||
}
|
||||
else if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string monthC = "Month" + i.ToString();
|
||||
RenderField month = Grid1.FindColumn(monthC) as RenderField;
|
||||
RenderField yearTotal = Grid1.FindColumn("YearTotal") as RenderField;
|
||||
RenderField projectTotal = Grid1.FindColumn("ProjectTotal") as RenderField;
|
||||
RenderField sumProjectTotal = Grid1.FindColumn("SumProjectTotal") as RenderField;
|
||||
|
||||
DateTime startDate = Convert.ToDateTime(tvControlItem.SelectedNode.Text + "-" + i.ToString() + "-01");
|
||||
if (e.RowIndex == 6) // HSE记录事故数量
|
||||
{
|
||||
var accident = from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1)
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = accident.Count();
|
||||
}
|
||||
}
|
||||
if (e.RowIndex == 0) // 成达公司现场人数
|
||||
{
|
||||
var person = from x in Funs.DB.SitePerson_Person
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && y.UnitCode == "CHENGDA"
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = person.Count();
|
||||
}
|
||||
}
|
||||
if (e.RowIndex == 1) // 成达公司HSE管理人数
|
||||
{
|
||||
var person = from x in Funs.DB.SitePerson_Person
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
join z in Funs.DB.Base_WorkPost on x.WorkPostId equals z.WorkPostId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && y.UnitCode == "CHENGDA"
|
||||
&& z.WorkPostName.Contains("安全")
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = person.Count();
|
||||
}
|
||||
}
|
||||
if (e.RowIndex == 2) // 分包商现场人数
|
||||
{
|
||||
var person = from x in Funs.DB.SitePerson_Person
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && y.UnitCode != "CHENGDA"
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = person.Count();
|
||||
}
|
||||
}
|
||||
if (e.RowIndex == 3) // 分包商HSE管理人数
|
||||
{
|
||||
var person = from x in Funs.DB.SitePerson_Person
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
join z in Funs.DB.Base_WorkPost on x.WorkPostId equals z.WorkPostId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && y.UnitCode != "CHENGDA"
|
||||
&& z.WorkPostName.Contains("安全")
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = person.Count();
|
||||
}
|
||||
}
|
||||
|
||||
if (e.RowIndex == 7) // 死亡
|
||||
{
|
||||
var accident = from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1)
|
||||
&& x.Injury == "1"
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = accident.Count();
|
||||
}
|
||||
}
|
||||
if (e.RowIndex == 4 || e.RowIndex == 5) // 人工时数,安全生产人工时数
|
||||
{
|
||||
DateTime? sDate = Convert.ToDateTime(tvControlItem.SelectedNode.Text + "-" + i.ToString());
|
||||
var dayReports = BLL.SitePerson_MonthReportService.getMonthReports(this.CurrUser.LoginProjectId, sDate);
|
||||
if (e.Values[month.ColumnIndex].ToString() == "" && dayReports.Count() > 0)
|
||||
{
|
||||
e.Values[month.ColumnIndex] = dayReports.First().DayWorkTime;
|
||||
}
|
||||
else if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (e.RowIndex == 8) // 重伤
|
||||
{
|
||||
var accident = from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1)
|
||||
&& x.Injury == "2"
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = accident.Count();
|
||||
}
|
||||
}
|
||||
DateTime startDate = Convert.ToDateTime(tvControlItem.SelectedNode.Text + "-" + i.ToString() + "-01");
|
||||
if (e.RowIndex == 6) // HSE记录事故数量
|
||||
{
|
||||
var accident = from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1)
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = accident.Count();
|
||||
}
|
||||
}
|
||||
|
||||
if (e.RowIndex == 9) // 轻伤
|
||||
{
|
||||
var accident = from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1)
|
||||
&& x.Injury == "3"
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = accident.Count();
|
||||
}
|
||||
}
|
||||
if (e.RowIndex == 7) // 死亡
|
||||
{
|
||||
var accident = from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1)
|
||||
&& x.Injury == "1"
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = accident.Count();
|
||||
}
|
||||
}
|
||||
|
||||
if (e.RowIndex == 10) // 未遂事故
|
||||
{
|
||||
var accident = from x in Funs.DB.Accident_AccidentHandle
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1)
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = accident.Count();
|
||||
}
|
||||
}
|
||||
if (e.RowIndex == 8) // 重伤
|
||||
{
|
||||
var accident = from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1)
|
||||
&& x.Injury == "2"
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = accident.Count();
|
||||
}
|
||||
}
|
||||
|
||||
if (e.RowIndex == 11) // 现场环境事故
|
||||
{
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = "0";
|
||||
}
|
||||
}
|
||||
if (e.RowIndex == 12) // 现场发生设备材料盗窃案件
|
||||
{
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = "0";
|
||||
}
|
||||
}
|
||||
if (e.RowIndex == 9) // 轻伤
|
||||
{
|
||||
var accident = from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1)
|
||||
&& x.Injury == "3"
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = accident.Count();
|
||||
}
|
||||
}
|
||||
|
||||
if (e.RowIndex == 13) // HSE周会
|
||||
{
|
||||
var weekMeeting = from x in Funs.DB.Meeting_WeekMeeting
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.WeekMeetingDate >= startDate && x.WeekMeetingDate < startDate.AddMonths(1)
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = weekMeeting.Count();
|
||||
}
|
||||
}
|
||||
if (e.RowIndex == 10) // 未遂事故
|
||||
{
|
||||
var accident = from x in Funs.DB.Accident_AccidentHandle
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1)
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = accident.Count();
|
||||
}
|
||||
}
|
||||
|
||||
if (e.RowIndex == 14) // HSE委员会会议
|
||||
{
|
||||
var weekMeeting = from x in Funs.DB.Meeting_AttendMeeting
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.AttendMeetingDate >= startDate && x.AttendMeetingDate < startDate.AddMonths(1)
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = weekMeeting.Count();
|
||||
}
|
||||
}
|
||||
if (e.RowIndex == 11) // 现场环境事故
|
||||
{
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = "0";
|
||||
}
|
||||
}
|
||||
if (e.RowIndex == 12) // 现场发生设备材料盗窃案件
|
||||
{
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = "0";
|
||||
}
|
||||
}
|
||||
|
||||
if (e.RowIndex == 15) // 施工现场HSE联检
|
||||
{
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = "0";
|
||||
}
|
||||
}
|
||||
if (e.RowIndex == 13) // HSE周会
|
||||
{
|
||||
var weekMeeting = from x in Funs.DB.Meeting_WeekMeeting
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.WeekMeetingDate >= startDate && x.WeekMeetingDate < startDate.AddMonths(1)
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = weekMeeting.Count();
|
||||
}
|
||||
}
|
||||
|
||||
if (e.RowIndex == 16) // 发布HSE整改通知书
|
||||
{
|
||||
var check = from x in Funs.DB.Check_RectifyNotices
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.CheckedDate >= startDate && x.CheckedDate < startDate.AddMonths(1)
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = check.Count();
|
||||
}
|
||||
}
|
||||
if (e.RowIndex == 14) // HSE委员会会议
|
||||
{
|
||||
var weekMeeting = from x in Funs.DB.Meeting_AttendMeeting
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.AttendMeetingDate >= startDate && x.AttendMeetingDate < startDate.AddMonths(1)
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = weekMeeting.Count();
|
||||
}
|
||||
}
|
||||
|
||||
if (e.RowIndex == 17) // 关闭HSE整改通知书
|
||||
{
|
||||
var check = from x in Funs.DB.Check_RectifyNotices
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.CompleteDate >= startDate && x.CompleteDate < startDate.AddMonths(1)
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = check.Count();
|
||||
}
|
||||
}
|
||||
if (e.RowIndex == 15) // 施工现场HSE联检
|
||||
{
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = "0";
|
||||
}
|
||||
}
|
||||
|
||||
if (e.RowIndex == 18) // 发布HSE处罚书
|
||||
{
|
||||
var check = from x in Funs.DB.Check_PunishNotice
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.PunishNoticeDate >= startDate && x.PunishNoticeDate < startDate.AddMonths(1)
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = check.Count();
|
||||
}
|
||||
}
|
||||
if (e.RowIndex == 16) // 发布HSE整改通知书
|
||||
{
|
||||
var check = from x in Funs.DB.Check_RectifyNotices
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.CheckedDate >= startDate && x.CheckedDate < startDate.AddMonths(1)
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = check.Count();
|
||||
}
|
||||
}
|
||||
|
||||
if (e.RowIndex == 19) // 发布应急预案
|
||||
{
|
||||
var em = from x in Funs.DB.Emergency_EmergencyList
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.CompileDate >= startDate && x.CompileDate < startDate.AddMonths(1)
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = em.Count();
|
||||
}
|
||||
}
|
||||
if (e.RowIndex == 17) // 关闭HSE整改通知书
|
||||
{
|
||||
var check = from x in Funs.DB.Check_RectifyNotices
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.CompleteDate >= startDate && x.CompleteDate < startDate.AddMonths(1)
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = check.Count();
|
||||
}
|
||||
}
|
||||
|
||||
if (e.RowIndex == 20) // 人员培训
|
||||
{
|
||||
var edu = from x in Funs.DB.EduTrain_TrainRecord
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.TrainStartDate >= startDate && x.TrainStartDate < startDate.AddMonths(1)
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
if (edu.Count() > 0)
|
||||
{
|
||||
e.Values[month.ColumnIndex] = edu.Sum(x => x.TrainPersonNum);
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Values[month.ColumnIndex] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.RowIndex == 18) // 发布HSE处罚书
|
||||
{
|
||||
var check = from x in Funs.DB.Check_PunishNotice
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.PunishNoticeDate >= startDate && x.PunishNoticeDate < startDate.AddMonths(1)
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = check.Count();
|
||||
}
|
||||
}
|
||||
|
||||
if (e.RowIndex == 21) // 设备HSE检验
|
||||
{
|
||||
var equ = from x in Funs.DB.License_EquipmentSafetyList
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.CompileDate >= startDate && x.CompileDate < startDate.AddMonths(1)
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
if (equ.Count() > 0)
|
||||
{
|
||||
e.Values[month.ColumnIndex] = equ.Sum(x => x.EquipmentSafetyListCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Values[month.ColumnIndex] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.RowIndex == 19) // 发布应急预案
|
||||
{
|
||||
var em = from x in Funs.DB.Emergency_EmergencyList
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.CompileDate >= startDate && x.CompileDate < startDate.AddMonths(1)
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
e.Values[month.ColumnIndex] = em.Count();
|
||||
}
|
||||
}
|
||||
|
||||
RenderField month1 = Grid1.FindColumn("Month1") as RenderField;
|
||||
RenderField month2 = Grid1.FindColumn("Month2") as RenderField;
|
||||
RenderField month3 = Grid1.FindColumn("Month3") as RenderField;
|
||||
RenderField month4 = Grid1.FindColumn("Month4") as RenderField;
|
||||
RenderField month5 = Grid1.FindColumn("Month5") as RenderField;
|
||||
RenderField month6 = Grid1.FindColumn("Month6") as RenderField;
|
||||
RenderField month7 = Grid1.FindColumn("Month7") as RenderField;
|
||||
RenderField month8 = Grid1.FindColumn("Month8") as RenderField;
|
||||
RenderField month9 = Grid1.FindColumn("Month9") as RenderField;
|
||||
RenderField month10 = Grid1.FindColumn("Month10") as RenderField;
|
||||
RenderField month11 = Grid1.FindColumn("Month11") as RenderField;
|
||||
RenderField month12 = Grid1.FindColumn("Month12") as RenderField;
|
||||
// 年度总计
|
||||
e.Values[yearTotal.ColumnIndex] = Convert.ToInt32(e.Values[month1.ColumnIndex].ToString() != "" ? e.Values[month1.ColumnIndex] : 0)
|
||||
+ Convert.ToInt32(e.Values[month2.ColumnIndex].ToString() != "" ? e.Values[month2.ColumnIndex] : 0)
|
||||
+ Convert.ToInt32(e.Values[month3.ColumnIndex].ToString() != "" ? e.Values[month3.ColumnIndex] : 0)
|
||||
+ Convert.ToInt32(e.Values[month4.ColumnIndex].ToString() != "" ? e.Values[month4.ColumnIndex] : 0)
|
||||
+ Convert.ToInt32(e.Values[month5.ColumnIndex].ToString() != "" ? e.Values[month5.ColumnIndex] : 0)
|
||||
+ Convert.ToInt32(e.Values[month6.ColumnIndex].ToString() != "" ? e.Values[month6.ColumnIndex] : 0)
|
||||
+ Convert.ToInt32(e.Values[month7.ColumnIndex].ToString() != "" ? e.Values[month7.ColumnIndex] : 0)
|
||||
+ Convert.ToInt32(e.Values[month8.ColumnIndex].ToString() != "" ? e.Values[month8.ColumnIndex] : 0)
|
||||
+ Convert.ToInt32(e.Values[month9.ColumnIndex].ToString() != "" ? e.Values[month9.ColumnIndex] : 0)
|
||||
+ Convert.ToInt32(e.Values[month10.ColumnIndex].ToString() != "" ? e.Values[month10.ColumnIndex] : 0)
|
||||
+ Convert.ToInt32(e.Values[month11.ColumnIndex].ToString() != "" ? e.Values[month11.ColumnIndex] : 0)
|
||||
+ Convert.ToInt32(e.Values[month12.ColumnIndex].ToString() != "" ? e.Values[month12.ColumnIndex] : 0);
|
||||
// 项目总计
|
||||
e.Values[projectTotal.ColumnIndex] = Convert.ToInt32(e.Values[yearTotal.ColumnIndex]) + Convert.ToInt32(e.Values[sumProjectTotal.ColumnIndex]);
|
||||
if (e.RowIndex == 20) // 人员培训
|
||||
{
|
||||
var edu = from x in Funs.DB.EduTrain_TrainRecord
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.TrainStartDate >= startDate && x.TrainStartDate < startDate.AddMonths(1)
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
if (edu.Count() > 0)
|
||||
{
|
||||
e.Values[month.ColumnIndex] = edu.Sum(x => x.TrainPersonNum);
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Values[month.ColumnIndex] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (e.RowIndex == 21) // 设备HSE检验
|
||||
{
|
||||
var equ = from x in Funs.DB.License_EquipmentSafetyList
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.CompileDate >= startDate && x.CompileDate < startDate.AddMonths(1)
|
||||
select x;
|
||||
if (e.Values[month.ColumnIndex].ToString() == "")
|
||||
{
|
||||
if (equ.Count() > 0)
|
||||
{
|
||||
e.Values[month.ColumnIndex] = equ.Sum(x => x.EquipmentSafetyListCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Values[month.ColumnIndex] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RenderField month1 = Grid1.FindColumn("Month1") as RenderField;
|
||||
RenderField month2 = Grid1.FindColumn("Month2") as RenderField;
|
||||
RenderField month3 = Grid1.FindColumn("Month3") as RenderField;
|
||||
RenderField month4 = Grid1.FindColumn("Month4") as RenderField;
|
||||
RenderField month5 = Grid1.FindColumn("Month5") as RenderField;
|
||||
RenderField month6 = Grid1.FindColumn("Month6") as RenderField;
|
||||
RenderField month7 = Grid1.FindColumn("Month7") as RenderField;
|
||||
RenderField month8 = Grid1.FindColumn("Month8") as RenderField;
|
||||
RenderField month9 = Grid1.FindColumn("Month9") as RenderField;
|
||||
RenderField month10 = Grid1.FindColumn("Month10") as RenderField;
|
||||
RenderField month11 = Grid1.FindColumn("Month11") as RenderField;
|
||||
RenderField month12 = Grid1.FindColumn("Month12") as RenderField;
|
||||
// 年度总计
|
||||
e.Values[yearTotal.ColumnIndex] = Convert.ToInt32(e.Values[month1.ColumnIndex].ToString() != "" ? e.Values[month1.ColumnIndex] : 0)
|
||||
+ Convert.ToInt32(e.Values[month2.ColumnIndex].ToString() != "" ? e.Values[month2.ColumnIndex] : 0)
|
||||
+ Convert.ToInt32(e.Values[month3.ColumnIndex].ToString() != "" ? e.Values[month3.ColumnIndex] : 0)
|
||||
+ Convert.ToInt32(e.Values[month4.ColumnIndex].ToString() != "" ? e.Values[month4.ColumnIndex] : 0)
|
||||
+ Convert.ToInt32(e.Values[month5.ColumnIndex].ToString() != "" ? e.Values[month5.ColumnIndex] : 0)
|
||||
+ Convert.ToInt32(e.Values[month6.ColumnIndex].ToString() != "" ? e.Values[month6.ColumnIndex] : 0)
|
||||
+ Convert.ToInt32(e.Values[month7.ColumnIndex].ToString() != "" ? e.Values[month7.ColumnIndex] : 0)
|
||||
+ Convert.ToInt32(e.Values[month8.ColumnIndex].ToString() != "" ? e.Values[month8.ColumnIndex] : 0)
|
||||
+ Convert.ToInt32(e.Values[month9.ColumnIndex].ToString() != "" ? e.Values[month9.ColumnIndex] : 0)
|
||||
+ Convert.ToInt32(e.Values[month10.ColumnIndex].ToString() != "" ? e.Values[month10.ColumnIndex] : 0)
|
||||
+ Convert.ToInt32(e.Values[month11.ColumnIndex].ToString() != "" ? e.Values[month11.ColumnIndex] : 0)
|
||||
+ Convert.ToInt32(e.Values[month12.ColumnIndex].ToString() != "" ? e.Values[month12.ColumnIndex] : 0);
|
||||
// 项目总计
|
||||
e.Values[projectTotal.ColumnIndex] = Convert.ToInt32(e.Values[yearTotal.ColumnIndex]) + Convert.ToInt32(e.Values[sumProjectTotal.ColumnIndex]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user