修改生态环保报表

This commit is contained in:
高飞 2023-07-12 15:58:52 +08:00
parent 0e6ee80134
commit ae9fcbdda5
19 changed files with 268 additions and 67 deletions

View File

@ -0,0 +1,4 @@
alter table [dbo].[Information_EPSummaryReport] add Quarter int null
GO
alter table [dbo].[InformationProject_EPSummaryReport] add Quarter int null
GO

View File

@ -605,5 +605,16 @@ namespace BLL
if (now.Month < birthDate.Month || (now.Month == birthDate.Month && now.Day < birthDate.Day)) age--;
return age;
}
/// <summary>
/// 得到本单位Id
/// </summary>
/// <returns></returns>
public static string GetThisUnitId()
{
string unitId = Const.UnitId_CWCEC;
return unitId;
}
}
}

View File

@ -33,6 +33,7 @@ namespace BLL
ProjectId = ePSummaryReport.ProjectId,
UnitId = ePSummaryReport.UnitId,
YearId = ePSummaryReport.YearId,
Quarter= ePSummaryReport.Quarter,
ResponsiblePerson = ePSummaryReport.ResponsiblePerson,
ResponsiblePersonTel = ePSummaryReport.ResponsiblePersonTel,
ContactPerson = ePSummaryReport.ContactPerson,
@ -63,6 +64,7 @@ namespace BLL
{
newReport.UnitId = ePSummaryReport.UnitId;
newReport.YearId = ePSummaryReport.YearId;
newReport.Quarter = ePSummaryReport.Quarter;
newReport.ResponsiblePerson = ePSummaryReport.ResponsiblePerson;
newReport.ResponsiblePersonTel = ePSummaryReport.ResponsiblePersonTel;
newReport.ContactPerson = ePSummaryReport.ContactPerson;

View File

@ -1775,6 +1775,7 @@
EPSummaryReportId = x.EPSummaryReportId,
UnitId = x.UnitId,
YearId = x.YearId,
Quarter = x.Quarter,
ResponsiblePerson = x.ResponsiblePerson,
ResponsiblePersonTel = x.ResponsiblePersonTel,
ContactPerson = x.ContactPerson,
@ -3286,4 +3287,4 @@
}
}
}

View File

@ -27,9 +27,9 @@ namespace BLL
/// <param name="unitId"></param>
/// <param name="yearId"></param>
/// <returns></returns>
public static Model.Information_EPSummaryReport GetEPSummaryReportByUnitIdAndYearId(string unitId, int yearId)
public static Model.Information_EPSummaryReport GetEPSummaryReportByUnitIdAndYearIdAndQuarters(string unitId, int yearId, int quarters)
{
return Funs.DB.Information_EPSummaryReport.FirstOrDefault(e => e.UnitId == unitId && e.YearId == yearId);
return Funs.DB.Information_EPSummaryReport.FirstOrDefault(e => e.UnitId == unitId && e.YearId == yearId && e.Quarter == quarters);
}
/// <summary>
@ -43,6 +43,7 @@ namespace BLL
EPSummaryReportId = ePSummaryReport.EPSummaryReportId,
UnitId = ePSummaryReport.UnitId,
YearId = ePSummaryReport.YearId,
Quarter = ePSummaryReport.Quarter,
ResponsiblePerson = ePSummaryReport.ResponsiblePerson,
ResponsiblePersonTel = ePSummaryReport.ResponsiblePersonTel,
ContactPerson = ePSummaryReport.ContactPerson,
@ -73,6 +74,7 @@ namespace BLL
{
newReport.UnitId = ePSummaryReport.UnitId;
newReport.YearId = ePSummaryReport.YearId;
newReport.Quarter = ePSummaryReport.Quarter;
newReport.ResponsiblePerson = ePSummaryReport.ResponsiblePerson;
newReport.ResponsiblePersonTel = ePSummaryReport.ResponsiblePersonTel;
newReport.ContactPerson = ePSummaryReport.ContactPerson;

View File

@ -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>

View File

@ -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);

View File

@ -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>

View File

@ -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>

View File

@ -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) ? BLL.Const.UnitId_CWCEC : 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;
}
}

View File

@ -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>

View File

@ -28,11 +28,14 @@
<f:DropDownList ID="drpYear" AutoPostBack="true" EnableSimulateTree="true" runat="server" Width="150px"
LabelWidth="50px" Label="年度" OnSelectedIndexChanged="drpUnit_SelectedIndexChanged">
</f:DropDownList>
<f:Button ID="BtnBulletLeft" ToolTip="前一年度" Text ="前一年度" Icon="BulletLeft" runat="server" EnablePostBack="true"
<f:DropDownList ID="drpQuarter" AutoPostBack="true" EnableSimulateTree="true" runat="server" Width="150px"
LabelWidth="50px" Label="季度" OnSelectedIndexChanged="drpUnit_SelectedIndexChanged">
</f:DropDownList>
<f:Button ID="BtnBulletLeft" ToolTip="前一季度" Text ="前一季度" Icon="BulletLeft" runat="server" EnablePostBack="true"
OnClick="BtnBulletLeft_Click">
</f:Button>
<f:Button ID="BtnBulletRight" ToolTip="后一年度" Text ="后一年度" Icon="BulletRight" runat="server" EnablePostBack="true"
OnClick="BtnBulletRight_Click">
<f:Button ID="BtnBulletRight" ToolTip="后一季度" Text="后一季度" Icon="BulletRight" runat="server" EnablePostBack="true"
OnClick="BulletRight_Click">
</f:Button>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnNew" ToolTip="新增" Text ="新增" Icon="Add" Hidden="true" runat="server" OnClick="btnNew_Click">
@ -53,10 +56,10 @@
<Rows>
<f:FormRow>
<Items>
<f:Label ID="lblUnitName" runat="server" Label="单位" Hidden="true">
</f:Label>
<f:Label ID="lblYearId" runat="server" Label="年度">
</f:Label>
</f:Label>
<f:Label ID="lblQuarter" runat="server" Label="季度">
</f:Label>
<f:Label ID="lblResponsiblePerson" runat="server" Label="负责人">
</f:Label>
<f:Label ID="lblResponsiblePersonTel" runat="server" Label="负责人电话">

View File

@ -40,12 +40,15 @@ namespace FineUIPro.Web.ZHGL.Information
drpYear.DataValueField = "ConstValue";
drpYear.DataSource = BLL.ConstValue.drpConstItemList(ConstValue.Group_0008);
drpYear.DataBind();
BLL.ConstValue.InitConstValueDropDownList(this.drpQuarter, ConstValue.Group_0011, false);
this.drpUnit.DataTextField = "UnitName";
drpUnit.DataValueField = "UnitId";
drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList();
drpUnit.DataBind();
this.drpUnit.Readonly = true;
drpYear.SelectedValue = System.DateTime.Now.Year.ToString();
DateTime showDate = System.DateTime.Now.AddMonths(-3);
this.drpQuarter.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString();
this.drpYear.SelectedValue = showDate.Year.ToString();
GetValue();
}
}
@ -58,8 +61,8 @@ namespace FineUIPro.Web.ZHGL.Information
private void SetEmpty()
{
this.SimpleForm1.Title = string.Empty;
lblUnitName.Text = string.Empty;
lblYearId.Text = string.Empty;
lblQuarter.Text = string.Empty;
lblResponsiblePerson.Text = string.Empty;
lblResponsiblePersonTel.Text = string.Empty;
lblContactPerson.Text = string.Empty;
@ -75,7 +78,8 @@ namespace FineUIPro.Web.ZHGL.Information
{
this.SetEmpty();
int year = Funs.GetNewIntOrZero(drpYear.SelectedValue);
Model.Information_EPSummaryReport report = Funs.DB.Information_EPSummaryReport.FirstOrDefault(e => e.UnitId == drpUnit.SelectedValue && e.YearId == year);
int quarter = Funs.GetNewIntOrZero(drpQuarter.SelectedValue);
Model.Information_EPSummaryReport report = Funs.DB.Information_EPSummaryReport.FirstOrDefault(e => e.UnitId == drpUnit.SelectedValue && e.YearId == year && e.Quarter == quarter);
if (report != null)
{
string upState = string.Empty;
@ -88,12 +92,8 @@ namespace FineUIPro.Web.ZHGL.Information
upState = "(未上报)";
}
this.SimpleForm1.Title = "生态环保工作总结报告" + upState;
if (!string.IsNullOrEmpty(report.UnitId))
{
this.lblUnitName.Text = BLL.UnitService.GetUnitNameByUnitId(report.UnitId);
}
this.lblYearId.Text = report.YearId.ToString();
this.lblYearId.Text = drpYear.SelectedItem.Text;
this.lblQuarter.Text = drpQuarter.SelectedItem.Text;
this.GetTxetValue(report);
}
else
@ -163,7 +163,7 @@ namespace FineUIPro.Web.ZHGL.Information
/// <param name="e"></param>
protected void btnNew_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("EPSummaryReportEdit.aspx?UnitId={0}&&Year={1}", this.CurrUser.UnitId, this.drpYear.SelectedValue, "编辑 - ")));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("EPSummaryReportEdit.aspx?UnitId={0}&Year={1}&Quarter={2}", this.CurrUser.UnitId, this.drpYear.SelectedValue, this.drpQuarter.SelectedValue, "编辑 - ")));
}
/// <summary>
@ -171,7 +171,8 @@ namespace FineUIPro.Web.ZHGL.Information
/// </summary>
private void ShowEdit()
{
Model.Information_EPSummaryReport report = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearId(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue));
int quarter = Funs.GetNewIntOrZero(drpQuarter.SelectedValue);
Model.Information_EPSummaryReport report = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearIdAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), quarter);
if (report == null)
{
Alert.ShowInTop("所选时间无报表记录!", MessageBoxIcon.Warning);
@ -207,7 +208,8 @@ namespace FineUIPro.Web.ZHGL.Information
/// <param name="e"></param>
protected void btnDelete_Click(object sender, EventArgs e)
{
Model.Information_EPSummaryReport report = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearId(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue));
int quarter = Funs.GetNewIntOrZero(drpQuarter.SelectedValue);
Model.Information_EPSummaryReport report = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearIdAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), quarter);
if (report != null)
{
BLL.LogService.AddSys_Log(this.CurrUser, this.lblYearId.Text, report.EPSummaryReportId, BLL.Const.EPSummaryReportMenuId, BLL.Const.BtnDelete);
@ -274,8 +276,8 @@ namespace FineUIPro.Web.ZHGL.Information
// this.btnPrint.Hidden = false;
//}
int year = Funs.GetNewIntOrZero(drpYear.SelectedValue);
//int quarter = Funs.GetNewIntOrZero(drpQuarter.SelectedValue);
var report = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearId(this.drpUnit.SelectedValue, year);
int quarter = Funs.GetNewIntOrZero(drpQuarter.SelectedValue);
var report = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearIdAndQuarters(this.drpUnit.SelectedValue, year, quarter);
//this.btnAudit1.Hidden = true;
//this.btnAudit2.Hidden = true;
//this.btnUpdata.Hidden = true;
@ -300,29 +302,51 @@ namespace FineUIPro.Web.ZHGL.Information
#endregion
#region
#region /
/// <summary>
/// 上一年
/// 前一季
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void BtnBulletLeft_Click(object sender, EventArgs e)
{
int y = Convert.ToInt32(drpYear.SelectedValue) - 1;
drpYear.SelectedValue = y.ToString();
GetValue();
SetMonthChange("-");
}
/// <summary>
/// 下一年
/// 后一季
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void BtnBulletRight_Click(object sender, EventArgs e)
protected void BulletRight_Click(object sender, EventArgs e)
{
int y = Convert.ToInt32(drpYear.SelectedValue) + 1;
drpYear.SelectedValue = y.ToString();
GetValue();
SetMonthChange("+");
}
/// <summary>
/// 季度加减变化
/// </summary>
/// <param name="type"></param>
private void SetMonthChange(string type)
{
DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + (Funs.GetNewIntOrZero(this.drpQuarter.SelectedValue) * 3).ToString());
if (nowDate.HasValue)
{
DateTime showDate = new DateTime();
if (type == "+")
{
showDate = nowDate.Value.AddMonths(3);
}
else
{
showDate = nowDate.Value.AddMonths(-3);
}
this.drpYear.SelectedValue = showDate.Year.ToString();
this.drpQuarter.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString();
///值变化
GetValue();
}
}
#endregion
@ -336,6 +360,7 @@ namespace FineUIPro.Web.ZHGL.Information
{
string info = string.Empty;
int date = Convert.ToInt32(this.drpYear.SelectedValue);
int quarter = Funs.GetNewIntOrZero(drpQuarter.SelectedValue);
var projects = (from x in Funs.DB.Base_Project
where (x.ProjectState == BLL.Const.ProjectState_1 || x.ProjectState == null)
&& x.ProjectAttribute == "GONGCHENG"
@ -343,7 +368,7 @@ namespace FineUIPro.Web.ZHGL.Information
select x).ToList();
foreach (var item in projects)
{
var report = Funs.DB.InformationProject_EPSummaryReport.FirstOrDefault(x => x.ProjectId == item.ProjectId && x.YearId == date);
var report = Funs.DB.InformationProject_EPSummaryReport.FirstOrDefault(x => x.ProjectId == item.ProjectId && x.YearId == date && x.Quarter == quarter);
if (report == null)
{
info += item.ProjectCode + ":" + item.ProjectName + ",未填写报表;</br>";

View File

@ -84,6 +84,15 @@ namespace FineUIPro.Web.ZHGL.Information {
/// </remarks>
protected global::FineUIPro.DropDownList drpYear;
/// <summary>
/// drpQuarter 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpQuarter;
/// <summary>
/// BtnBulletLeft 控件。
/// </summary>
@ -147,15 +156,6 @@ namespace FineUIPro.Web.ZHGL.Information {
/// </remarks>
protected global::FineUIPro.Button btnView;
/// <summary>
/// lblUnitName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lblUnitName;
/// <summary>
/// lblYearId 控件。
/// </summary>
@ -165,6 +165,15 @@ namespace FineUIPro.Web.ZHGL.Information {
/// </remarks>
protected global::FineUIPro.Label lblYearId;
/// <summary>
/// lblQuarter 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lblQuarter;
/// <summary>
/// lblResponsiblePerson 控件。
/// </summary>

View File

@ -14,12 +14,14 @@
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow ColumnWidths="50% 25% 25%">
<f:FormRow>
<Items>
<f:DropDownList ID="ddlUnitId" runat="server" Label="单位" Required="True" ShowRedStar="True" FocusOnPageLoad="true">
</f:DropDownList>
<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>
@ -125,7 +127,7 @@
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server" Margin="0 50 30 50">
<Items>
<f:Button ID="btnCopy" Icon="Database" runat="server" ToolTip="复制上年度数据" Text="复制上年度数据"
<f:Button ID="btnCopy" Icon="Database" runat="server" ToolTip="复制上季度数据" Text="复制上季度数据"
ValidateForms="SimpleForm1" OnClick="btnCopy_Click" Hidden="true">
</f:Button>
<f:ToolbarFill runat="server"></f:ToolbarFill>

View File

@ -45,9 +45,15 @@ namespace FineUIPro.Web.ZHGL.Information
ddlYearId.DataSource = BLL.ConstValue.drpConstItemList(ConstValue.Group_0008);
ddlYearId.DataBind();
this.ddlQuarter.DataTextField = "ConstText";
ddlQuarter.DataValueField = "ConstValue";
ddlQuarter.DataSource = BLL.ConstValue.drpConstItemList(ConstValue.Group_0011);
ddlQuarter.DataBind();
this.ddlUnitId.Readonly = true;
string unitId = Request.Params["UnitId"];
string year = Request.QueryString["Year"];
string quarter = Request.QueryString["Quarter"];
this.EPSummaryReportId = Request.Params["EPSummaryReportId"];
if (!string.IsNullOrEmpty(this.EPSummaryReportId))
{
@ -66,6 +72,10 @@ namespace FineUIPro.Web.ZHGL.Information
this.ddlUnitId.SelectedValue = report.UnitId;
}
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;
@ -88,6 +98,7 @@ namespace FineUIPro.Web.ZHGL.Information
this.btnCopy.Hidden = false;
this.ddlUnitId.SelectedValue = unitId;
this.ddlYearId.SelectedValue = year;
this.ddlQuarter.SelectedValue = quarter;
this.txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
#region
@ -97,7 +108,7 @@ namespace FineUIPro.Web.ZHGL.Information
string description4 = string.Empty;
string description5 = string.Empty;
string description6 = string.Empty;
string description7= string.Empty;
string description7 = string.Empty;
string description8 = string.Empty;
string description9 = string.Empty;
@ -109,7 +120,7 @@ namespace FineUIPro.Web.ZHGL.Information
select x).ToList();
foreach (var item in projects)
{
var report = Funs.DB.InformationProject_EPSummaryReport.FirstOrDefault(x => x.ProjectId == item.ProjectId && x.YearId == date);
var report = Funs.DB.InformationProject_EPSummaryReport.FirstOrDefault(x => x.ProjectId == item.ProjectId && x.YearId == date && x.Quarter.ToString() == quarter);
if (report != null)
{
description1 += item.ProjectName + "\r\n" + report.Description1 + "\r\n";
@ -160,6 +171,15 @@ namespace FineUIPro.Web.ZHGL.Information
ShowNotify("请选择年度!", MessageBoxIcon.Warning);
return;
}
if (this.ddlQuarter.SelectedValue != BLL.Const._Null)
{
report.Quarter = Funs.GetNewIntOrZero(this.ddlQuarter.SelectedValue);
}
else
{
ShowNotify("请选择年度!", MessageBoxIcon.Warning);
return;
}
report.ResponsiblePerson = this.txtResponsiblePerson.Text.Trim();
report.ResponsiblePersonTel = this.txtResponsiblePersonTel.Text.Trim();
report.ContactPerson = this.txtContactPerson.Text.Trim();
@ -174,9 +194,10 @@ namespace FineUIPro.Web.ZHGL.Information
report.Description7 = this.txtDescription7.Text.Trim();
report.Description8 = this.txtDescription8.Text.Trim();
report.Description9 = this.txtDescription9.Text.Trim();
int quarter = Funs.GetNewIntOrZero(ddlQuarter.SelectedValue);
if (string.IsNullOrEmpty(this.EPSummaryReportId))
{
var s = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearId(this.ddlUnitId.SelectedValue, Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue));
var s = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearIdAndQuarters(this.ddlUnitId.SelectedValue, Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue), quarter);
if (s != null)
{
ShowNotify("该单位的该年度的该生态环保工作总结报告已经存在,不能重复编制!", MessageBoxIcon.Warning);
@ -247,12 +268,20 @@ namespace FineUIPro.Web.ZHGL.Information
/// <param name="e"></param>
protected void btnCopy_Click(object sender, EventArgs e)
{
int lastYear = 0;
int lastYear = 0, lastQuarter = 0;
int year = Convert.ToInt32(this.ddlYearId.SelectedValue);
lastYear = year - 1;
Model.Information_EPSummaryReport report = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearId(this.ddlUnitId.SelectedValue, lastYear);
int quarter = Convert.ToInt32(this.ddlQuarter.SelectedValue);
if (quarter == 1)
{
lastYear = year - 1;
lastQuarter = 4;
}
else
{
lastYear = year;
lastQuarter = quarter - 1;
}
Model.Information_EPSummaryReport report = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearIdAndQuarters(this.ddlUnitId.SelectedValue, lastYear, lastQuarter);
if (report != null)
{
Model.Information_EPSummaryReport newReport = new Model.Information_EPSummaryReport();

View File

@ -57,6 +57,15 @@ namespace FineUIPro.Web.ZHGL.Information {
/// </remarks>
protected global::FineUIPro.DropDownList ddlYearId;
/// <summary>
/// ddlQuarter 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlQuarter;
/// <summary>
/// txtReportDate 控件。
/// </summary>

View File

@ -38,6 +38,15 @@ namespace Model
set;
}
/// <summary>
/// 季度
/// </summary>
public int? Quarter
{
get;
set;
}
/// <summary>
///
/// </summary>

View File

@ -29,11 +29,7 @@ namespace Model
#region
partial void OnCreated();
partial void OnCreated()
{
this.CommandTimeout = 3600;
}
partial void InsertAccident_AccidentHandle(Accident_AccidentHandle instance);
partial void InsertAccident_AccidentHandle(Accident_AccidentHandle instance);
partial void UpdateAccident_AccidentHandle(Accident_AccidentHandle instance);
partial void DeleteAccident_AccidentHandle(Accident_AccidentHandle instance);
partial void InsertAccident_AccidentPersonRecord(Accident_AccidentPersonRecord instance);
@ -175223,6 +175219,8 @@ namespace Model
private string _UpState;
private System.Nullable<int> _Quarter;
private EntityRef<Base_Unit> _Base_Unit;
#region
@ -175265,6 +175263,8 @@ namespace Model
partial void OnDescription9Changed();
partial void OnUpStateChanging(string value);
partial void OnUpStateChanged();
partial void OnQuarterChanging(System.Nullable<int> value);
partial void OnQuarterChanged();
#endregion
public Information_EPSummaryReport()
@ -175637,6 +175637,26 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Quarter", DbType="Int")]
public System.Nullable<int> Quarter
{
get
{
return this._Quarter;
}
set
{
if ((this._Quarter != value))
{
this.OnQuarterChanging(value);
this.SendPropertyChanging();
this._Quarter = value;
this.SendPropertyChanged("Quarter");
this.OnQuarterChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Information_EPSummaryReport_Base_Unit", Storage="_Base_Unit", ThisKey="UnitId", OtherKey="UnitId", IsForeignKey=true)]
public Base_Unit Base_Unit
{
@ -186906,6 +186926,8 @@ namespace Model
private string _Description9;
private System.Nullable<int> _Quarter;
private EntityRef<Base_Project> _Base_Project;
private EntityRef<Base_Unit> _Base_Unit;
@ -186950,6 +186972,8 @@ namespace Model
partial void OnDescription8Changed();
partial void OnDescription9Changing(string value);
partial void OnDescription9Changed();
partial void OnQuarterChanging(System.Nullable<int> value);
partial void OnQuarterChanged();
#endregion
public InformationProject_EPSummaryReport()
@ -187327,6 +187351,26 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Quarter", DbType="Int")]
public System.Nullable<int> Quarter
{
get
{
return this._Quarter;
}
set
{
if ((this._Quarter != value))
{
this.OnQuarterChanging(value);
this.SendPropertyChanging();
this._Quarter = value;
this.SendPropertyChanged("Quarter");
this.OnQuarterChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_InformationProject_EPSummaryReport_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)]
public Base_Project Base_Project
{