放开日报

This commit is contained in:
李超 2023-03-31 16:33:36 +08:00
parent 3e9efbcf3b
commit 10e1ab0124
2 changed files with 138 additions and 141 deletions

View File

@ -43,7 +43,8 @@ namespace FineUIPro.Web.HSSE.Manager
this.tvControlItem.Nodes.Add(rootNode);
var report = from x in Funs.DB.HSSE_MonthReport
where x.ProjectId == CurrUser.LoginProjectId orderby x.Years
where x.ProjectId == CurrUser.LoginProjectId
orderby x.Years
select x;
if (report.Count() > 0)
{
@ -95,21 +96,17 @@ namespace FineUIPro.Web.HSSE.Manager
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
{
int editMonth = GetCurMonth();
int cm = 12;
if (DateTime.Now.Year.ToString()== tvControlItem.SelectedNode.Text)
{
cm = DateTime.Now.Month;
}
int cm = GetCurMonth();
for (int i = 1; i <= 12; i++)
{
if (i != editMonth)
if (i != cm)
{
string monthC = "Month" + i.ToString();
RenderField month = Grid1.FindColumn(monthC) as RenderField;
e.CellCssClasses[month.ColumnIndex] = "f-grid-cell-uneditable";
//string monthC = "Month" + i.ToString();
//RenderField month = Grid1.FindColumn(monthC) as RenderField;
//e.CellCssClasses[month.ColumnIndex] = "f-grid-cell-uneditable";
}
// else
else
{
string monthC = "Month" + i.ToString();
RenderField month = Grid1.FindColumn(monthC) as RenderField;
@ -123,7 +120,7 @@ namespace FineUIPro.Web.HSSE.Manager
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 (i <= cm && e.Values[month.ColumnIndex].ToString() == "")
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = person.Count();
}
@ -136,7 +133,7 @@ namespace FineUIPro.Web.HSSE.Manager
where x.ProjectId == this.CurrUser.LoginProjectId && y.UnitCode == "CHENGDA"
&& z.WorkPostName.Contains("安全")
select x;
if (i <= cm && e.Values[month.ColumnIndex].ToString() == "")
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = person.Count();
}
@ -147,7 +144,7 @@ namespace FineUIPro.Web.HSSE.Manager
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 (i <= cm && e.Values[month.ColumnIndex].ToString() == "")
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = person.Count();
}
@ -160,7 +157,7 @@ namespace FineUIPro.Web.HSSE.Manager
where x.ProjectId == this.CurrUser.LoginProjectId && y.UnitCode != "CHENGDA"
&& z.WorkPostName.Contains("安全")
select x;
if (i <= cm && e.Values[month.ColumnIndex].ToString() == "")
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = person.Count();
}
@ -170,11 +167,11 @@ namespace FineUIPro.Web.HSSE.Manager
{
DateTime? sDate = Convert.ToDateTime(tvControlItem.SelectedNode.Text + "-" + i.ToString());
var dayReports = BLL.SitePerson_MonthReportService.getMonthReports(this.CurrUser.LoginProjectId, sDate);
if (i <= cm && e.Values[month.ColumnIndex].ToString() == "" && dayReports.Count() > 0)
if (e.Values[month.ColumnIndex].ToString() == "" && dayReports.Count() > 0)
{
e.Values[month.ColumnIndex] = dayReports.First().DayWorkTime;
}
else if (i <= cm && e.Values[month.ColumnIndex].ToString() == "")
else if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = 0;
}
@ -187,7 +184,7 @@ namespace FineUIPro.Web.HSSE.Manager
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1)
select x;
if (i <= cm && e.Values[month.ColumnIndex].ToString() == "")
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = accident.Count();
}
@ -200,7 +197,7 @@ namespace FineUIPro.Web.HSSE.Manager
&& x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1)
&& x.Injury == "1"
select x;
if (i <= cm && e.Values[month.ColumnIndex].ToString() == "")
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = accident.Count();
}
@ -213,7 +210,7 @@ namespace FineUIPro.Web.HSSE.Manager
&& x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1)
&& x.Injury == "2"
select x;
if (i <= cm && e.Values[month.ColumnIndex].ToString() == "")
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = accident.Count();
}
@ -226,7 +223,7 @@ namespace FineUIPro.Web.HSSE.Manager
&& x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1)
&& x.Injury == "3"
select x;
if (i <= cm && e.Values[month.ColumnIndex].ToString() == "")
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = accident.Count();
}
@ -238,7 +235,7 @@ namespace FineUIPro.Web.HSSE.Manager
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1)
select x;
if (i <= cm && e.Values[month.ColumnIndex].ToString() == "")
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = accident.Count();
}
@ -246,14 +243,14 @@ namespace FineUIPro.Web.HSSE.Manager
if (e.RowIndex == 11) // 现场环境事故
{
if (i <= cm && e.Values[month.ColumnIndex].ToString() == "")
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = "0";
}
}
if (e.RowIndex == 12) // 现场发生设备材料盗窃案件
{
if (i <= cm && e.Values[month.ColumnIndex].ToString() == "")
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = "0";
}
@ -265,7 +262,7 @@ namespace FineUIPro.Web.HSSE.Manager
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.WeekMeetingDate >= startDate && x.WeekMeetingDate < startDate.AddMonths(1)
select x;
if (i <= cm && e.Values[month.ColumnIndex].ToString() == "")
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = weekMeeting.Count();
}
@ -277,7 +274,7 @@ namespace FineUIPro.Web.HSSE.Manager
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.AttendMeetingDate >= startDate && x.AttendMeetingDate < startDate.AddMonths(1)
select x;
if (i <= cm && e.Values[month.ColumnIndex].ToString() == "")
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = weekMeeting.Count();
}
@ -285,7 +282,7 @@ namespace FineUIPro.Web.HSSE.Manager
if (e.RowIndex == 15) // 施工现场HSE联检
{
if (i <= cm && e.Values[month.ColumnIndex].ToString() == "")
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = "0";
}
@ -297,7 +294,7 @@ namespace FineUIPro.Web.HSSE.Manager
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.CheckedDate >= startDate && x.CheckedDate < startDate.AddMonths(1)
select x;
if (i <= cm && e.Values[month.ColumnIndex].ToString() == "")
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = check.Count();
}
@ -309,7 +306,7 @@ namespace FineUIPro.Web.HSSE.Manager
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.CompleteDate >= startDate && x.CompleteDate < startDate.AddMonths(1)
select x;
if (i <= cm && e.Values[month.ColumnIndex].ToString() == "")
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = check.Count();
}
@ -321,7 +318,7 @@ namespace FineUIPro.Web.HSSE.Manager
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.PunishNoticeDate >= startDate && x.PunishNoticeDate < startDate.AddMonths(1)
select x;
if (i <= cm && e.Values[month.ColumnIndex].ToString() == "")
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = check.Count();
}
@ -333,7 +330,7 @@ namespace FineUIPro.Web.HSSE.Manager
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.CompileDate >= startDate && x.CompileDate < startDate.AddMonths(1)
select x;
if (i <= cm && e.Values[month.ColumnIndex].ToString() == "")
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = em.Count();
}
@ -345,7 +342,7 @@ namespace FineUIPro.Web.HSSE.Manager
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.TrainStartDate >= startDate && x.TrainStartDate < startDate.AddMonths(1)
select x;
if (i <= cm && e.Values[month.ColumnIndex].ToString() == "")
if (e.Values[month.ColumnIndex].ToString() == "")
{
if (edu.Count() > 0)
{
@ -364,7 +361,7 @@ namespace FineUIPro.Web.HSSE.Manager
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.CompileDate >= startDate && x.CompileDate < startDate.AddMonths(1)
select x;
if (i <= cm && e.Values[month.ColumnIndex].ToString() == "")
if (e.Values[month.ColumnIndex].ToString() == "")
{
if (equ.Count() > 0)
{
@ -608,58 +605,58 @@ namespace FineUIPro.Web.HSSE.Manager
JArray editReport = Grid1.GetMergedData();
if (editReport.Count > 0)
{
if (cm != 0)
if (true || cm != 0)
{
for (int i = 0; i < editReport.Count; i++)
{
JObject objects = (JObject)editReport[i];
string monthReportItemId = objects["values"]["MonthReportItemId"].ToString();
Model.HSSE_MonthReportItem item = Funs.DB.HSSE_MonthReportItem.FirstOrDefault(x => x.MonthReportItemId == monthReportItemId);
if (cm == 1)
// if (cm == 1)
{
item.Month1 = Funs.GetNewInt(objects["values"]["Month1"].ToString());
}
if (cm == 2)
// if (cm == 2)
{
item.Month2 = Funs.GetNewInt(objects["values"]["Month2"].ToString());
}
if (cm == 3)
// if (cm == 3)
{
item.Month3 = Funs.GetNewInt(objects["values"]["Month3"].ToString());
}
if (cm == 4)
// if (cm == 4)
{
item.Month4 = Funs.GetNewInt(objects["values"]["Month4"].ToString());
}
if (cm == 5)
// if (cm == 5)
{
item.Month5 = Funs.GetNewInt(objects["values"]["Month5"].ToString());
}
if (cm == 6)
// if (cm == 6)
{
item.Month6 = Funs.GetNewInt(objects["values"]["Month6"].ToString());
}
if (cm == 7)
//if (cm == 7)
{
item.Month7 = Funs.GetNewInt(objects["values"]["Month7"].ToString());
}
if (cm == 8)
// if (cm == 8)
{
item.Month8 = Funs.GetNewInt(objects["values"]["Month8"].ToString());
}
if (cm == 9)
//if (cm == 9)
{
item.Month9 = Funs.GetNewInt(objects["values"]["Month9"].ToString());
}
if (cm == 10)
// if (cm == 10)
{
item.Month10 = Funs.GetNewInt(objects["values"]["Month10"].ToString());
}
if (cm == 11)
//if (cm == 11)
{
item.Month11 = Funs.GetNewInt(objects["values"]["Month11"].ToString());
}
if (cm == 12)
//if (cm == 12)
{
item.Month12 = Funs.GetNewInt(objects["values"]["Month12"].ToString());
}
@ -698,7 +695,7 @@ namespace FineUIPro.Web.HSSE.Manager
{
cm = m;
}
if (nd <= 4)
if (nd <= 20)
{
cm = lm;
}

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0"?>
<!--
有关如何配置 ASP.NET 应用程序的详细消息,请访问
@ -59,7 +59,7 @@
<add path="ChartImg.axd" verb="GET,POST,HEAD" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
<add path="FastReport.Export.axd" verb="*" type="FastReport.Web.Handlers.WebExport"/>
</httpHandlers>
<compilation debug="false" targetFramework="4.6.1" />
<compilation debug="true" targetFramework="4.6.1"/>
<httpRuntime requestValidationMode="2.0" maxRequestLength="2147483647" executionTimeout="36000" maxQueryStringLength="2097151"/>
<authentication mode="Forms">
<forms loginUrl="Login.aspx" name="PUBLISHERCOOKIE" protection="All" timeout="1440" path="/"/>