修改生态环保报表

This commit is contained in:
2023-07-12 17:07:47 +08:00
parent 4449a7754f
commit c13c5de7ec
18 changed files with 266 additions and 71 deletions
@@ -26,6 +26,9 @@
<f:DropDownList ID="drpYear" runat="server" Label="年份" LabelAlign="Right" Width="250px"
AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged">
</f:DropDownList>
<f:DropDownList ID="drpQuarters" runat="server" Label="季度" LabelAlign="Right" Width="250px"
AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged">
</f:DropDownList>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" EnablePostBack="false" Hidden="true" Text="新增"
@@ -41,11 +44,19 @@
SortField="UnitName" FieldType="String" HeaderText="填报单位" HeaderTextAlign="Center"
TextAlign="Left" ExpandUnusedSpace="true">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="ResponsiblePerson" DataField="ResponsiblePerson"
<f:RenderField Width="100px" ColumnID="YearStr" DataField="YearStr"
SortField="YearStr" FieldType="String" HeaderText="年份" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="QuarterStr" DataField="QuarterStr"
SortField="QuarterStr" FieldType="String" HeaderText="季度" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="ResponsiblePerson" DataField="ResponsiblePerson"
SortField="ResponsiblePerson" FieldType="String" HeaderText="负责人" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="ResponsiblePersonTel" DataField="ResponsiblePersonTel"
<f:RenderField Width="120px" ColumnID="ResponsiblePersonTel" DataField="ResponsiblePersonTel"
SortField="ResponsiblePersonTel" FieldType="String" HeaderText="负责人电话" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
@@ -53,7 +64,7 @@
SortField="ContactPerson" FieldType="String" HeaderText="联系人" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="ContactPersonTel" DataField="ContactPersonTel"
<f:RenderField Width="120px" ColumnID="ContactPersonTel" DataField="ContactPersonTel"
SortField="ContactPersonTel" FieldType="String" HeaderText="联系人电话" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
@@ -48,7 +48,7 @@ namespace FineUIPro.Web.HSSE.InformationProject
this.GetButtonPower();
BLL.ConstValue.InitConstValueDropDownList(this.drpYear, BLL.ConstValue.Group_0008, true);
BLL.ConstValue.InitConstValueDropDownList(this.drpQuarters, BLL.ConstValue.Group_0011, true);
this.btnNew.OnClientClick = Window1.GetShowReference("EPSummaryReportEdit.aspx") + "return false;";
if (this.CurrUser != null && this.CurrUser.PageSize.HasValue)
{
@@ -68,6 +68,9 @@ namespace FineUIPro.Web.HSSE.InformationProject
+ @"report.ProjectId,"
+ @"report.UnitId,"
+ @"report.YearId,"
+ @"report.Quarter,"
+ @"ConstY.ConstText as YearStr,"
+ @"ConstQ.ConstText as QuarterStr,"
+ @"report.ResponsiblePerson,"
+ @"report.ResponsiblePersonTel,"
+ @"report.ContactPerson,"
@@ -84,6 +87,8 @@ namespace FineUIPro.Web.HSSE.InformationProject
+ @"report.Description9,"
+ @"Unit.UnitName "
+ @" FROM InformationProject_EPSummaryReport AS report "
+ @" LEFT JOIN Sys_Const AS ConstY ON ConstY.ConstValue = report.YearId and ConstY.GroupId='0008' "
+ @" LEFT JOIN Sys_Const AS ConstQ ON ConstQ.ConstValue = report.Quarter and ConstQ.GroupId='0011' "
+ @" LEFT JOIN Base_Unit AS Unit ON Unit.UnitId = report.UnitId WHERE 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
@@ -93,6 +98,11 @@ namespace FineUIPro.Web.HSSE.InformationProject
strSql += " AND report.YearId = @Year";
listStr.Add(new SqlParameter("@Year", Funs.GetNewInt(this.drpYear.SelectedValue)));
}
if (this.drpQuarters.SelectedValue != BLL.Const._Null)
{
strSql += " AND report.Quarter = @Quarter";
listStr.Add(new SqlParameter("@Quarter", Funs.GetNewInt(this.drpQuarters.SelectedValue)));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
@@ -66,6 +66,15 @@ namespace FineUIPro.Web.HSSE.InformationProject {
/// </remarks>
protected global::FineUIPro.DropDownList drpYear;
/// <summary>
/// drpQuarters 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpQuarters;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
@@ -18,6 +18,8 @@
<Items>
<f:DropDownList ID="ddlYearId" runat="server" Label="年度" Required="True" ShowRedStar="True">
</f:DropDownList>
<f:DropDownList ID="ddlQuarter" runat="server" Label="季度" Required="True" ShowRedStar="True">
</f:DropDownList>
<f:DatePicker ID="txtReportDate" runat="server" Label="报告时间" Required="true" ShowRedStar="true"></f:DatePicker>
</Items>
</f:FormRow>
@@ -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;
}
}
@@ -48,6 +48,15 @@ namespace FineUIPro.Web.HSSE.InformationProject {
/// </remarks>
protected global::FineUIPro.DropDownList ddlYearId;
/// <summary>
/// ddlQuarter 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlQuarter;
/// <summary>
/// txtReportDate 控件。
/// </summary>