20231016月报安全工时、累计工时优化

This commit is contained in:
2023-10-16 11:24:26 +08:00
parent 5a9ebc9ade
commit 87a19f7dfe
6 changed files with 51 additions and 5 deletions
@@ -713,7 +713,6 @@ namespace FineUIPro.Web.HSSE.Manager
newItem.MonthReportId = MonthReportId;
newItem.MonthWorkTime = Funs.GetNewDecimalOrZero(MonthWorkTime.Text);
newItem.YearWorkTime = Funs.GetNewDecimalOrZero(YearWorkTime.Text);
newItem.YearWorkTime = Funs.GetNewDecimalOrZero(YearWorkTime.Text);
newItem.TotalLostTime = Funs.GetNewDecimalOrZero(TotalLostTime.Text);
newItem.MillionLossRate = MillionLossRate.Text;
newItem.ProjectWorkTime = Funs.GetNewDecimalOrZero(ProjectWorkTime.Text);
@@ -1439,5 +1438,28 @@ namespace FineUIPro.Web.HSSE.Manager
{
SetStepDrp();
}
protected void MonthWorkTime_Blur(object sender, EventArgs e)
{
var monthWorkTimeValue = Funs.GetNewDecimalOrZero(this.MonthWorkTime.Text);
decimal hdYearWorkTimeValue =0;
decimal hdSafeWorkTimeValue =0;
DateTime month=Funs.GetNewDateTimeOrNow(this.ReporMonth.Text);
var getMaxMonthReport = (from x in Funs.DB.SeDin_MonthReport where x.ProjectId == this.ProjectId && x.ReporMonth < month
orderby x.ReporMonth descending select x).FirstOrDefault();
if (getMaxMonthReport != null)
{
var getMonthReport2 = Funs.DB.SeDin_MonthReport2.FirstOrDefault(x => x.MonthReportId == getMaxMonthReport.MonthReportId);
if (getMonthReport2 != null)
{
hdYearWorkTimeValue = getMonthReport2.YearWorkTime ?? 0;
hdSafeWorkTimeValue = getMonthReport2.SafeWorkTime ?? 0;
}
}
this.YearWorkTime.Text = (monthWorkTimeValue + hdYearWorkTimeValue).ToString();
this.SafeWorkTime.Text = (monthWorkTimeValue + hdSafeWorkTimeValue).ToString();
}
}
}