diff --git a/DataBase/版本日志/SGGLDB_V2025-09-01-001-gaofei.sql b/DataBase/版本日志/SGGLDB_V2025-09-01-001-gaofei.sql new file mode 100644 index 00000000..18367a55 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2025-09-01-001-gaofei.sql @@ -0,0 +1,69 @@ +alter table [dbo].[Environmental_ArchitectureReport] drop column Quarters +GO +alter table [dbo].[Environmental_ArchitectureReport] add Month int null +GO +alter table [dbo].[Environmental_ProjectArchitectureReport] drop column Quarters +GO +alter table [dbo].[Environmental_ProjectArchitectureReport] add Month int null +GO + +/*************ҵԴԼ̬ܱ**************/ +ALTER VIEW [dbo].[View_Environmental_ArchitectureReport] +AS +SELECT +Report.ArchitectureReportId, +Report.UnitId, +Report.FillingDate, +(ISNULL(Group_0008.ConstText,'-') + ISNULL(Group_0009.ConstText,'-')) AS ReportDate, +Group_0008.ConstText as YearStr, +Group_0009.ConstText as MonthStr, +U.UnitName, +Report.Year, +Report.Month, +Report.UpState, +Report.DutyPerson +FROM dbo.Environmental_ArchitectureReport AS Report +LEFT JOIN Base_Unit AS U ON U.UnitId=Report.UnitId +LEFT JOIN Sys_Const AS Group_0008 ON Group_0008.GroupId='0008' AND Group_0008.ConstValue =Report.[Year] +LEFT JOIN Sys_Const AS Group_0009 ON Group_0009.GroupId='0009' AND Group_0009.ConstValue =Report.[Month] + + + + + + + +GO + + + +/*************ҵԴԼ̬ܱ**************/ +ALTER VIEW [dbo].[View_Environmental_ProjectArchitectureReport] +AS +SELECT +Report.ArchitectureReportId, +Report.ProjectId, +Report.FillingDate, +(ISNULL(Group_0008.ConstText,'-') + ISNULL(Group_0009.ConstText,'-')) AS ReportDate, +Group_0008.ConstText as YearStr, +Group_0009.ConstText as MonthStr, +U.ProjectName, +Report.Year, +Report.Month, +Report.UpState, +Report.DutyPerson +FROM dbo.Environmental_ProjectArchitectureReport AS Report +LEFT JOIN Base_Project AS U ON U.ProjectId=Report.ProjectId +LEFT JOIN Sys_Const AS Group_0008 ON Group_0008.GroupId='0008' AND Group_0008.ConstValue =Report.[Year] +LEFT JOIN Sys_Const AS Group_0009 ON Group_0009.GroupId='0009' AND Group_0009.ConstValue =Report.[Month] + + + + + + + + +GO + + diff --git a/SGGL/BLL/WebService/CNCECHSSEWebService.cs b/SGGL/BLL/WebService/CNCECHSSEWebService.cs index 2f314f9b..17f8f2b4 100644 --- a/SGGL/BLL/WebService/CNCECHSSEWebService.cs +++ b/SGGL/BLL/WebService/CNCECHSSEWebService.cs @@ -910,7 +910,7 @@ ArchitectureReportId = x.ArchitectureReportId, UnitId = x.UnitId, Year = x.Year, - Quarters = x.Quarters, + Month = x.Month, FillingMan = x.FillingMan, FillingDate = x.FillingDate, DutyPerson = x.DutyPerson, @@ -946,7 +946,7 @@ ////更新 当前人要处理的意见 ProjectDataFlowSetService.CloseFlowOperate(Const.ArchitectureReportMenuId, item, string.Empty); // //更新催报信息 - UrgeReportService.SetComplete(report.UnitId, Const.ReportType_1, report.Year.ToString(), report.Quarters.ToString()); + UrgeReportService.SetComplete(report.UnitId, Const.ReportType_1, report.Year.ToString(), report.Month.ToString()); } } LogService.AddSys_Log(CurrUser, "【建筑行业能源节约与生态环境保护汇总表】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.ArchitectureReportMenuId, BLL.Const.BtnUploadResources); diff --git a/SGGL/BLL/ZHGL/Environmental/ArchitectureReportItemService.cs b/SGGL/BLL/ZHGL/Environmental/ArchitectureReportItemService.cs index 39c5b065..1055883f 100644 --- a/SGGL/BLL/ZHGL/Environmental/ArchitectureReportItemService.cs +++ b/SGGL/BLL/ZHGL/Environmental/ArchitectureReportItemService.cs @@ -57,12 +57,12 @@ namespace BLL /// /// 建筑行业能源节约与生态环境保护汇总明细表Id /// 明细记录集合 - public static List GetYearSumItems(string unitId, int? year, int? Quarters) + public static List GetYearSumItems(string unitId, int? year, int? Month) { return (from x in Funs.DB.Environmental_ArchitectureReportItem join y in Funs.DB.Environmental_ArchitectureReport on x.ArchitectureReportId equals y.ArchitectureReportId - where y.UnitId == unitId && y.Year == year && y.Quarters == Quarters + where y.UnitId == unitId && y.Year == year && y.Month == Month orderby x.SortIndex select x).Distinct().ToList(); } diff --git a/SGGL/BLL/ZHGL/Environmental/ArchitectureReportService.cs b/SGGL/BLL/ZHGL/Environmental/ArchitectureReportService.cs index 1291c72b..9c66875b 100644 --- a/SGGL/BLL/ZHGL/Environmental/ArchitectureReportService.cs +++ b/SGGL/BLL/ZHGL/Environmental/ArchitectureReportService.cs @@ -25,9 +25,9 @@ namespace BLL /// 年度 /// 月份 /// 建筑行业能源节约与生态环境保护汇总表 - public static Model.Environmental_ArchitectureReport GetArchitectureReportByUnitIdAndYearAndQuarters(string unitId, int year, int Quarters) + public static Model.Environmental_ArchitectureReport GetArchitectureReportByUnitIdAndYearAndQuarters(string unitId, int year, int month) { - return Funs.DB.Environmental_ArchitectureReport.FirstOrDefault(e => e.UnitId == unitId && e.Quarters == Quarters && e.Year == year); + return Funs.DB.Environmental_ArchitectureReport.FirstOrDefault(e => e.UnitId == unitId && e.Month == month && e.Year == year); } /// @@ -50,7 +50,7 @@ namespace BLL { ArchitectureReportId = ArchitectureReport.ArchitectureReportId, Year = ArchitectureReport.Year, - Quarters = ArchitectureReport.Quarters, + Month = ArchitectureReport.Month, UnitId = ArchitectureReport.UnitId, FillingDate = ArchitectureReport.FillingDate, DutyPerson = ArchitectureReport.DutyPerson, @@ -72,7 +72,7 @@ namespace BLL if (newArchitectureReport != null) { newArchitectureReport.Year = ArchitectureReport.Year; - newArchitectureReport.Quarters = ArchitectureReport.Quarters; + newArchitectureReport.Month = ArchitectureReport.Month; newArchitectureReport.UnitId = ArchitectureReport.UnitId; newArchitectureReport.FillingDate = ArchitectureReport.FillingDate; newArchitectureReport.DutyPerson = ArchitectureReport.DutyPerson; @@ -83,7 +83,7 @@ namespace BLL } /// - /// 根据Id获取数据 + /// 根据Id删除数据 /// /// public static void DeleteArchitectureReportByArchitectureReportId(string ArchitectureReportId) @@ -101,9 +101,9 @@ namespace BLL /// /// Id /// - public static Model.Environmental_ArchitectureReport GetArchitectureReportByUnitIdDate(string unitId, int year, int Quarters) + public static Model.Environmental_ArchitectureReport GetArchitectureReportByUnitIdDate(string unitId, int year, int month) { - return Funs.DB.Environmental_ArchitectureReport.FirstOrDefault(e => e.UnitId == unitId && e.Year == year && e.Quarters == Quarters); + return Funs.DB.Environmental_ArchitectureReport.FirstOrDefault(e => e.UnitId == unitId && e.Year == year && e.Month == month); } /// diff --git a/SGGL/BLL/ZHGL/Environmental/ProjectArchitectureReportItemService.cs b/SGGL/BLL/ZHGL/Environmental/ProjectArchitectureReportItemService.cs index c77217ed..8d464322 100644 --- a/SGGL/BLL/ZHGL/Environmental/ProjectArchitectureReportItemService.cs +++ b/SGGL/BLL/ZHGL/Environmental/ProjectArchitectureReportItemService.cs @@ -57,12 +57,12 @@ namespace BLL /// /// 建筑行业能源节约与生态环境保护汇总明细表Id /// 明细记录集合 - public static List GetYearSumItems(string projectId, int? year, int? Quarters) + public static List GetYearSumItems(string projectId, int? year, int? Month) { return (from x in Funs.DB.Environmental_ProjectArchitectureReportItem join y in Funs.DB.Environmental_ProjectArchitectureReport on x.ArchitectureReportId equals y.ArchitectureReportId - where y.ProjectId == projectId && y.Year == year && y.Quarters == Quarters + where y.ProjectId == projectId && y.Year == year && y.Month == Month orderby x.SortIndex select x).Distinct().ToList(); } diff --git a/SGGL/BLL/ZHGL/Environmental/ProjectArchitectureReportService.cs b/SGGL/BLL/ZHGL/Environmental/ProjectArchitectureReportService.cs index d58f1236..4df36456 100644 --- a/SGGL/BLL/ZHGL/Environmental/ProjectArchitectureReportService.cs +++ b/SGGL/BLL/ZHGL/Environmental/ProjectArchitectureReportService.cs @@ -25,9 +25,9 @@ namespace BLL /// 年度 /// 月份 /// 建筑行业能源节约与生态环境保护汇总表 - public static Model.Environmental_ProjectArchitectureReport GetArchitectureReportByProjectIdAndYearAndQuarters(string projectId, int year, int Quarters) + public static Model.Environmental_ProjectArchitectureReport GetArchitectureReportByProjectIdAndYearAndQuarters(string projectId, int year, int Month) { - return Funs.DB.Environmental_ProjectArchitectureReport.FirstOrDefault(e => e.ProjectId == projectId && e.Quarters == Quarters && e.Year == year); + return Funs.DB.Environmental_ProjectArchitectureReport.FirstOrDefault(e => e.ProjectId == projectId && e.Month == Month && e.Year == year); } /// @@ -50,7 +50,7 @@ namespace BLL { ArchitectureReportId = ArchitectureReport.ArchitectureReportId, Year = ArchitectureReport.Year, - Quarters = ArchitectureReport.Quarters, + Month = ArchitectureReport.Month, ProjectId = ArchitectureReport.ProjectId, FillingDate = ArchitectureReport.FillingDate, DutyPerson = ArchitectureReport.DutyPerson, @@ -72,7 +72,7 @@ namespace BLL if (newArchitectureReport != null) { newArchitectureReport.Year = ArchitectureReport.Year; - newArchitectureReport.Quarters = ArchitectureReport.Quarters; + newArchitectureReport.Month = ArchitectureReport.Month; newArchitectureReport.ProjectId = ArchitectureReport.ProjectId; newArchitectureReport.FillingDate = ArchitectureReport.FillingDate; newArchitectureReport.DutyPerson = ArchitectureReport.DutyPerson; @@ -101,9 +101,9 @@ namespace BLL /// /// Id /// - public static Model.Environmental_ProjectArchitectureReport GetArchitectureReportByProjectIdDate(string ProjectId, int year, int Quarters) + public static Model.Environmental_ProjectArchitectureReport GetArchitectureReportByProjectIdDate(string ProjectId, int year, int Month) { - return Funs.DB.Environmental_ProjectArchitectureReport.FirstOrDefault(e => e.ProjectId == ProjectId && e.Year == year && e.Quarters == Quarters); + return Funs.DB.Environmental_ProjectArchitectureReport.FirstOrDefault(e => e.ProjectId == ProjectId && e.Year == year && e.Month == Month); } /// diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReport.aspx b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReport.aspx index 98f0cbc8..af8f3244 100644 --- a/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReport.aspx +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReport.aspx @@ -36,13 +36,13 @@ - + - - @@ -65,6 +65,12 @@ + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReport.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReport.aspx.cs index 0a0aa25a..050823ba 100644 --- a/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReport.aspx.cs +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReport.aspx.cs @@ -16,17 +16,24 @@ namespace FineUIPro.Web.ZHGL.Environmental if (!IsPostBack) { - BLL.ConstValue.InitConstValueDropDownList(this.drpQuarters, ConstValue.Group_0011, false); + BLL.ConstValue.InitConstValueDropDownList(this.drpMonth, ConstValue.Group_0009, false); BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, false); - + if (this.CurrUser.PersonId == BLL.Const.hfnbdId) + { + this.btnState.Hidden = false; + } + else + { + this.btnState.Hidden = true; + } this.drpUnit.DataTextField = "UnitName"; drpUnit.DataValueField = "UnitId"; drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList(); drpUnit.DataBind(); this.drpUnit.Readonly = true; ////取上个报表时间 - DateTime showDate = System.DateTime.Now.AddMonths(-3); - this.drpQuarters.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString(); + DateTime showDate = System.DateTime.Now.AddMonths(-1); + drpMonth.SelectedValue = showDate.Month.ToString(); drpYear.SelectedValue = showDate.Year.ToString(); GetValue(); } @@ -48,8 +55,8 @@ namespace FineUIPro.Web.ZHGL.Environmental private void GetValue() { int year = Funs.GetNewIntOrZero(drpYear.SelectedValue); - int Quarters = Funs.GetNewIntOrZero(drpQuarters.SelectedValue); - Model.Environmental_ArchitectureReport r = Funs.DB.Environmental_ArchitectureReport.FirstOrDefault(e => e.UnitId == drpUnit.SelectedValue && e.Quarters == Quarters && e.Year == year); + int month = Funs.GetNewIntOrZero(drpMonth.SelectedValue); + Model.Environmental_ArchitectureReport r = Funs.DB.Environmental_ArchitectureReport.FirstOrDefault(e => e.UnitId == drpUnit.SelectedValue && e.Month == month && e.Year == year); if (r != null && r.UpState != BLL.Const.UpState_5) { string cncecAPIUrl = string.Empty; @@ -62,7 +69,7 @@ namespace FineUIPro.Web.ZHGL.Environmental { try { - string getUrl = cncecAPIUrl + "/api/InformationData/GetArchitectureAuditState" + "?unitId=" + BLL.Const.UnitId_SEDIN + "&year=" + year + "&quarters=" + Quarters; + string getUrl = cncecAPIUrl + "/api/InformationData/GetArchitectureAuditState" + "?unitId=" + BLL.Const.UnitId_SEDIN + "&year=" + year + "&month=" + month; var strJosn = APIGetHttpService.Http(getUrl); if (!string.IsNullOrEmpty(strJosn)) { @@ -79,7 +86,7 @@ namespace FineUIPro.Web.ZHGL.Environmental } } } - Model.View_Environmental_ArchitectureReport report = Funs.DB.View_Environmental_ArchitectureReport.FirstOrDefault(e => e.UnitId == drpUnit.SelectedValue && e.Quarters == Quarters && e.Year == year); + Model.View_Environmental_ArchitectureReport report = Funs.DB.View_Environmental_ArchitectureReport.FirstOrDefault(e => e.UnitId == drpUnit.SelectedValue && e.Month == month && e.Year == year); if (report != null) { string upState = string.Empty; @@ -95,7 +102,7 @@ namespace FineUIPro.Web.ZHGL.Environmental { upState = "(未上报)"; } - this.SimpleForm1.Title = "企业建筑行业能源节约与生态环境保护汇总表" + report.QuartersStr + report.YearStr + upState; + this.SimpleForm1.Title = "企业建筑行业能源节约与生态环境保护汇总表" + report.MonthStr + report.YearStr + upState; lbUnitName.Text = "填报企业:" + report.UnitName; if (report.FillingDate != null) { @@ -214,7 +221,7 @@ namespace FineUIPro.Web.ZHGL.Environmental } } - var getReport = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + var getReport = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); this.btnAudit1.Hidden = true; this.btnAudit2.Hidden = true; if (getReport != null) @@ -249,7 +256,7 @@ namespace FineUIPro.Web.ZHGL.Environmental /// protected void btnNew_Click(object sender, EventArgs e) { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ArchitectureReportSave.aspx?UnitId={0}&&Year={1}&&Quarterss={2}", this.CurrUser.UnitId, this.drpYear.SelectedValue, this.drpQuarters.SelectedValue, "编辑 - "))); + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ArchitectureReportSave.aspx?UnitId={0}&&Year={1}&&Months={2}", this.CurrUser.UnitId, this.drpYear.SelectedValue, this.drpMonth.SelectedValue, "编辑 - "))); } /// @@ -259,7 +266,7 @@ namespace FineUIPro.Web.ZHGL.Environmental /// protected void btnEdit_Click(object sender, EventArgs e) { - Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); if (report != null) { PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ArchitectureReportSave.aspx?ArchitectureReportId={0}", report.ArchitectureReportId, "编辑 - "))); @@ -277,7 +284,7 @@ namespace FineUIPro.Web.ZHGL.Environmental /// protected void btnAudit1_Click(object sender, EventArgs e) { - Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); if (report != null) { PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ArchitectureReportSave.aspx?ArchitectureReportId={0}", report.ArchitectureReportId, "编辑 - "))); @@ -295,7 +302,7 @@ namespace FineUIPro.Web.ZHGL.Environmental /// protected void btnAudit2_Click(object sender, EventArgs e) { - Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); if (report != null) { PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ArchitectureReportSave.aspx?ArchitectureReportId={0}", report.ArchitectureReportId, "编辑 - "))); @@ -313,7 +320,7 @@ namespace FineUIPro.Web.ZHGL.Environmental /// protected void btnUpdata_Click(object sender, EventArgs e) { - Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); if (report != null) { PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ArchitectureReportSave.aspx?ArchitectureReportId={0}&type=Updata", report.ArchitectureReportId, "编辑 - "))); @@ -331,10 +338,10 @@ namespace FineUIPro.Web.ZHGL.Environmental /// protected void btnDelete_Click(object sender, EventArgs e) { - Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); if (report != null) { - BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Quarters.ToString(), report.ArchitectureReportId, BLL.Const.ArchitectureReportMenuId, BLL.Const.BtnDelete); + BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Month.ToString(), report.ArchitectureReportId, BLL.Const.ArchitectureReportMenuId, BLL.Const.BtnDelete); BLL.ProjectDataFlowSetService.DeleteFlowSetByDataId(report.ArchitectureReportId); BLL.ArchitectureReportItemService.DeleteArchitectureReportItemByArchitectureReportId(report.ArchitectureReportId); BLL.ArchitectureReportService.DeleteArchitectureReportByArchitectureReportId(report.ArchitectureReportId); @@ -377,7 +384,7 @@ namespace FineUIPro.Web.ZHGL.Environmental Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByArchitectureReportId(ArchitectureReportId.ToString()); if (report != null) { - return report.Year + "年" + report.Quarters + "月"; + return report.Year + "年" + report.Month + "月"; } } return ""; @@ -414,7 +421,7 @@ namespace FineUIPro.Web.ZHGL.Environmental /// protected void BtnBulletLeft_Click(object sender, EventArgs e) { - SetQuartersChange("-"); + SetMonthChange("-"); } /// @@ -424,30 +431,30 @@ namespace FineUIPro.Web.ZHGL.Environmental /// protected void BulletRight_Click(object sender, EventArgs e) { - SetQuartersChange("+"); + SetMonthChange("+"); } /// /// 月份加减变化 /// /// - private void SetQuartersChange(string type) + private void SetMonthChange(string type) { - DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + (Funs.GetNewIntOrZero(this.drpQuarters.SelectedValue) * 3).ToString()); + DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + this.drpMonth.SelectedValue); if (nowDate.HasValue) { DateTime showDate = new DateTime(); if (type == "+") { - showDate = nowDate.Value.AddMonths(3); + showDate = nowDate.Value.AddMonths(1); } else { - showDate = nowDate.Value.AddMonths(-3); + showDate = nowDate.Value.AddMonths(-1); } this.drpYear.SelectedValue = showDate.Year.ToString(); - this.drpQuarters.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString(); + drpMonth.SelectedValue = showDate.Month.ToString(); ///值变化 GetValue(); } @@ -462,7 +469,7 @@ namespace FineUIPro.Web.ZHGL.Environmental /// protected void btnSee_Click(object sender, EventArgs e) { - Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); if (report != null) { PageContext.RegisterStartupScript(Window4.GetShowReference(String.Format("ReportAuditSee.aspx?Id={0}", report.ArchitectureReportId, "查看 - "))); @@ -667,5 +674,72 @@ namespace FineUIPro.Web.ZHGL.Environmental } #endregion #endregion + + #region 查看未上报的项目 + /// + /// 查看未上报的项目 + /// + /// + /// + protected void btnView_Click(object sender, EventArgs e) + { + string info = string.Empty; + int year = Funs.GetNewIntOrZero(drpYear.SelectedValue); + int month = Funs.GetNewIntOrZero(drpMonth.SelectedValue); + var projects = (from x in Funs.DB.Base_Project + where (x.ProjectState == BLL.Const.ProjectState_1 || x.ProjectState == null) + select x).ToList(); + foreach (var item in projects) + { + var projectArchitectureReport = Funs.DB.Environmental_ProjectArchitectureReport.FirstOrDefault(x => x.ProjectId == item.ProjectId && x.Year == year && x.Month == month); + if (projectArchitectureReport == null) + { + info += item.ProjectName + ",未填写报表;
"; + } + else + { + if (projectArchitectureReport.UpState != BLL.Const.State_2) + { + info += item.ProjectName + "报表未报;"; + var flows = (from x in Funs.DB.Sys_FlowOperate + join y in Funs.DB.Person_Persons on x.OperaterId equals y.PersonId + where x.DataId == projectArchitectureReport.ArchitectureReportId && x.IsClosed != false + select y).FirstOrDefault(); + if (flows != null) + { + info += "待" + flows.PersonName + "处理;"; + } + info += "
"; + } + } + } + + if (!string.IsNullOrEmpty(info)) + { + Alert.ShowInTop(info + "项目报表未上报。", MessageBoxIcon.Warning); + } + else + { + ShowNotify("项目报表已上报", MessageBoxIcon.Success); + } + + } + #endregion + + #region 恢复未上报状态 + /// + /// 恢复未上报状态 + /// + /// + /// + protected void btnState_Click(object sender, EventArgs e) + { + Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); + report.UpState = "2"; + BLL.ArchitectureReportService.UpdateArchitectureReport(report); + ShowNotify("恢复成功!", MessageBoxIcon.Success); + GetValue(); + } + #endregion } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReport.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReport.aspx.designer.cs index 45dd9dfd..b82157b8 100644 --- a/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReport.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReport.aspx.designer.cs @@ -85,13 +85,13 @@ namespace FineUIPro.Web.ZHGL.Environmental { protected global::FineUIPro.DropDownList drpYear; /// - /// drpQuarters 控件。 + /// drpMonth 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.DropDownList drpQuarters; + protected global::FineUIPro.DropDownList drpMonth; /// /// BtnBulletLeft 控件。 @@ -183,6 +183,24 @@ namespace FineUIPro.Web.ZHGL.Environmental { /// protected global::FineUIPro.Button btnUpdata; + /// + /// btnView 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnView; + + /// + /// btnState 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnState; + /// /// lbUnitName 控件。 /// diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx index ce5b7d87..8c0a3b39 100644 --- a/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx @@ -36,8 +36,8 @@ - + diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx.cs index 7961c16d..9e9de818 100644 --- a/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx.cs +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx.cs @@ -48,7 +48,7 @@ namespace FineUIPro.Web.ZHGL.Environmental this.GetButtonPower(); } items.Clear(); - BLL.ConstValue.InitConstValueDropDownList(this.drpQuarters, ConstValue.Group_0011, false); + BLL.ConstValue.InitConstValueDropDownList(this.drpMonth, ConstValue.Group_0009, false); BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, false); this.drpUnit.DataTextField = "UnitName"; drpUnit.DataValueField = "UnitId"; @@ -57,7 +57,7 @@ namespace FineUIPro.Web.ZHGL.Environmental this.drpUnit.Readonly = true; string unitId = Request.QueryString["UnitId"]; string year = Request.QueryString["Year"]; - string quarters = Request.QueryString["Quarterss"]; + string months = Request.QueryString["Months"]; ArchitectureReportId = Request.QueryString["ArchitectureReportId"]; if (!string.IsNullOrEmpty(Request.QueryString["type"])) { @@ -87,7 +87,7 @@ namespace FineUIPro.Web.ZHGL.Environmental this.btnSave.Hidden = true; this.btnUpdata.Hidden = true; } - drpQuarters.SelectedValue = report.Quarters.ToString(); + drpMonth.SelectedValue = report.Month.ToString(); drpYear.SelectedValue = report.Year.ToString(); drpUnit.SelectedValue = report.UnitId; if (report.FillingDate != null) @@ -100,23 +100,23 @@ namespace FineUIPro.Web.ZHGL.Environmental else { //this.btnCopy.Hidden = false; - drpQuarters.SelectedValue = quarters; + drpMonth.SelectedValue = months; drpYear.SelectedValue = year; txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); txtDutyPerson.Text = this.CurrUser.PersonName; //增加明细集合 - GetNewItems(year, quarters); + GetNewItems(year, months); this.Grid1.DataSource = items; this.Grid1.DataBind(); } SetUnEditableRow(); - GetData(); + GetData(true); } else { if (GetRequestEventArgument() == "UPDATE_SUMMARY") { - GetData(); + GetData(false); } } } @@ -150,266 +150,81 @@ namespace FineUIPro.Web.ZHGL.Environmental Grid1.Rows[58].CellCssClasses[4] = "f-grid-cell-uneditable"; Grid1.Rows[58].CellCssClasses[5] = "f-grid-cell-uneditable"; } - var lastYearReport = ArchitectureReportService.GetArchitectureReportByUnitIdYear(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue) - 1); - if (lastYearReport.Count > 0) + if (string.IsNullOrEmpty(ArchitectureReportId)) { - var lastYearReportItems = ArchitectureReportItemService.GetLastYearItems(Funs.GetNewIntOrZero(drpYear.SelectedValue) - 1); - Grid1.Rows[1].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[2].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[3].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[4].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[5].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[6].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[7].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[8].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[9].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[10].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[11].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[12].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[13].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[15].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[16].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[17].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[19].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[20].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[21].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[22].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[23].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[24].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[25].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[26].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[27].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[28].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[29].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[30].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[31].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[32].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[33].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[34].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[35].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[36].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[37].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[38].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[39].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[40].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[41].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[42].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[43].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[44].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[45].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[46].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[47].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[48].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[49].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[50].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[51].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[52].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[53].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[54].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[55].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[56].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[57].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[59].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[60].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - SetLastYearUnEditableRow(); - } - else - { - DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + (Funs.GetNewIntOrZero(this.drpQuarters.SelectedValue) * 3).ToString()); - DateTime lastQuarters = nowDate.Value.AddMonths(-3); - Environmental_ArchitectureReport lastQuartersReport = ArchitectureReportService.GetArchitectureReportByUnitIdDate(drpUnit.SelectedValue, lastQuarters.Year, Funs.GetNowQuarterlyByTime(lastQuarters)); - if (lastQuartersReport != null) + var lastYearReport = ArchitectureReportService.GetArchitectureReportByUnitIdDate(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue) - 1, Funs.GetNewIntOrZero(this.drpMonth.SelectedValue)); + if (lastYearReport != null) { - var lastQuartersReportItems = BLL.ArchitectureReportItemService.GetItems(lastQuartersReport.ArchitectureReportId); - Grid1.Rows[1].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[2].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[3].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[4].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[5].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[6].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[7].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[8].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[9].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[10].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[11].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[12].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[13].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[15].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[16].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[17].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[19].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[20].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[21].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[22].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[23].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[24].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[25].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[26].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[27].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[28].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[29].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[30].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[31].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[32].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[33].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[34].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[35].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[36].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[37].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[38].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[39].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[40].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[41].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[42].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[43].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[44].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[45].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[46].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[47].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[48].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[49].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[50].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[51].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[52].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[53].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[54].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[55].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[56].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[57].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[59].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); - Grid1.Rows[60].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + var lastYearReportItems = ArchitectureReportItemService.GetItems(lastYearReport.ArchitectureReportId); + Grid1.Rows[1].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[2].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[3].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[4].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[5].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[6].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[7].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[8].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[9].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[10].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[11].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[12].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[13].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[15].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[16].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[17].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[19].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[20].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[21].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[22].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[23].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[24].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[25].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[26].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[27].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[28].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[29].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[30].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[31].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[32].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[33].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[34].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[35].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[36].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[37].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[38].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[39].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[40].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[41].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[42].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[43].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[44].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[45].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[46].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[47].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[48].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[49].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[50].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[51].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[52].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[53].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[54].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[55].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[56].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[57].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[59].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[60].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); SetLastYearUnEditableRow(); - } - else - { + //获取项目级数据 string year = Request.QueryString["Year"]; - string quarters = Request.QueryString["Quarterss"]; + string months = Request.QueryString["Months"]; var items = (from x in Funs.DB.Environmental_ProjectArchitectureReportItem join y in Funs.DB.Environmental_ProjectArchitectureReport on x.ArchitectureReportId equals y.ArchitectureReportId - where y.Year == Funs.GetNewIntOrZero(year) && y.Quarters == Funs.GetNewIntOrZero(quarters) + where y.Year == Funs.GetNewIntOrZero(year) && y.Month == Funs.GetNewIntOrZero(months) orderby x.SortIndex select x).ToList(); if (items.Count() > 0) { - Grid1.Rows[0].Values[3] = items.Where(x => x.SortIndex == "01").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[1].Values[3] = items.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[2].Values[3] = items.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[3].Values[3] = items.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[4].Values[3] = items.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[5].Values[3] = items.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[6].Values[3] = items.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[7].Values[3] = items.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[8].Values[3] = items.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[9].Values[3] = items.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[10].Values[3] = items.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[11].Values[3] = items.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[12].Values[3] = items.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[13].Values[3] = items.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[15].Values[3] = items.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[16].Values[3] = items.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[17].Values[3] = items.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[19].Values[3] = items.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[20].Values[3] = items.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[21].Values[3] = items.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[22].Values[3] = items.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[23].Values[3] = items.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[24].Values[3] = items.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[25].Values[3] = items.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[26].Values[3] = items.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[27].Values[3] = items.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[28].Values[3] = items.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[29].Values[3] = items.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[30].Values[3] = items.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[31].Values[3] = items.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[32].Values[3] = items.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[33].Values[3] = items.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[34].Values[3] = items.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[35].Values[3] = items.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[36].Values[3] = items.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[37].Values[3] = items.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[38].Values[3] = items.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[39].Values[3] = items.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[40].Values[3] = items.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[41].Values[3] = items.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[42].Values[3] = items.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[43].Values[3] = items.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[44].Values[3] = items.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[45].Values[3] = items.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[46].Values[3] = items.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[47].Values[3] = items.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[48].Values[3] = items.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[49].Values[3] = items.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[50].Values[3] = items.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[51].Values[3] = items.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[52].Values[3] = items.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[53].Values[3] = items.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[54].Values[3] = items.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[55].Values[3] = items.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[56].Values[3] = items.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[57].Values[3] = items.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[59].Values[3] = items.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - Grid1.Rows[60].Values[3] = items.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); - - Grid1.Rows[0].Values[4] = items.Where(x => x.SortIndex == "01").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[1].Values[4] = items.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[2].Values[4] = items.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[3].Values[4] = items.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[4].Values[4] = items.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[5].Values[4] = items.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[6].Values[4] = items.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[7].Values[4] = items.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[8].Values[4] = items.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[9].Values[4] = items.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[10].Values[4] = items.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[11].Values[4] = items.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[12].Values[4] = items.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[13].Values[4] = items.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[15].Values[4] = items.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[16].Values[4] = items.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[17].Values[4] = items.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[19].Values[4] = items.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[20].Values[4] = items.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[21].Values[4] = items.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[22].Values[4] = items.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[23].Values[4] = items.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[24].Values[4] = items.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[25].Values[4] = items.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[26].Values[4] = items.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[27].Values[4] = items.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[28].Values[4] = items.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[29].Values[4] = items.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[30].Values[4] = items.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[31].Values[4] = items.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[32].Values[4] = items.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[33].Values[4] = items.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[34].Values[4] = items.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[35].Values[4] = items.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[36].Values[4] = items.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[37].Values[4] = items.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[38].Values[4] = items.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[39].Values[4] = items.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[40].Values[4] = items.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[41].Values[4] = items.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[42].Values[4] = items.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[43].Values[4] = items.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[44].Values[4] = items.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[45].Values[4] = items.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[46].Values[4] = items.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[47].Values[4] = items.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[48].Values[4] = items.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[49].Values[4] = items.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[50].Values[4] = items.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[51].Values[4] = items.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[52].Values[4] = items.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[53].Values[4] = items.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[54].Values[4] = items.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[55].Values[4] = items.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[56].Values[4] = items.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[57].Values[4] = items.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[59].Values[4] = items.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[60].Values[4] = items.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); - Grid1.Rows[0].Values[5] = items.Where(x => x.SortIndex == "01").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); Grid1.Rows[1].Values[5] = items.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); Grid1.Rows[2].Values[5] = items.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); @@ -470,6 +285,269 @@ namespace FineUIPro.Web.ZHGL.Environmental Grid1.Rows[60].Values[5] = items.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); } } + else + { + DateTime lastMonth = Convert.ToDateTime(drpYear.SelectedValue + "-" + drpMonth.SelectedValue + "-01").AddYears(-1); + Environmental_ArchitectureReport lastQuartersReport = ArchitectureReportService.GetArchitectureReportByUnitIdDate(drpUnit.SelectedValue, lastMonth.Year, lastMonth.Month); + if (lastQuartersReport != null) + { + var lastQuartersReportItems = BLL.ArchitectureReportItemService.GetItems(lastQuartersReport.ArchitectureReportId); + Grid1.Rows[1].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[2].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[3].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[4].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[5].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[6].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[7].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[8].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[9].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[10].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[11].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[12].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[13].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[15].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[16].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[17].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[19].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[20].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[21].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[22].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[23].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[24].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[25].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[26].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[27].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[28].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[29].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[30].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[31].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[32].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[33].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[34].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[35].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[36].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[37].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[38].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[39].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[40].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[41].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[42].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[43].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[44].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[45].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[46].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[47].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[48].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[49].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[50].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[51].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[52].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[53].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[54].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[55].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[56].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[57].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[59].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[60].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + SetLastYearUnEditableRow(); + } + else + { + string year = Request.QueryString["Year"]; + string months = Request.QueryString["Months"]; + var items = (from x in Funs.DB.Environmental_ProjectArchitectureReportItem + join y in Funs.DB.Environmental_ProjectArchitectureReport + on x.ArchitectureReportId equals y.ArchitectureReportId + where y.Year == Funs.GetNewIntOrZero(year) && y.Month == Funs.GetNewIntOrZero(months) + orderby x.SortIndex + select x).ToList(); + if (items.Count() > 0) + { + Grid1.Rows[0].Values[3] = items.Where(x => x.SortIndex == "01").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[1].Values[3] = items.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[2].Values[3] = items.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[3].Values[3] = items.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[4].Values[3] = items.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[5].Values[3] = items.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[6].Values[3] = items.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[7].Values[3] = items.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[8].Values[3] = items.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[9].Values[3] = items.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[10].Values[3] = items.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[11].Values[3] = items.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[12].Values[3] = items.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[13].Values[3] = items.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[15].Values[3] = items.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[16].Values[3] = items.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[17].Values[3] = items.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[19].Values[3] = items.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[20].Values[3] = items.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[21].Values[3] = items.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[22].Values[3] = items.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[23].Values[3] = items.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[24].Values[3] = items.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[25].Values[3] = items.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[26].Values[3] = items.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[27].Values[3] = items.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[28].Values[3] = items.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[29].Values[3] = items.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[30].Values[3] = items.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[31].Values[3] = items.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[32].Values[3] = items.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[33].Values[3] = items.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[34].Values[3] = items.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[35].Values[3] = items.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[36].Values[3] = items.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[37].Values[3] = items.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[38].Values[3] = items.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[39].Values[3] = items.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[40].Values[3] = items.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[41].Values[3] = items.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[42].Values[3] = items.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[43].Values[3] = items.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[44].Values[3] = items.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[45].Values[3] = items.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[46].Values[3] = items.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[47].Values[3] = items.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[48].Values[3] = items.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[49].Values[3] = items.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[50].Values[3] = items.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[51].Values[3] = items.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[52].Values[3] = items.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[53].Values[3] = items.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[54].Values[3] = items.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[55].Values[3] = items.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[56].Values[3] = items.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[57].Values[3] = items.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[59].Values[3] = items.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[60].Values[3] = items.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + + Grid1.Rows[0].Values[4] = items.Where(x => x.SortIndex == "01").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[1].Values[4] = items.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[2].Values[4] = items.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[3].Values[4] = items.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[4].Values[4] = items.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[5].Values[4] = items.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[6].Values[4] = items.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[7].Values[4] = items.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[8].Values[4] = items.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[9].Values[4] = items.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[10].Values[4] = items.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[11].Values[4] = items.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[12].Values[4] = items.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[13].Values[4] = items.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[15].Values[4] = items.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[16].Values[4] = items.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[17].Values[4] = items.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[19].Values[4] = items.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[20].Values[4] = items.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[21].Values[4] = items.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[22].Values[4] = items.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[23].Values[4] = items.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[24].Values[4] = items.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[25].Values[4] = items.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[26].Values[4] = items.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[27].Values[4] = items.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[28].Values[4] = items.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[29].Values[4] = items.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[30].Values[4] = items.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[31].Values[4] = items.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[32].Values[4] = items.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[33].Values[4] = items.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[34].Values[4] = items.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[35].Values[4] = items.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[36].Values[4] = items.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[37].Values[4] = items.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[38].Values[4] = items.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[39].Values[4] = items.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[40].Values[4] = items.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[41].Values[4] = items.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[42].Values[4] = items.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[43].Values[4] = items.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[44].Values[4] = items.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[45].Values[4] = items.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[46].Values[4] = items.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[47].Values[4] = items.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[48].Values[4] = items.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[49].Values[4] = items.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[50].Values[4] = items.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[51].Values[4] = items.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[52].Values[4] = items.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[53].Values[4] = items.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[54].Values[4] = items.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[55].Values[4] = items.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[56].Values[4] = items.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[57].Values[4] = items.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[59].Values[4] = items.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[60].Values[4] = items.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + + Grid1.Rows[0].Values[5] = items.Where(x => x.SortIndex == "01").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[1].Values[5] = items.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[2].Values[5] = items.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[3].Values[5] = items.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[4].Values[5] = items.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[5].Values[5] = items.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[6].Values[5] = items.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[7].Values[5] = items.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[8].Values[5] = items.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[9].Values[5] = items.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[10].Values[5] = items.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[11].Values[5] = items.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[12].Values[5] = items.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[13].Values[5] = items.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[15].Values[5] = items.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[16].Values[5] = items.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[17].Values[5] = items.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[19].Values[5] = items.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[20].Values[5] = items.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[21].Values[5] = items.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[22].Values[5] = items.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[23].Values[5] = items.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[24].Values[5] = items.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[25].Values[5] = items.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[26].Values[5] = items.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[27].Values[5] = items.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[28].Values[5] = items.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[29].Values[5] = items.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[30].Values[5] = items.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[31].Values[5] = items.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[32].Values[5] = items.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[33].Values[5] = items.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[34].Values[5] = items.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[35].Values[5] = items.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[36].Values[5] = items.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[37].Values[5] = items.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[38].Values[5] = items.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[39].Values[5] = items.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[40].Values[5] = items.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[41].Values[5] = items.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[42].Values[5] = items.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[43].Values[5] = items.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[44].Values[5] = items.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[45].Values[5] = items.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[46].Values[5] = items.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[47].Values[5] = items.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[48].Values[5] = items.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[49].Values[5] = items.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[50].Values[5] = items.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[51].Values[5] = items.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[52].Values[5] = items.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[53].Values[5] = items.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[54].Values[5] = items.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[55].Values[5] = items.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[56].Values[5] = items.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[57].Values[5] = items.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[59].Values[5] = items.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[60].Values[5] = items.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + } + } + } + } + else + { + items = BLL.ArchitectureReportItemService.GetShowItems(ArchitectureReportId); + this.Grid1.DataSource = items; + this.Grid1.DataBind(); } } @@ -539,12 +617,12 @@ namespace FineUIPro.Web.ZHGL.Environmental /// /// 计算方法 /// - private void GetData() + private void GetData(bool b) { decimal E6 = 0, F6 = 0, E7 = 0, F7 = 0, E8, F8, E9 = 0, F9 = 0, E10 = 0, F10 = 0, E11 = 0, F11 = 0, E12 = 0, F12 = 0, E13 = 0, F13 = 0, E14 = 0, F14 = 0, E15 = 0, F15 = 0, E16 = 0, F16 = 0, E17 = 0, F17 = 0, E18 = 0, F18 = 0, E20 = 0, F20 = 0, E21 = 0, F21 = 0, E22 = 0, F22 = 0, - E24 = 0, F24 = 0, E25 = 0, F25 = 0, E26 = 0, F26 = 0, E27 = 0, F27 = 0, E28, F28, E29 = 0, F29 = 0, E30, F30, E31, F31, E32, F32, E33, F33, E34, F34, E35, F35, E36, F36, E37, F37, E38, F38, E39, F39, E40, F40, E41 = 0, F41 = 0, - E42 = 0, F42 = 0, E43, F43, E44 = 0, F44 = 0, E45 = 0, F45 = 0, E46 = 0, F46 = 0, E47, F47, E48 = 0, F48 = 0, E49 = 0, F49 = 0, E50 = 0, F50 = 0, E51, F51, E52, F52, E53, F53, E54, F54, E55, F55, - E56, F56, E57, F57, E58, F58, E59, F59, E60, F60, E61, F61, E62, F62, E64 = 0, F64 = 0, E65 = 0, F65 = 0; + E24 = 0, F24 = 0, E25 = 0, F25 = 0, E26 = 0, F26 = 0, E27 = 0, F27 = 0, E28, F28, E29 = 0, F29 = 0, E30, F30, E31, F31, E32, F32, E33, F33, E34, F34, E35, F35, E36, F36, E37, F37, E38, F38, E39, F39, E40, F40, E41 = 0, F41 = 0, + E42 = 0, F42 = 0, E43, F43, E44 = 0, F44 = 0, E45 = 0, F45 = 0, E46 = 0, F46 = 0, E47, F47, E48 = 0, F48 = 0, E49 = 0, F49 = 0, E50 = 0, F50 = 0, E51, F51, E52, F52, E53, F53, E54, F54, E55, F55, + E56, F56, E57, F57, E58, F58, E59, F59, E60, F60, E61, F61, E62, F62, E64 = 0, F64 = 0, E65 = 0, F65 = 0; JArray mergedData = Grid1.GetMergedData(); foreach (JObject mergedRow in mergedData) { @@ -562,7 +640,10 @@ namespace FineUIPro.Web.ZHGL.Environmental } this.Grid1.DataSource = items; this.Grid1.DataBind(); - SetUnEditableRow(); + if (b) + { + SetUnEditableRow(); + } foreach (JObject mergedRow in mergedData) { JObject values = mergedRow.Value("values"); @@ -1229,7 +1310,7 @@ namespace FineUIPro.Web.ZHGL.Environmental { UnitId = drpUnit.SelectedValue, Year = Funs.GetNewIntOrZero(drpYear.SelectedValue), - Quarters = Funs.GetNewIntOrZero(drpQuarters.SelectedValue) + Month = Funs.GetNewIntOrZero(drpMonth.SelectedValue) }; if (!string.IsNullOrEmpty(txtFillingDate.Text.Trim())) { @@ -1238,14 +1319,14 @@ namespace FineUIPro.Web.ZHGL.Environmental report.DutyPerson = txtDutyPerson.Text.Trim(); if (String.IsNullOrEmpty(ArchitectureReportId)) { - Environmental_ArchitectureReport old = ArchitectureReportService.GetArchitectureReportByUnitIdDate(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + Environmental_ArchitectureReport old = ArchitectureReportService.GetArchitectureReportByUnitIdDate(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); if (old == null) { report.ArchitectureReportId = SQLHelper.GetNewID(typeof(Model.Environmental_ArchitectureReport)); report.UpState = BLL.Const.UpState_2; report.FillingMan = this.CurrUser.PersonName; BLL.ArchitectureReportService.AddArchitectureReport(report); - BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Quarters.ToString(), report.ArchitectureReportId, BLL.Const.ArchitectureReportMenuId, BLL.Const.BtnAdd); + BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Month.ToString(), report.ArchitectureReportId, BLL.Const.ArchitectureReportMenuId, BLL.Const.BtnAdd); } else { @@ -1259,7 +1340,7 @@ namespace FineUIPro.Web.ZHGL.Environmental report.ArchitectureReportId = ArchitectureReportId; report.UpState = BLL.Const.UpState_2; BLL.ArchitectureReportService.UpdateArchitectureReport(report); - BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Quarters.ToString(), report.ArchitectureReportId, BLL.Const.ArchitectureReportMenuId, BLL.Const.BtnModify); + BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Month.ToString(), report.ArchitectureReportId, BLL.Const.ArchitectureReportMenuId, BLL.Const.BtnModify); } ArchitectureReportId = report.ArchitectureReportId; BLL.ArchitectureReportItemService.DeleteArchitectureReportItemByArchitectureReportId(report.ArchitectureReportId); @@ -1272,12 +1353,7 @@ namespace FineUIPro.Web.ZHGL.Environmental newItem.ArchitectureReportId = report.ArchitectureReportId; newItem.BaseNumber = System.Web.HttpUtility.HtmlDecode(item.BaseNumber); newItem.SortIndex = System.Web.HttpUtility.HtmlDecode(item.SortIndex); - string str = item.LastYearValue; - if (str == "6E-05") - { - str = "0.00006"; - } - newItem.LastYearValue = System.Web.HttpUtility.HtmlDecode(str); + newItem.LastYearValue = System.Web.HttpUtility.HtmlDecode(item.LastYearValue); newItem.ThisYearValue = System.Web.HttpUtility.HtmlDecode(item.ThisYearValue); newItem.Rate = System.Web.HttpUtility.HtmlDecode(item.Rate); ArchitectureReportItemService.AddArchitectureReportItem(newItem); @@ -1294,7 +1370,7 @@ namespace FineUIPro.Web.ZHGL.Environmental PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); return; } - else if (code == "3") + else if (code=="3") { Alert.ShowInParent("集团当前季度数据已锁定,无法上传!", MessageBoxIcon.Error); } @@ -1313,26 +1389,26 @@ namespace FineUIPro.Web.ZHGL.Environmental protected void btnSave_Click(object sender, EventArgs e) { - /* bool isEmpty = false; - foreach (JObject mergedRow in Grid1.GetMergedData()) - { - JObject values = mergedRow.Value("values"); - int rowIndex = mergedRow.Value("index"); - string sortIndex = values.Value("SortIndex"); - if (sortIndex == "18" || sortIndex == "37" || sortIndex == "38") - { - if (Funs.GetNewDecimalOrZero(System.Web.HttpUtility.HtmlDecode(values.Value("ThisYearValue"))) == 0) - { - isEmpty = true; - break; - } - } - } - if (isEmpty) - { - ShowNotify("营业收入(可比价)、万元收入二氧化碳排放(可比价)和二氧化碳排放量不能为空,必须填报数据!", MessageBoxIcon.Warning); - return; - }*/ + /* bool isEmpty = false; + foreach (JObject mergedRow in Grid1.GetMergedData()) + { + JObject values = mergedRow.Value("values"); + int rowIndex = mergedRow.Value("index"); + string sortIndex = values.Value("SortIndex"); + if (sortIndex == "18" || sortIndex == "37" || sortIndex == "38") + { + if (Funs.GetNewDecimalOrZero(System.Web.HttpUtility.HtmlDecode(values.Value("ThisYearValue"))) == 0) + { + isEmpty = true; + break; + } + } + } + if (isEmpty) + { + ShowNotify("营业收入(可比价)、万元收入二氧化碳排放(可比价)和二氧化碳排放量不能为空,必须填报数据!", MessageBoxIcon.Warning); + return; + }*/ Save("add"); ShowNotify("保存成功!", MessageBoxIcon.Success); PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); @@ -1360,12 +1436,7 @@ namespace FineUIPro.Web.ZHGL.Environmental { try { - string str = values.Value("LastYearValue"); - if (str == "6E-05") - { - str = "0.00006"; - } - decimal d = Convert.ToDecimal(str); + decimal d = Convert.ToDecimal(values.Value("LastYearValue")); } catch (Exception) { @@ -1532,12 +1603,12 @@ namespace FineUIPro.Web.ZHGL.Environmental /// protected void btnCopy_Click(object sender, EventArgs e) { - DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + (Funs.GetNewIntOrZero(this.drpQuarters.SelectedValue) * 3).ToString()); + DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + this.drpMonth.SelectedValue); if (nowDate.HasValue) { DateTime showDate = new DateTime(); showDate = nowDate.Value.AddMonths(-3); - Model.Environmental_ArchitectureReport ArchitectureReport = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(this.drpUnit.SelectedValue, showDate.Year, Funs.GetNowQuarterlyByTime(showDate)); + Model.Environmental_ArchitectureReport ArchitectureReport = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(this.drpUnit.SelectedValue, showDate.Year, showDate.Month); if (ArchitectureReport != null) { Model.Environmental_ArchitectureReport newArchitectureReport = new Environmental_ArchitectureReport(); @@ -1545,7 +1616,7 @@ namespace FineUIPro.Web.ZHGL.Environmental newArchitectureReport.ArchitectureReportId = this.ArchitectureReportId; newArchitectureReport.UnitId = this.drpUnit.SelectedValue; newArchitectureReport.Year = Convert.ToInt32(this.drpYear.SelectedValue); - newArchitectureReport.Quarters = Convert.ToInt32(this.drpQuarters.SelectedValue); + newArchitectureReport.Month = Convert.ToInt32(this.drpMonth.SelectedValue); newArchitectureReport.FillingMan = this.CurrUser.PersonName; newArchitectureReport.FillingDate = DateTime.Now; newArchitectureReport.DutyPerson = this.CurrUser.PersonName; @@ -1584,7 +1655,7 @@ namespace FineUIPro.Web.ZHGL.Environmental var report = BLL.ArchitectureReportService.GetArchitectureReportByArchitectureReportId(ArchitectureReportId); if (report != null) { - drpQuarters.SelectedValue = report.Quarters.ToString(); + drpMonth.SelectedValue = report.Month.ToString(); drpYear.SelectedValue = report.Year.ToString(); drpUnit.SelectedValue = report.UnitId; if (report.FillingDate != null) diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx.designer.cs index 5918d103..a1783d3a 100644 --- a/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx.designer.cs @@ -49,13 +49,13 @@ namespace FineUIPro.Web.ZHGL.Environmental { protected global::FineUIPro.DropDownList drpYear; /// - /// drpQuarters 控件。 + /// drpMonth 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.DropDownList drpQuarters; + protected global::FineUIPro.DropDownList drpMonth; /// /// drpUnit 控件。 diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReport.aspx b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReport.aspx index d901b296..75806659 100644 --- a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReport.aspx +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReport.aspx @@ -1,4 +1,5 @@ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectArchitectureReport.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Environmental.ProjectArchitectureReport" %> +<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %> @@ -18,52 +19,59 @@
- - - - + + + + + + + + + + + + EnableCollapse="true" runat="server" RedStarPosition="BeforeText" LabelAlign="Right"> + Width="150px" LabelWidth="50px" Label="年度" OnSelectedIndexChanged="drpUnit_SelectedIndexChanged"> - + - + - + - @@ -84,37 +92,38 @@ - - - - - - - - - - - - - - - - + BoxFlex="1" DataKeyNames="ArchitectureReportItemId" AllowCellEditing="true" ForceFit="true" + SortField="SortIndex" ClicksToEdit="1" DataIDField="ArchitectureReportItemId" + EnableColumnLines="true"> + + + + + + + + + + + + + + + + - - - + + + +
+ public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + #endregion #region 加载页面 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { - BLL.ConstValue.InitConstValueDropDownList(this.drpQuarters, ConstValue.Group_0011, false); - BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, false); + this.ProjectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId) + { + this.ProjectId = Request.Params["projectId"]; + } + this.InitDropDownList(); + this.ucTree.UnitId = this.CurrUser.UnitId; + this.ucTree.ProjectId = this.ProjectId; + if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId) ) + { + this.panelLeftRegion.Hidden = true; + ////权限按钮方法 + this.GetButtonPower(); + } this.drpUnit.DataTextField = "UnitName"; drpUnit.DataValueField = "UnitId"; @@ -24,12 +52,29 @@ namespace FineUIPro.Web.ZHGL.Environmental drpUnit.DataBind(); this.drpUnit.Readonly = true; ////取上个报表时间 - DateTime showDate = System.DateTime.Now.AddMonths(-3); - this.drpQuarters.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString(); + DateTime showDate = System.DateTime.Now.AddMonths(-1); + drpMonth.SelectedValue = showDate.Month.ToString(); drpYear.SelectedValue = showDate.Year.ToString(); GetValue(); } } + private void InitDropDownList() + { + BLL.ConstValue.InitConstValueDropDownList(this.drpMonth, ConstValue.Group_0009, false); + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, false); + } + /// + /// 公司级树加载 + /// + /// + /// + protected void changeTree(object sender, EventArgs e) + { + this.ProjectId = this.ucTree.ProjectId; + this.GetButtonPower(); + this.InitDropDownList(); + this.GetValue(); + } private void SetEmpty() { @@ -46,9 +91,13 @@ namespace FineUIPro.Web.ZHGL.Environmental #region 获取记录值 private void GetValue() { + if (string.IsNullOrEmpty(this.ProjectId)) + { + return; + } int year = Funs.GetNewIntOrZero(drpYear.SelectedValue); - int Quarters = Funs.GetNewIntOrZero(drpQuarters.SelectedValue); - Model.View_Environmental_ProjectArchitectureReport report = Funs.DB.View_Environmental_ProjectArchitectureReport.FirstOrDefault(e => e.ProjectId == this.CurrUser.LoginProjectId && e.Quarters == Quarters && e.Year == year); + int month = Funs.GetNewIntOrZero(drpMonth.SelectedValue); + Model.View_Environmental_ProjectArchitectureReport report = Funs.DB.View_Environmental_ProjectArchitectureReport.FirstOrDefault(e => e.ProjectId == this.ProjectId && e.Month == month && e.Year == year); if (report != null) { string upState = string.Empty; @@ -60,7 +109,7 @@ namespace FineUIPro.Web.ZHGL.Environmental { upState = "(未上报)"; } - this.SimpleForm1.Title = "企业建筑行业能源节约与生态环境保护汇总表" + report.QuartersStr + report.YearStr + upState; + this.SimpleForm1.Title = "企业建筑行业能源节约与生态环境保护汇总表" + report.MonthStr + report.YearStr + upState; lbUnitName.Text = "填报企业:" + report.ProjectName; if (report.FillingDate != null) { @@ -162,7 +211,7 @@ namespace FineUIPro.Web.ZHGL.Environmental /// private void GetButtonPower() { - var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.ProjectArchitectureReportMenuId); + var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.PersonId, BLL.Const.ProjectArchitectureReportMenuId); if (buttonList.Count() > 0) { if (buttonList.Contains(BLL.Const.BtnAdd)) @@ -179,13 +228,13 @@ namespace FineUIPro.Web.ZHGL.Environmental } } - var getReport = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + var getReport = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.ProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); this.btnAudit1.Hidden = true; this.btnAudit2.Hidden = true; if (getReport != null) { this.btnNew.Hidden = true; - //if (getReport.HandleMan == this.CurrUser.PersonId) //当前人是下一步办理入 + //if (getReport.HandleMan == this.CurrUser.UserId) //当前人是下一步办理入 //{ // if (getReport.HandleState == BLL.Const.HandleState_2) // { @@ -199,10 +248,16 @@ namespace FineUIPro.Web.ZHGL.Environmental // } // else if (getReport.HandleState == BLL.Const.HandleState_4) // { - this.btnUpdata.Hidden = false; + // this.btnUpdata.Hidden = false; // } //} } + if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) + { + btnNew.Hidden = true; + btnEdit.Hidden = true; + btnDelete.Hidden = true; + } } #endregion @@ -214,7 +269,7 @@ namespace FineUIPro.Web.ZHGL.Environmental /// protected void btnNew_Click(object sender, EventArgs e) { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectArchitectureReportSave.aspx?UnitId={0}&&Year={1}&&Quarterss={2}", this.CurrUser.UnitId, this.drpYear.SelectedValue, this.drpQuarters.SelectedValue, "编辑 - "))); + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectArchitectureReportSave.aspx?UnitId={0}&&Year={1}&&Months={2}", this.CurrUser.UnitId, this.drpYear.SelectedValue, this.drpMonth.SelectedValue, "编辑 - "))); } /// @@ -224,7 +279,7 @@ namespace FineUIPro.Web.ZHGL.Environmental /// protected void btnEdit_Click(object sender, EventArgs e) { - Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.ProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); if (report != null) { PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectArchitectureReportSave.aspx?ArchitectureReportId={0}", report.ArchitectureReportId, "编辑 - "))); @@ -242,7 +297,7 @@ namespace FineUIPro.Web.ZHGL.Environmental /// protected void btnAudit1_Click(object sender, EventArgs e) { - Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.ProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); if (report != null) { PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectArchitectureReportSave.aspx?ArchitectureReportId={0}", report.ArchitectureReportId, "编辑 - "))); @@ -260,7 +315,7 @@ namespace FineUIPro.Web.ZHGL.Environmental /// protected void btnAudit2_Click(object sender, EventArgs e) { - Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.ProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); if (report != null) { PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectArchitectureReportSave.aspx?ArchitectureReportId={0}", report.ArchitectureReportId, "编辑 - "))); @@ -278,7 +333,7 @@ namespace FineUIPro.Web.ZHGL.Environmental /// protected void btnUpdata_Click(object sender, EventArgs e) { - Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.ProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); if (report != null) { PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectArchitectureReportSave.aspx?ArchitectureReportId={0}&type=Updata", report.ArchitectureReportId, "编辑 - "))); @@ -296,10 +351,10 @@ namespace FineUIPro.Web.ZHGL.Environmental /// protected void btnDelete_Click(object sender, EventArgs e) { - Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.ProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); if (report != null) { - BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Quarters.ToString(), report.ArchitectureReportId, BLL.Const.ProjectArchitectureReportMenuId, BLL.Const.BtnDelete); + BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Month.ToString(), report.ArchitectureReportId, BLL.Const.ProjectArchitectureReportMenuId, BLL.Const.BtnDelete); BLL.ProjectDataFlowSetService.DeleteFlowSetByDataId(report.ArchitectureReportId); BLL.ProjectArchitectureReportItemService.DeleteArchitectureReportItemByArchitectureReportId(report.ArchitectureReportId); BLL.ProjectArchitectureReportService.DeleteArchitectureReportByArchitectureReportId(report.ArchitectureReportId); @@ -342,7 +397,7 @@ namespace FineUIPro.Web.ZHGL.Environmental Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByArchitectureReportId(ArchitectureReportId.ToString()); if (report != null) { - return report.Year + "年" + report.Quarters + "月"; + return report.Year + "年" + report.Month + "月"; } } return ""; @@ -363,7 +418,8 @@ namespace FineUIPro.Web.ZHGL.Environmental var unit = units.FirstOrDefault(x => x.UnitName == this.drpUnit.SelectedText); if (unit != null) { - this.CurrUser.LoginProjectId = unit.UnitId; + //this.CurrUser.LoginProjectId = unit.UnitId;. + drpUnit.SelectedValue = unit.UnitId; } } @@ -379,7 +435,7 @@ namespace FineUIPro.Web.ZHGL.Environmental /// protected void BtnBulletLeft_Click(object sender, EventArgs e) { - SetQuartersChange("-"); + SetMonthChange("-"); } /// @@ -389,30 +445,30 @@ namespace FineUIPro.Web.ZHGL.Environmental /// protected void BulletRight_Click(object sender, EventArgs e) { - SetQuartersChange("+"); + SetMonthChange("+"); } /// /// 月份加减变化 /// /// - private void SetQuartersChange(string type) + private void SetMonthChange(string type) { - DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + (Funs.GetNewIntOrZero(this.drpQuarters.SelectedValue) * 3).ToString()); + DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + this.drpMonth.SelectedValue); if (nowDate.HasValue) { DateTime showDate = new DateTime(); if (type == "+") { - showDate = nowDate.Value.AddMonths(3); + showDate = nowDate.Value.AddMonths(1); } else { - showDate = nowDate.Value.AddMonths(-3); + showDate = nowDate.Value.AddMonths(-1); } this.drpYear.SelectedValue = showDate.Year.ToString(); - this.drpQuarters.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString(); + drpMonth.SelectedValue = showDate.Month.ToString(); ///值变化 GetValue(); } @@ -427,7 +483,7 @@ namespace FineUIPro.Web.ZHGL.Environmental /// protected void btnSee_Click(object sender, EventArgs e) { - Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.ProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); if (report != null) { PageContext.RegisterStartupScript(Window4.GetShowReference(String.Format("ReportAuditSee.aspx?Id={0}", report.ArchitectureReportId, "查看 - "))); diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReport.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReport.aspx.designer.cs index d9caee1b..80064ccf 100644 --- a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReport.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReport.aspx.designer.cs @@ -31,22 +31,49 @@ namespace FineUIPro.Web.ZHGL.Environmental { protected global::FineUIPro.PageManager PageManager1; /// - /// RegionPanel1 控件。 + /// Panel1 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.RegionPanel RegionPanel1; + protected global::FineUIPro.Panel Panel1; /// - /// Region2 控件。 + /// panelLeftRegion 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.Region Region2; + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// ContentPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel1; + + /// + /// ucTree 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Web.Controls.UnitProjectTControl ucTree; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; /// /// SimpleForm1 控件。 @@ -85,13 +112,13 @@ namespace FineUIPro.Web.ZHGL.Environmental { protected global::FineUIPro.DropDownList drpYear; /// - /// drpQuarters 控件。 + /// drpMonth 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.DropDownList drpQuarters; + protected global::FineUIPro.DropDownList drpMonth; /// /// BtnBulletLeft 控件。 @@ -174,15 +201,6 @@ namespace FineUIPro.Web.ZHGL.Environmental { /// protected global::FineUIPro.Button btnAudit2; - /// - /// btnUpdata 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnUpdata; - /// /// lbUnitName 控件。 /// diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReportSave.aspx b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReportSave.aspx index 2e7dfea4..895af80b 100644 --- a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReportSave.aspx +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReportSave.aspx @@ -31,8 +31,8 @@ - +