1673 lines
		
	
	
		
			120 KiB
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			1673 lines
		
	
	
		
			120 KiB
		
	
	
	
		
			C#
		
	
	
	
| using BLL;
 | ||
| using Model;
 | ||
| using Newtonsoft.Json.Linq;
 | ||
| using System;
 | ||
| using System.Collections.Generic;
 | ||
| using System.Data;
 | ||
| using System.Linq;
 | ||
| using System.Web.UI.WebControls;
 | ||
| 
 | ||
| namespace FineUIPro.Web.ZHGL.Environmental
 | ||
| {
 | ||
|     public partial class ArchitectureReportSave : PageBase
 | ||
|     {
 | ||
|         #region 定义变量
 | ||
|         /// <summary>
 | ||
|         /// 报表主键Id
 | ||
|         /// </summary>
 | ||
|         public string ArchitectureReportId
 | ||
|         {
 | ||
|             get
 | ||
|             {
 | ||
|                 return (string)ViewState["ArchitectureReportId"];
 | ||
|             }
 | ||
|             set
 | ||
|             {
 | ||
|                 ViewState["ArchitectureReportId"] = value;
 | ||
|             }
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// 定义集合
 | ||
|         /// </summary>
 | ||
|         private static List<Model.ArchitectureReportItem> items = new List<Model.ArchitectureReportItem>();
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region 加载页面
 | ||
|         /// <summary> 
 | ||
|         /// 加载页面
 | ||
|         /// </summary>
 | ||
|         /// <param name="sender"></param>
 | ||
|         /// <param name="e"></param>
 | ||
|         protected void Page_Load(object sender, EventArgs e)
 | ||
|         {
 | ||
|             if (!IsPostBack)
 | ||
|             {
 | ||
|                 if (Request.Params["type"] != "-1")
 | ||
|                 {
 | ||
|                     this.GetButtonPower();
 | ||
|                 }
 | ||
|                 items.Clear();
 | ||
|                 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";
 | ||
|                 drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList();
 | ||
|                 drpUnit.DataBind();
 | ||
|                 this.drpUnit.Readonly = true;
 | ||
|                 string unitId = Request.QueryString["UnitId"];
 | ||
|                 string year = Request.QueryString["Year"];
 | ||
|                 string months = Request.QueryString["Months"];
 | ||
|                 ArchitectureReportId = Request.QueryString["ArchitectureReportId"];
 | ||
|                 if (!string.IsNullOrEmpty(Request.QueryString["type"]))
 | ||
|                 {
 | ||
|                     this.btnSave.Hidden = true;
 | ||
|                     this.btnUpdata.Hidden = false;
 | ||
|                 }
 | ||
|                 else
 | ||
|                 {
 | ||
|                     this.btnSave.Hidden = false;
 | ||
|                     this.btnUpdata.Hidden = true;
 | ||
|                 }
 | ||
|                 if (!String.IsNullOrEmpty(ArchitectureReportId))
 | ||
|                 {
 | ||
|                     items = BLL.ArchitectureReportItemService.GetShowItems(ArchitectureReportId);
 | ||
|                     this.Grid1.DataSource = items;
 | ||
|                     this.Grid1.DataBind();
 | ||
|                     var report = BLL.ArchitectureReportService.GetArchitectureReportByArchitectureReportId(ArchitectureReportId);
 | ||
|                     if (report != null)
 | ||
|                     {
 | ||
|                         //this.btnCopy.Hidden = true;
 | ||
|                         //if (this.CurrUser.UserId == BLL.Const.sysglyId || this.CurrUser.UserId == BLL.Const.hfnbdId)
 | ||
|                         //{
 | ||
|                         //    this.btnSave.Hidden = false;
 | ||
|                         //}
 | ||
|                         if (report.UpState == BLL.Const.UpState_3)
 | ||
|                         {
 | ||
|                             this.btnSave.Hidden = true;
 | ||
|                             this.btnUpdata.Hidden = true;
 | ||
|                         }
 | ||
|                         drpMonth.SelectedValue = report.Month.ToString();
 | ||
|                         drpYear.SelectedValue = report.Year.ToString();
 | ||
|                         drpUnit.SelectedValue = report.UnitId;
 | ||
|                         if (report.FillingDate != null)
 | ||
|                         {
 | ||
|                             txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", report.FillingDate);
 | ||
|                         }
 | ||
|                         txtDutyPerson.Text = report.DutyPerson;
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else
 | ||
|                 {
 | ||
|                     //this.btnCopy.Hidden = false;
 | ||
|                     drpMonth.SelectedValue = months;
 | ||
|                     drpYear.SelectedValue = year;
 | ||
|                     txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
 | ||
|                     txtDutyPerson.Text = this.CurrUser.UserName;
 | ||
|                     //增加明细集合
 | ||
|                     GetNewItems(year, months);
 | ||
|                     this.Grid1.DataSource = items;
 | ||
|                     this.Grid1.DataBind();
 | ||
|                 }
 | ||
|                 SetUnEditableRow();
 | ||
|                 GetData(true);
 | ||
|             }
 | ||
|             else
 | ||
|             {
 | ||
|                 if (GetRequestEventArgument() == "UPDATE_SUMMARY")
 | ||
|                 {
 | ||
|                     GetData(false);
 | ||
|                 }
 | ||
|             }
 | ||
|         }
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region 设置不可编辑行
 | ||
|         private void SetUnEditableRow()
 | ||
|         {
 | ||
|             if (Grid1.Rows.Count == 61)
 | ||
|             {
 | ||
|                 Grid1.Rows[0].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|                 Grid1.Rows[0].CellCssClasses[5] = "f-grid-cell-uneditable";
 | ||
|                 Grid1.Rows[14].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|                 Grid1.Rows[14].CellCssClasses[5] = "f-grid-cell-uneditable";
 | ||
|                 Grid1.Rows[16].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|                 Grid1.Rows[16].CellCssClasses[5] = "f-grid-cell-uneditable";
 | ||
|                 //Grid1.Rows[17].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|                 //Grid1.Rows[17].CellCssClasses[5] = "f-grid-cell-uneditable";
 | ||
|                 Grid1.Rows[18].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|                 Grid1.Rows[18].CellCssClasses[5] = "f-grid-cell-uneditable";
 | ||
|                 Grid1.Rows[20].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|                 Grid1.Rows[20].CellCssClasses[5] = "f-grid-cell-uneditable";
 | ||
|                 //Grid1.Rows[21].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|                 //Grid1.Rows[21].CellCssClasses[5] = "f-grid-cell-uneditable";
 | ||
|                 Grid1.Rows[22].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|                 Grid1.Rows[22].CellCssClasses[5] = "f-grid-cell-uneditable";
 | ||
|                 //Grid1.Rows[24].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|                 //Grid1.Rows[24].CellCssClasses[5] = "f-grid-cell-uneditable";
 | ||
|                 Grid1.Rows[36].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|                 Grid1.Rows[36].CellCssClasses[5] = "f-grid-cell-uneditable";
 | ||
|                 Grid1.Rows[58].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|                 Grid1.Rows[58].CellCssClasses[5] = "f-grid-cell-uneditable";
 | ||
|             }
 | ||
|             if (string.IsNullOrEmpty(ArchitectureReportId))
 | ||
|             {
 | ||
|                 var lastYearReport = ArchitectureReportService.GetArchitectureReportByUnitIdDate(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue) - 1, Funs.GetNewIntOrZero(this.drpMonth.SelectedValue));
 | ||
|                 if (lastYearReport != null)
 | ||
|                 {
 | ||
|                     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();
 | ||
|                     //获取项目级数据
 | ||
|                     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[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
 | ||
|                 {
 | ||
|                     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();
 | ||
|             }
 | ||
|         }
 | ||
| 
 | ||
|         private void SetLastYearUnEditableRow()
 | ||
|         {
 | ||
|             //Grid1.Rows[1].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[2].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[3].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[4].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[5].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[6].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[7].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[8].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[9].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[10].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[11].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[12].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[13].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[15].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[16].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[17].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[19].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[20].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[21].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[22].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[23].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[24].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[25].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[26].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[27].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[28].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[29].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[30].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[31].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[32].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[33].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[34].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[35].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[36].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[37].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[38].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[39].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[40].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[41].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[42].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[43].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[44].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[45].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[46].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[47].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[48].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[49].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[50].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[51].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[52].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[53].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[54].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[55].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[56].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[57].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[59].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|             //Grid1.Rows[60].CellCssClasses[4] = "f-grid-cell-uneditable";
 | ||
|         }
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region 计算方法
 | ||
|         /// <summary>
 | ||
|         /// 计算方法
 | ||
|         /// </summary>
 | ||
|         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;
 | ||
|             JArray mergedData = Grid1.GetMergedData();
 | ||
|             foreach (JObject mergedRow in mergedData)
 | ||
|             {
 | ||
|                 JObject values = mergedRow.Value<JObject>("values");
 | ||
|                 int rowIndex = mergedRow.Value<int>("index");
 | ||
|                 string sortIndex = values.Value<string>("SortIndex");
 | ||
|                 var item = items.FirstOrDefault(x => x.SortIndex == sortIndex);
 | ||
|                 if (item != null)
 | ||
|                 {
 | ||
|                     item.BaseNumber = System.Web.HttpUtility.HtmlDecode(values.Value<string>("BaseNumber"));
 | ||
|                     item.LastYearValue = System.Web.HttpUtility.HtmlDecode(values.Value<string>("LastYearValue"));
 | ||
|                     item.ThisYearValue = System.Web.HttpUtility.HtmlDecode(values.Value<string>("ThisYearValue"));
 | ||
| 
 | ||
|                 }
 | ||
|             }
 | ||
|             this.Grid1.DataSource = items;
 | ||
|             this.Grid1.DataBind();
 | ||
|             if (b)
 | ||
|             {
 | ||
|                 SetUnEditableRow();
 | ||
|             }
 | ||
|             foreach (JObject mergedRow in mergedData)
 | ||
|             {
 | ||
|                 JObject values = mergedRow.Value<JObject>("values");
 | ||
|                 int rowIndex = mergedRow.Value<int>("index");
 | ||
|                 if (rowIndex == 1)
 | ||
|                 {
 | ||
|                     E6 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F6 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E6 > 0 && F6 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F6 - E6) * 100 / E6, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 2)
 | ||
|                 {
 | ||
|                     E7 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F7 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E7 > 0 && F7 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F7 - E7) * 100 / E7, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 3)
 | ||
|                 {
 | ||
|                     E8 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F8 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E8 > 0 && F8 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F8 - E8) * 100 / E8, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 4)
 | ||
|                 {
 | ||
|                     E9 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F9 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E9 > 0 && F9 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F9 - E9) * 100 / E9, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 5)
 | ||
|                 {
 | ||
|                     E10 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F10 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E10 > 0 && F10 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F10 - E10) * 100 / E10, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 6)
 | ||
|                 {
 | ||
|                     E11 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F11 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E11 > 0 && F11 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F11 - E11) * 100 / E11, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 7)
 | ||
|                 {
 | ||
|                     E12 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F12 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E12 > 0 && F12 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F12 - E12) * 100 / E12, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 8)
 | ||
|                 {
 | ||
|                     E13 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F13 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E13 > 0 && F13 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F13 - E13) * 100 / E13, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 9)
 | ||
|                 {
 | ||
|                     E14 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F14 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E14 > 0 && F14 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F14 - E14) * 100 / E14, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 10)
 | ||
|                 {
 | ||
|                     E15 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F15 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E15 > 0 && F15 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F15 - E15) * 100 / E15, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 11)
 | ||
|                 {
 | ||
|                     E16 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F16 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E16 > 0 && F16 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F16 - E16) * 100 / E16, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 12)
 | ||
|                 {
 | ||
|                     E17 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F17 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E17 > 0 && F17 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F17 - E17) * 100 / E17, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 13)
 | ||
|                 {
 | ||
|                     E18 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F18 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E18 > 0 && F18 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F18 - E18) * 100 / E18, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 15)
 | ||
|                 {
 | ||
|                     E20 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F20 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E20 > 0 && F20 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F20 - E20) * 100 / E20, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 16)
 | ||
|                 {
 | ||
|                     E21 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F21 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E21 > 0 && F21 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F21 - E21) * 100 / E21, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 17)
 | ||
|                 {
 | ||
|                     E22 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F22 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E22 > 0 && F22 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F22 - E22) * 100 / E22, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 19)
 | ||
|                 {
 | ||
|                     E24 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F24 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E24 > 0 && F24 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F24 - E24) * 100 / E24, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 20)
 | ||
|                 {
 | ||
|                     E25 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F25 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E25 > 0 && F25 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F25 - E25) * 100 / E25, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 21)
 | ||
|                 {
 | ||
|                     E26 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F26 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E26 > 0 && F26 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F26 - E26) * 100 / E26, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 22)
 | ||
|                 {
 | ||
|                     E27 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F27 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E27 > 0 && F27 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F27 - E27) * 100 / E27, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 23)
 | ||
|                 {
 | ||
|                     E28 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F28 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E28 > 0 && F28 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F28 - E28) * 100 / E28, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 24)
 | ||
|                 {
 | ||
|                     E29 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F29 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E29 > 0 && F29 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F29 - E29) * 100 / E29, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 25)
 | ||
|                 {
 | ||
|                     E30 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F30 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E30 > 0 && F30 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F30 - E30) * 100 / E30, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 26)
 | ||
|                 {
 | ||
|                     E31 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F31 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E31 > 0 && F31 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F31 - E31) * 100 / E31, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 27)
 | ||
|                 {
 | ||
|                     E32 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F32 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E32 > 0 && F32 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F32 - E32) * 100 / E32, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 28)
 | ||
|                 {
 | ||
|                     E33 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F33 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E33 > 0 && F33 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F33 - E33) * 100 / E33, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 29)
 | ||
|                 {
 | ||
|                     E34 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F34 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E34 > 0 && F34 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F34 - E34) * 100 / E34, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 30)
 | ||
|                 {
 | ||
|                     E35 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F35 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E35 > 0 && F35 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F35 - E35) * 100 / E35, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 31)
 | ||
|                 {
 | ||
|                     E36 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F36 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E36 > 0 && F36 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F36 - E36) * 100 / E36, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 32)
 | ||
|                 {
 | ||
|                     E37 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F37 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E37 > 0 && F37 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F37 - E37) * 100 / E37, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 33)
 | ||
|                 {
 | ||
|                     E38 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F38 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E38 > 0 && F38 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F38 - E38) * 100 / E38, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 34)
 | ||
|                 {
 | ||
|                     E39 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F39 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E39 > 0 && F39 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F39 - E39) * 100 / E39, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 35)
 | ||
|                 {
 | ||
|                     E40 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F40 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E40 > 0 && F40 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F40 - E40) * 100 / E40, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 36)
 | ||
|                 {
 | ||
|                     E41 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F41 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E41 > 0 && F41 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F41 - E41) * 100 / E41, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 37)
 | ||
|                 {
 | ||
|                     E42 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F42 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E42 > 0 && F42 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F42 - E42) * 100 / E42, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 38)
 | ||
|                 {
 | ||
|                     E43 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F43 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E43 > 0 && F43 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F43 - E43) * 100 / E43, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 39)
 | ||
|                 {
 | ||
|                     E44 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F44 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E44 > 0 && F44 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F44 - E44) * 100 / E44, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 40)
 | ||
|                 {
 | ||
|                     E45 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F45 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E45 > 0 && F45 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F45 - E45) * 100 / E45, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 41)
 | ||
|                 {
 | ||
|                     E46 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F46 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E46 > 0 && F46 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F46 - E46) * 100 / E46, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 42)
 | ||
|                 {
 | ||
|                     E47 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F47 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E47 > 0 && F47 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F47 - E47) * 100 / E47, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 43)
 | ||
|                 {
 | ||
|                     E48 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F48 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E48 > 0 && F48 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F48 - E48) * 100 / E48, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 44)
 | ||
|                 {
 | ||
|                     E49 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F49 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E49 > 0 && F49 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F49 - E49) * 100 / E49, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 45)
 | ||
|                 {
 | ||
|                     E50 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F50 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E50 > 0 && F50 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F50 - E50) * 100 / E50, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 46)
 | ||
|                 {
 | ||
|                     E51 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F51 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E51 > 0 && F51 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F51 - E51) * 100 / E51, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 47)
 | ||
|                 {
 | ||
|                     E52 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F52 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E52 > 0 && F52 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F52 - E52) * 100 / E52, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 48)
 | ||
|                 {
 | ||
|                     E53 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F53 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E53 > 0 && F53 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F53 - E53) * 100 / E53, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 49)
 | ||
|                 {
 | ||
|                     E54 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F54 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E54 > 0 && F54 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F54 - E54) * 100 / E54, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 50)
 | ||
|                 {
 | ||
|                     E55 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F55 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E55 > 0 && F55 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F55 - E55) * 100 / E55, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 51)
 | ||
|                 {
 | ||
|                     E56 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F56 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E56 > 0 && F56 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F56 - E56) * 100 / E56, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 52)
 | ||
|                 {
 | ||
|                     E57 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F57 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E57 > 0 && F57 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F57 - E57) * 100 / E57, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 53)
 | ||
|                 {
 | ||
|                     E58 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F58 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E58 > 0 && F58 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F58 - E58) * 100 / E58, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 54)
 | ||
|                 {
 | ||
|                     E59 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F59 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E59 > 0 && F59 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F59 - E59) * 100 / E59, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 55)
 | ||
|                 {
 | ||
|                     E60 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F60 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E60 > 0 && F60 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F60 - E60) * 100 / E60, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 56)
 | ||
|                 {
 | ||
|                     E61 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F61 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E61 > 0 && F61 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F61 - E61) * 100 / E61, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 57)
 | ||
|                 {
 | ||
|                     E62 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F62 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E62 > 0 && F62 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F62 - E62) * 100 / E62, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 59)
 | ||
|                 {
 | ||
|                     E64 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F64 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E64 > 0 && F64 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F64 - E64) * 100 / E64, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else if (rowIndex == 60)
 | ||
|                 {
 | ||
|                     E65 = Funs.GetNewDecimalOrZero(values.Value<string>("LastYearValue"));
 | ||
|                     F65 = Funs.GetNewDecimalOrZero(values.Value<string>("ThisYearValue"));
 | ||
|                     if (E65 > 0 && F65 > 0)
 | ||
|                     {
 | ||
|                         this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F65 - E65) * 100 / E65, 2).ToString() + "%";
 | ||
|                     }
 | ||
|                 }
 | ||
|             }
 | ||
|             if (E6 > 0 || E9 > 0 || E10 > 0 || E11 > 0 || E12 > 0 || E13 > 0 || E14 > 0 || E15 > 0 || E16 > 0 || E17 > 0 || E18 > 0)
 | ||
|             {
 | ||
|                 this.Grid1.Rows[0].Values[4] = (E6 + (E9 * Convert.ToDecimal(0.9714) + E10 * Convert.ToDecimal(1.229) + E11 * Convert.ToDecimal(1.4286) + E12 * Convert.ToDecimal(1.4714) + E13 * Convert.ToDecimal(1.4714) + E14 * Convert.ToDecimal(1.4571) + E15 * Convert.ToDecimal(1.4286) + E16 * Convert.ToDecimal(13.3) + E17 * Convert.ToDecimal(0.0341) + E18) / 10000);
 | ||
|             }
 | ||
|             if (F6 > 0 || F9 > 0 || F10 > 0 || F11 > 0 || F12 > 0 || F13 > 0 || F14 > 0 || F15 > 0 || F16 > 0 || F17 > 0 || F18 > 0)
 | ||
|             {
 | ||
|                 this.Grid1.Rows[0].Values[5] = (F6 + (F9 * Convert.ToDecimal(0.9714) + F10 * Convert.ToDecimal(1.229) + F11 * Convert.ToDecimal(1.4286) + F12 * Convert.ToDecimal(1.4714) + F13 * Convert.ToDecimal(1.4714) + F14 * Convert.ToDecimal(1.4571) + F15 * Convert.ToDecimal(1.4286) + F16 * Convert.ToDecimal(13.3) + F17 * Convert.ToDecimal(0.0341) + F18) / 10000);
 | ||
|             }
 | ||
|             if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && this.Grid1.Rows[0].Values[4].ToString() != "0" && this.Grid1.Rows[0].Values[4].ToString() != "未涉及" && !string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()))
 | ||
|             {
 | ||
|                 this.Grid1.Rows[0].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()), 2).ToString() + "%";
 | ||
|             }
 | ||
|             if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E20 > 0)
 | ||
|             {
 | ||
|                 this.Grid1.Rows[14].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E20, 4);
 | ||
|             }
 | ||
|             if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F20 > 0)
 | ||
|             {
 | ||
|                 this.Grid1.Rows[14].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F20, 4);
 | ||
|             }
 | ||
|             if (!string.IsNullOrEmpty(this.Grid1.Rows[14].Values[4].ToString()) && this.Grid1.Rows[14].Values[4].ToString() != "0" && this.Grid1.Rows[14].Values[4].ToString() != "未涉及" && !string.IsNullOrEmpty(this.Grid1.Rows[14].Values[5].ToString()))
 | ||
|             {
 | ||
|                 this.Grid1.Rows[14].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[14].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[14].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[14].Values[4].ToString()), 2).ToString() + "%";
 | ||
|             }
 | ||
|             if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E22 > 0)
 | ||
|             {
 | ||
|                 this.Grid1.Rows[16].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E22, 4);
 | ||
|             }
 | ||
|             if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F22 > 0)
 | ||
|             {
 | ||
|                 this.Grid1.Rows[16].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F22, 4);
 | ||
|             }
 | ||
|             if (!string.IsNullOrEmpty(this.Grid1.Rows[16].Values[4].ToString()) && this.Grid1.Rows[16].Values[4].ToString() != "0" && this.Grid1.Rows[16].Values[4].ToString() != "未涉及" && !string.IsNullOrEmpty(this.Grid1.Rows[16].Values[5].ToString()))
 | ||
|             {
 | ||
|                 this.Grid1.Rows[16].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[16].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[16].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[16].Values[4].ToString()), 2).ToString() + "%";
 | ||
|             }
 | ||
|             if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E24 > 0)
 | ||
|             {
 | ||
|                 this.Grid1.Rows[18].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E24, 4);
 | ||
|             }
 | ||
|             if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F24 > 0)
 | ||
|             {
 | ||
|                 this.Grid1.Rows[18].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F24, 4);
 | ||
|             }
 | ||
|             if (!string.IsNullOrEmpty(this.Grid1.Rows[18].Values[4].ToString()) && this.Grid1.Rows[18].Values[4].ToString() != "0" && this.Grid1.Rows[18].Values[4].ToString() != "未涉及" && !string.IsNullOrEmpty(this.Grid1.Rows[18].Values[5].ToString()))
 | ||
|             {
 | ||
|                 this.Grid1.Rows[18].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[18].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[18].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[18].Values[4].ToString()), 2).ToString() + "%";
 | ||
|             }
 | ||
|             if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E26 > 0)
 | ||
|             {
 | ||
|                 this.Grid1.Rows[20].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E26, 4);
 | ||
|             }
 | ||
|             if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F26 > 0)
 | ||
|             {
 | ||
|                 this.Grid1.Rows[20].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F26, 4);
 | ||
|             }
 | ||
|             if (!string.IsNullOrEmpty(this.Grid1.Rows[20].Values[4].ToString()) && this.Grid1.Rows[20].Values[4].ToString() != "0" && this.Grid1.Rows[20].Values[4].ToString() != "未涉及" && !string.IsNullOrEmpty(this.Grid1.Rows[20].Values[5].ToString()))
 | ||
|             {
 | ||
|                 this.Grid1.Rows[20].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[20].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[20].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[20].Values[4].ToString()), 2).ToString() + "%";
 | ||
|             }
 | ||
|             if (E22 > 0)
 | ||
|             {
 | ||
|                 this.Grid1.Rows[22].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[23].Values[4].ToString()) * 10000 / E22, 4);
 | ||
|             }
 | ||
|             if (F22 > 0)
 | ||
|             {
 | ||
|                 this.Grid1.Rows[22].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[23].Values[5].ToString()) * 10000 / F22, 4);
 | ||
|             }
 | ||
|             if (!string.IsNullOrEmpty(this.Grid1.Rows[22].Values[4].ToString()) && this.Grid1.Rows[22].Values[4].ToString() != "0" && this.Grid1.Rows[22].Values[4].ToString() != "未涉及" && !string.IsNullOrEmpty(this.Grid1.Rows[22].Values[5].ToString()))
 | ||
|             {
 | ||
|                 this.Grid1.Rows[22].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[22].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[22].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[22].Values[4].ToString()), 2).ToString() + "%";
 | ||
|             }
 | ||
|             if (E22 > 0 && E42 > 0)
 | ||
|             {
 | ||
|                 this.Grid1.Rows[36].Values[4] = decimal.Round(E42 * 10000 / E22, 4);
 | ||
|             }
 | ||
|             if (F22 > 0 && F42 > 0)
 | ||
|             {
 | ||
|                 this.Grid1.Rows[36].Values[5] = decimal.Round(F42 * 10000 / F22, 4);
 | ||
|             }
 | ||
|             if (!string.IsNullOrEmpty(this.Grid1.Rows[36].Values[4].ToString()) && this.Grid1.Rows[36].Values[4].ToString() != "0" && this.Grid1.Rows[36].Values[4].ToString() != "未涉及" && !string.IsNullOrEmpty(this.Grid1.Rows[36].Values[5].ToString()))
 | ||
|             {
 | ||
|                 this.Grid1.Rows[36].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[36].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[36].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[36].Values[4].ToString()), 2).ToString() + "%";
 | ||
|             }
 | ||
|             if (E44 > 0 && E46 > 0)
 | ||
|             {
 | ||
|                 this.Grid1.Rows[38].Values[4] = decimal.Round((E44 - E45) / E46 * 100, 4);
 | ||
|             }
 | ||
|             if (F44 > 0 && F46 > 0)
 | ||
|             {
 | ||
|                 this.Grid1.Rows[38].Values[5] = decimal.Round((F44 - F45) / F46 * 100, 4);
 | ||
|             }
 | ||
|             if (!string.IsNullOrEmpty(this.Grid1.Rows[38].Values[4].ToString()) && this.Grid1.Rows[38].Values[4].ToString() != "0" && this.Grid1.Rows[38].Values[4].ToString() != "未涉及" && !string.IsNullOrEmpty(this.Grid1.Rows[38].Values[5].ToString()))
 | ||
|             {
 | ||
|                 this.Grid1.Rows[38].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[38].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[38].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[38].Values[4].ToString()), 2).ToString() + "%";
 | ||
|             }
 | ||
|             if (E48 > 0 && E50 > 0)
 | ||
|             {
 | ||
|                 this.Grid1.Rows[42].Values[4] = decimal.Round((E48 - E49) / E50 * 100, 4);
 | ||
|             }
 | ||
|             if (F48 > 0 && F50 > 0)
 | ||
|             {
 | ||
|                 this.Grid1.Rows[42].Values[5] = decimal.Round((F48 - F49) / F50 * 100, 4);
 | ||
|             }
 | ||
|             if (!string.IsNullOrEmpty(this.Grid1.Rows[42].Values[4].ToString()) && this.Grid1.Rows[42].Values[4].ToString() != "0" && this.Grid1.Rows[42].Values[4].ToString() != "未涉及" && !string.IsNullOrEmpty(this.Grid1.Rows[42].Values[5].ToString()))
 | ||
|             {
 | ||
|                 this.Grid1.Rows[42].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[42].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[42].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[42].Values[4].ToString()), 2).ToString() + "%";
 | ||
|             }
 | ||
|             if (E64 > 0 && E65 > 0 && E20 > 0)
 | ||
|             {
 | ||
|                 this.Grid1.Rows[58].Values[4] = decimal.Round((E64 + E65) / E20, 4);
 | ||
|             }
 | ||
|             if (F64 > 0 && F65 > 0 && F20 > 0)
 | ||
|             {
 | ||
|                 this.Grid1.Rows[58].Values[5] = decimal.Round((F64 + F65) / F20, 4);
 | ||
|             }
 | ||
|             if (!string.IsNullOrEmpty(this.Grid1.Rows[58].Values[4].ToString()) && this.Grid1.Rows[58].Values[4].ToString() != "0" && this.Grid1.Rows[58].Values[4].ToString() != "未涉及" && !string.IsNullOrEmpty(this.Grid1.Rows[58].Values[5].ToString()))
 | ||
|             {
 | ||
|                 this.Grid1.Rows[58].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[58].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[58].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[58].Values[4].ToString()), 2).ToString() + "%";
 | ||
|             }
 | ||
|         }
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region 关闭窗口
 | ||
|         /// <summary>
 | ||
|         /// 关闭窗口
 | ||
|         /// </summary>
 | ||
|         /// <param name="sender"></param>
 | ||
|         /// <param name="e"></param>
 | ||
|         protected void Window1_Close(object sender, WindowCloseEventArgs e)
 | ||
|         {
 | ||
|             Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByArchitectureReportId(ArchitectureReportId);
 | ||
|             this.btnSave.Hidden = false;
 | ||
|         }
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region 保存、上报
 | ||
|         /// <summary>
 | ||
|         /// 保存数据
 | ||
|         /// </summary>
 | ||
|         /// <param name="type"></param>
 | ||
|         private void Save(string type)
 | ||
|         {
 | ||
|             //string ArchitectureReportId = Request.QueryString["ArchitectureReportId"];
 | ||
|             Model.Environmental_ArchitectureReport report = new Environmental_ArchitectureReport
 | ||
|             {
 | ||
|                 UnitId = drpUnit.SelectedValue,
 | ||
|                 Year = Funs.GetNewIntOrZero(drpYear.SelectedValue),
 | ||
|                 Month = Funs.GetNewIntOrZero(drpMonth.SelectedValue)
 | ||
|             };
 | ||
|             if (!string.IsNullOrEmpty(txtFillingDate.Text.Trim()))
 | ||
|             {
 | ||
|                 report.FillingDate = Convert.ToDateTime(txtFillingDate.Text.Trim());
 | ||
|             }
 | ||
|             report.DutyPerson = txtDutyPerson.Text.Trim();
 | ||
|             if (String.IsNullOrEmpty(ArchitectureReportId))
 | ||
|             {
 | ||
|                 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.UserName;
 | ||
|                     BLL.ArchitectureReportService.AddArchitectureReport(report);
 | ||
|                     BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Month.ToString(), report.ArchitectureReportId, BLL.Const.ArchitectureReportMenuId, BLL.Const.BtnAdd);
 | ||
|                 }
 | ||
|                 else
 | ||
|                 {
 | ||
|                     ShowNotify("该月份记录已存在!", MessageBoxIcon.Warning);
 | ||
|                     return;
 | ||
|                 }
 | ||
|             }
 | ||
|             else
 | ||
|             {
 | ||
|                 Model.Environmental_ArchitectureReport oldReport = BLL.ArchitectureReportService.GetArchitectureReportByArchitectureReportId(ArchitectureReportId);
 | ||
|                 report.ArchitectureReportId = ArchitectureReportId;
 | ||
|                 report.UpState = BLL.Const.UpState_2;
 | ||
|                 BLL.ArchitectureReportService.UpdateArchitectureReport(report);
 | ||
|                 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);
 | ||
|             List<Model.Environmental_ArchitectureReportItem> mReportItemList = new List<Environmental_ArchitectureReportItem>();
 | ||
|             GetItems(report.ArchitectureReportId);
 | ||
|             foreach (var item in items)
 | ||
|             {
 | ||
|                 Model.Environmental_ArchitectureReportItem newItem = new Environmental_ArchitectureReportItem();
 | ||
|                 newItem.ArchitectureReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_ArchitectureReportItem));
 | ||
|                 newItem.ArchitectureReportId = report.ArchitectureReportId;
 | ||
|                 newItem.BaseNumber = System.Web.HttpUtility.HtmlDecode(item.BaseNumber);
 | ||
|                 newItem.SortIndex = System.Web.HttpUtility.HtmlDecode(item.SortIndex);
 | ||
|                 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);
 | ||
|                 mReportItemList.Add(newItem);
 | ||
|             }
 | ||
|             if (type == "updata")     //数据同步
 | ||
|             {
 | ||
|                 if (report.UpState == BLL.Const.UpState_2)
 | ||
|                 {
 | ||
|                     string code = CNCECHSSEWebService.UpArchitectureReport(report.ArchitectureReportId, this.CurrUser);
 | ||
|                     if (code == "1")
 | ||
|                     {
 | ||
|                         ShowNotify("同步成功!", MessageBoxIcon.Success);
 | ||
|                         PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
 | ||
|                         return;
 | ||
|                     }
 | ||
|                     else if (code=="3")
 | ||
|                     {
 | ||
|                         Alert.ShowInParent("集团当前季度数据已锁定,无法上传!", MessageBoxIcon.Error);
 | ||
|                     }
 | ||
|                     else
 | ||
|                     {
 | ||
|                         Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error);
 | ||
|                     }
 | ||
|                 }
 | ||
|                 else
 | ||
|                 {
 | ||
|                     ShowNotify("当前单据状态不能同步!", MessageBoxIcon.Warning);
 | ||
|                     return;
 | ||
|                 }
 | ||
|             }
 | ||
|         }
 | ||
| 
 | ||
|         protected void btnSave_Click(object sender, EventArgs e)
 | ||
|         {
 | ||
|            /* bool isEmpty = false;
 | ||
|             foreach (JObject mergedRow in Grid1.GetMergedData())
 | ||
|             {
 | ||
|                 JObject values = mergedRow.Value<JObject>("values");
 | ||
|                 int rowIndex = mergedRow.Value<int>("index");
 | ||
|                 string sortIndex = values.Value<string>("SortIndex");
 | ||
|                 if (sortIndex == "18" || sortIndex == "37" || sortIndex == "38")
 | ||
|                 {
 | ||
|                     if (Funs.GetNewDecimalOrZero(System.Web.HttpUtility.HtmlDecode(values.Value<string>("ThisYearValue"))) == 0)
 | ||
|                     {
 | ||
|                         isEmpty = true;
 | ||
|                         break;
 | ||
|                     }
 | ||
|                 }
 | ||
|             }
 | ||
|             if (isEmpty)
 | ||
|             {
 | ||
|                 ShowNotify("营业收入(可比价)、万元收入二氧化碳排放(可比价)和二氧化碳排放量不能为空,必须填报数据!", MessageBoxIcon.Warning);
 | ||
|                 return;
 | ||
|             }*/
 | ||
|             Save("add");
 | ||
|             ShowNotify("保存成功!", MessageBoxIcon.Success);
 | ||
|             PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
 | ||
|         }
 | ||
| 
 | ||
|         protected void btnUpdata_Click(object sender, EventArgs e)
 | ||
|         {
 | ||
|             bool isEmpty = false;
 | ||
|             foreach (JObject mergedRow in Grid1.GetMergedData())
 | ||
|             {
 | ||
|                 JObject values = mergedRow.Value<JObject>("values");
 | ||
|                 int rowIndex = mergedRow.Value<int>("index");
 | ||
|                 string sortIndex = values.Value<string>("SortIndex");
 | ||
|                 if (sortIndex != "01" && sortIndex != "15" && sortIndex != "17" && sortIndex != "19" && sortIndex != "21" && sortIndex != "23"
 | ||
|                     && sortIndex != "37" && sortIndex != "59")
 | ||
|                 {
 | ||
|                     if (string.IsNullOrEmpty(values.Value<string>("LastYearValue")))
 | ||
|                     {
 | ||
|                         isEmpty = true;
 | ||
|                         break;
 | ||
|                     }
 | ||
|                     else
 | ||
|                     {
 | ||
|                         if (values.Value<string>("LastYearValue") != "未涉及")
 | ||
|                         {
 | ||
|                             try
 | ||
|                             {
 | ||
|                                 decimal d = Convert.ToDecimal(values.Value<string>("LastYearValue"));
 | ||
|                             }
 | ||
|                             catch (Exception)
 | ||
|                             {
 | ||
|                                 isEmpty = true;
 | ||
|                                 break;
 | ||
|                             }
 | ||
|                         }
 | ||
|                     }
 | ||
|                     if (string.IsNullOrEmpty(values.Value<string>("ThisYearValue")))
 | ||
|                     {
 | ||
|                         isEmpty = true;
 | ||
|                         break;
 | ||
|                     }
 | ||
|                     else
 | ||
|                     {
 | ||
|                         if (values.Value<string>("ThisYearValue") != "未涉及")
 | ||
|                         {
 | ||
|                             try
 | ||
|                             {
 | ||
|                                 decimal d = Convert.ToDecimal(values.Value<string>("ThisYearValue"));
 | ||
|                             }
 | ||
|                             catch (Exception)
 | ||
|                             {
 | ||
|                                 isEmpty = true;
 | ||
|                                 break;
 | ||
|                             }
 | ||
|                         }
 | ||
|                     }
 | ||
|                 }
 | ||
|             }
 | ||
|             if (isEmpty)
 | ||
|             {
 | ||
|                 ShowNotify("上年累计和本年累计数据不能为空,必须填报数据或填写“未涉及”!", MessageBoxIcon.Warning);
 | ||
|                 return;
 | ||
|             }
 | ||
|             Save("updata");
 | ||
|         }
 | ||
| 
 | ||
|         protected void btnSubmit_Click(object sender, EventArgs e)
 | ||
|         {
 | ||
|             bool isEmpty = false;
 | ||
|             foreach (JObject mergedRow in Grid1.GetMergedData())
 | ||
|             {
 | ||
|                 JObject values = mergedRow.Value<JObject>("values");
 | ||
|                 int rowIndex = mergedRow.Value<int>("index");
 | ||
|                 string sortIndex = values.Value<string>("SortIndex");
 | ||
|                 if (sortIndex == "18" || sortIndex == "37" || sortIndex == "38")
 | ||
|                 {
 | ||
|                     if (Funs.GetNewDecimalOrZero(System.Web.HttpUtility.HtmlDecode(values.Value<string>("ThisYearValue"))) == 0)
 | ||
|                     {
 | ||
|                         isEmpty = true;
 | ||
|                         break;
 | ||
|                     }
 | ||
|                 }
 | ||
|             }
 | ||
|             if (isEmpty)
 | ||
|             {
 | ||
|                 ShowNotify("营业收入(可比价)、万元收入二氧化碳排放(可比价)和二氧化碳排放量不能为空,必须填报数据!", MessageBoxIcon.Warning);
 | ||
|                 return;
 | ||
|             }
 | ||
|             Save("submit");
 | ||
|         }
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region 增加本月明细
 | ||
|         private void GetItems(string ArchitectureReportId)
 | ||
|         {
 | ||
|             foreach (JObject mergedRow in Grid1.GetMergedData())
 | ||
|             {
 | ||
|                 JObject values = mergedRow.Value<JObject>("values");
 | ||
|                 int rowIndex = mergedRow.Value<int>("index");
 | ||
|                 string sortIndex = values.Value<string>("SortIndex");
 | ||
|                 var item = items.FirstOrDefault(x => x.SortIndex == sortIndex);
 | ||
|                 if (item != null)
 | ||
|                 {
 | ||
|                     item.LastYearValue = System.Web.HttpUtility.HtmlDecode(values.Value<string>("LastYearValue"));
 | ||
|                     item.ThisYearValue = System.Web.HttpUtility.HtmlDecode(values.Value<string>("ThisYearValue"));
 | ||
|                     item.Rate = System.Web.HttpUtility.HtmlDecode(values.Value<string>("Rate"));
 | ||
|                 }
 | ||
|             }
 | ||
|         }
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region 获取明细
 | ||
|         private void GetNewItems(string year, string quarters)
 | ||
|         {
 | ||
|             var indexNames = ArchitectureReportItemService.GetIndexNames();
 | ||
|             var units = ArchitectureReportItemService.GetUnits();
 | ||
|             foreach (var indexName in indexNames)
 | ||
|             {
 | ||
|                 //增加明细集合
 | ||
|                 Model.ArchitectureReportItem item = new ArchitectureReportItem
 | ||
|                 {
 | ||
|                     ArchitectureReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_ArchitectureReportItem)),
 | ||
|                     IndexName = indexName.Text,
 | ||
|                     Unit = units.First(x => x.Value == indexName.Value).Text,
 | ||
|                     SortIndex = indexName.Value,
 | ||
|                 };
 | ||
|                 //if (item.SortIndex == "17" || item.SortIndex == "18" || item.SortIndex == "21" || item.SortIndex == "22" || item.SortIndex == "23" || item.SortIndex == "25" || item.SortIndex == "37")
 | ||
|                 //{
 | ||
|                 //    item.LastYearValue = "×";
 | ||
|                 //    item.ThisYearValue = "×";
 | ||
|                 //    if (item.SortIndex == "25")
 | ||
|                 //    {
 | ||
|                 //        item.Rate = "─";
 | ||
|                 //    }
 | ||
|                 //    else
 | ||
|                 //    {
 | ||
|                 //        item.Rate = "×";
 | ||
|                 //    }
 | ||
|                 //}
 | ||
|                 items.Add(item);
 | ||
|             }
 | ||
|         }
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region 单位下拉选择事件
 | ||
|         /// <summary>
 | ||
|         /// 单位下拉选择事件
 | ||
|         /// </summary>
 | ||
|         /// <param name="sender"></param>
 | ||
|         /// <param name="e"></param>
 | ||
|         protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e)
 | ||
|         {
 | ||
|             items.Clear();
 | ||
|             if (drpUnit.SelectedValue != BLL.Const._Null)
 | ||
|             {
 | ||
|                 //GetNewItems();
 | ||
|             }
 | ||
|             Grid1.DataSource = items;
 | ||
|             Grid1.DataBind();
 | ||
|         }
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region 获取按钮权限
 | ||
|         /// <summary>
 | ||
|         /// 获取按钮权限
 | ||
|         /// </summary>
 | ||
|         /// <param name="button"></param>
 | ||
|         /// <returns></returns>
 | ||
|         private void GetButtonPower()
 | ||
|         {
 | ||
|             var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ArchitectureReportMenuId);
 | ||
|             if (buttonList.Count() > 0)
 | ||
|             {
 | ||
|                 if (buttonList.Contains(BLL.Const.BtnSave))
 | ||
|                 {
 | ||
|                     this.btnSave.Hidden = false;
 | ||
|                     //this.btnCopy.Hidden = false;
 | ||
|                 }
 | ||
|                 //if (buttonList.Contains(BLL.Const.BtnSaveUp))
 | ||
|                 //{
 | ||
|                 //    this.btnUpdata.Hidden = false;
 | ||
|                 //}
 | ||
|             }
 | ||
|         }
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region 复制上个月数据
 | ||
|         /// <summary>
 | ||
|         /// 复制上个月的数据
 | ||
|         /// </summary>
 | ||
|         /// <param name="sender"></param>
 | ||
|         /// <param name="e"></param>
 | ||
|         protected void btnCopy_Click(object sender, EventArgs e)
 | ||
|         {
 | ||
|             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, showDate.Month);
 | ||
|                 if (ArchitectureReport != null)
 | ||
|                 {
 | ||
|                     Model.Environmental_ArchitectureReport newArchitectureReport = new Environmental_ArchitectureReport();
 | ||
|                     this.ArchitectureReportId = SQLHelper.GetNewID(typeof(Model.Environmental_ArchitectureReport));
 | ||
|                     newArchitectureReport.ArchitectureReportId = this.ArchitectureReportId;
 | ||
|                     newArchitectureReport.UnitId = this.drpUnit.SelectedValue;
 | ||
|                     newArchitectureReport.Year = Convert.ToInt32(this.drpYear.SelectedValue);
 | ||
|                     newArchitectureReport.Month = Convert.ToInt32(this.drpMonth.SelectedValue);
 | ||
|                     newArchitectureReport.FillingMan = this.CurrUser.UserName;
 | ||
|                     newArchitectureReport.FillingDate = DateTime.Now;
 | ||
|                     newArchitectureReport.DutyPerson = this.CurrUser.UserName;
 | ||
|                     newArchitectureReport.UpState = BLL.Const.UpState_2;
 | ||
|                     BLL.ArchitectureReportService.AddArchitectureReport(newArchitectureReport);
 | ||
| 
 | ||
|                     var oldItems = BLL.ArchitectureReportItemService.GetItems(ArchitectureReport.ArchitectureReportId);
 | ||
|                     if (oldItems.Count > 0)
 | ||
|                     {
 | ||
|                         foreach (var item in oldItems)
 | ||
|                         {
 | ||
|                             Model.Environmental_ArchitectureReportItem newItem = new Environmental_ArchitectureReportItem
 | ||
|                             {
 | ||
|                                 ArchitectureReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_ArchitectureReportItem)),
 | ||
|                                 ArchitectureReportId = this.ArchitectureReportId,
 | ||
|                                 BaseNumber = item.BaseNumber,
 | ||
|                                 SortIndex = item.SortIndex,
 | ||
|                                 LastYearValue = item.LastYearValue,
 | ||
|                                 ThisYearValue = item.ThisYearValue,
 | ||
|                                 Rate = item.Rate,
 | ||
|                             };
 | ||
|                             BLL.ArchitectureReportItemService.AddArchitectureReportItem(newItem);
 | ||
|                         }
 | ||
|                     }
 | ||
| 
 | ||
|                     GetValues(newArchitectureReport.ArchitectureReportId);
 | ||
|                 }
 | ||
|             }
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// 获取复制的值绑定到文本中
 | ||
|         /// </summary>
 | ||
|         private void GetValues(string ArchitectureReportId)
 | ||
|         {
 | ||
|             var report = BLL.ArchitectureReportService.GetArchitectureReportByArchitectureReportId(ArchitectureReportId);
 | ||
|             if (report != null)
 | ||
|             {
 | ||
|                 drpMonth.SelectedValue = report.Month.ToString();
 | ||
|                 drpYear.SelectedValue = report.Year.ToString();
 | ||
|                 drpUnit.SelectedValue = report.UnitId;
 | ||
|                 if (report.FillingDate != null)
 | ||
|                 {
 | ||
|                     txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", report.FillingDate);
 | ||
|                 }
 | ||
|                 txtDutyPerson.Text = report.DutyPerson;
 | ||
|                 items = BLL.ArchitectureReportItemService.GetShowItems(ArchitectureReportId);
 | ||
|                 this.Grid1.DataSource = items;
 | ||
|                 this.Grid1.DataBind();
 | ||
|             }
 | ||
|         }
 | ||
|         #endregion
 | ||
|     }
 | ||
| } |