修改生态环保报表
This commit is contained in:
@@ -59,7 +59,7 @@ namespace FineUIPro.Web.HSSE.InformationProject
|
||||
this.ProjectId = Request.Params["projectId"];
|
||||
}
|
||||
BLL.ConstValue.InitConstValueDropDownList(this.ddlYearId, BLL.ConstValue.Group_0008, true);
|
||||
|
||||
BLL.ConstValue.InitConstValueDropDownList(this.ddlQuarter, BLL.ConstValue.Group_0011, true);
|
||||
this.EPSummaryReportId = Request.Params["EPSummaryReportId"];
|
||||
if (!string.IsNullOrEmpty(this.EPSummaryReportId))
|
||||
{
|
||||
@@ -71,6 +71,10 @@ namespace FineUIPro.Web.HSSE.InformationProject
|
||||
if (report.YearId != null)
|
||||
{
|
||||
this.ddlYearId.SelectedValue = report.YearId.ToString();
|
||||
if (report.Quarter.HasValue)
|
||||
{
|
||||
this.ddlQuarter.SelectedValue = report.Quarter.ToString();
|
||||
}
|
||||
this.txtReportDate.Text = report.ReportDate.HasValue ? string.Format("{0:yyyy-MM-dd}", report.ReportDate) : "";
|
||||
this.txtResponsiblePerson.Text = report.ResponsiblePerson;
|
||||
this.txtResponsiblePersonTel.Text = report.ResponsiblePersonTel;
|
||||
@@ -91,7 +95,9 @@ namespace FineUIPro.Web.HSSE.InformationProject
|
||||
}
|
||||
else
|
||||
{
|
||||
DateTime showDate = DateTime.Now.AddMonths(-3);
|
||||
this.ddlYearId.SelectedValue = DateTime.Now.Year.ToString();
|
||||
this.ddlQuarter.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString();
|
||||
this.txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
}
|
||||
}
|
||||
@@ -124,12 +130,16 @@ namespace FineUIPro.Web.HSSE.InformationProject
|
||||
Model.InformationProject_EPSummaryReport report = new Model.InformationProject_EPSummaryReport
|
||||
{
|
||||
ProjectId = this.ProjectId,
|
||||
UnitId = string.IsNullOrEmpty(this.CurrUser.UnitId) ? Const.UnitId_CD : this.CurrUser.UnitId,
|
||||
UnitId = string.IsNullOrEmpty(this.CurrUser.UnitId) ? CommonService.GetThisUnitId() : this.CurrUser.UnitId,
|
||||
};
|
||||
if (this.ddlYearId.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
report.YearId = Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue);
|
||||
}
|
||||
if (this.ddlQuarter.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
report.Quarter = Funs.GetNewIntOrZero(this.ddlQuarter.SelectedValue);
|
||||
}
|
||||
report.ResponsiblePerson = this.txtResponsiblePerson.Text.Trim();
|
||||
report.ResponsiblePersonTel = this.txtResponsiblePersonTel.Text.Trim();
|
||||
report.ContactPerson = this.txtContactPerson.Text.Trim();
|
||||
@@ -153,8 +163,8 @@ namespace FineUIPro.Web.HSSE.InformationProject
|
||||
else
|
||||
{
|
||||
Model.InformationProject_EPSummaryReport oldReport = (from x in Funs.DB.InformationProject_EPSummaryReport
|
||||
where x.ProjectId == report.ProjectId && x.YearId == report.YearId
|
||||
select x).FirstOrDefault();
|
||||
where x.ProjectId == report.ProjectId && x.YearId == report.YearId && x.Quarter == report.Quarter
|
||||
select x).FirstOrDefault();
|
||||
if (oldReport == null)
|
||||
{
|
||||
this.EPSummaryReportId = SQLHelper.GetNewID(typeof(Model.InformationProject_EPSummaryReport));
|
||||
@@ -165,7 +175,7 @@ namespace FineUIPro.Web.HSSE.InformationProject
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("该年度记录已存在", MessageBoxIcon.Warning);
|
||||
Alert.ShowInTop("该季度记录已存在", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user