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 IndustryOtherReportSave : PageBase { #region 定义变量 /// /// 报表主键Id /// public string IndustryOtherReportId { get { return (string)ViewState["IndustryOtherReportId"]; } set { ViewState["IndustryOtherReportId"] = value; } } /// /// 定义集合 /// private static List items = new List(); #endregion #region 加载页面 /// /// 加载页面 /// /// /// protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.Params["type"] != "-1") { this.GetButtonPower(); } items.Clear(); BLL.ConstValue.InitConstValueDropDownList(this.drpQuarters, ConstValue.Group_0011, 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 quarters = Request.QueryString["Quarterss"]; IndustryOtherReportId = Request.QueryString["IndustryOtherReportId"]; 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(IndustryOtherReportId)) { items = BLL.IndustryOtherReportItemService.GetShowItems(IndustryOtherReportId); this.Grid1.DataSource = items; this.Grid1.DataBind(); var report = BLL.IndustryOtherReportService.GetIndustryOtherReportByIndustryOtherReportId(IndustryOtherReportId); 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; } drpQuarters.SelectedValue = report.Quarters.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; drpQuarters.SelectedValue = quarters; drpYear.SelectedValue = year; txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); txtDutyPerson.Text = this.CurrUser.UserName; //增加明细集合 GetNewItems(year, quarters); this.Grid1.DataSource = items; this.Grid1.DataBind(); } SetUnEditableRow(); GetData(); } else { if (GetRequestEventArgument() == "UPDATE_SUMMARY") { GetData(); } } } #endregion #region 设置不可编辑行 private void SetUnEditableRow() { if (Grid1.Rows.Count == 73) { Grid1.Rows[0].CellCssClasses[4] = "f-grid-cell-uneditable"; Grid1.Rows[0].CellCssClasses[5] = "f-grid-cell-uneditable"; Grid1.Rows[15].CellCssClasses[4] = "f-grid-cell-uneditable"; Grid1.Rows[15].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[19].CellCssClasses[4] = "f-grid-cell-uneditable"; Grid1.Rows[19].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[23].CellCssClasses[4] = "f-grid-cell-uneditable"; Grid1.Rows[23].CellCssClasses[5] = "f-grid-cell-uneditable"; Grid1.Rows[25].CellCssClasses[4] = "f-grid-cell-uneditable"; Grid1.Rows[25].CellCssClasses[5] = "f-grid-cell-uneditable"; Grid1.Rows[27].CellCssClasses[4] = "f-grid-cell-uneditable"; Grid1.Rows[27].CellCssClasses[5] = "f-grid-cell-uneditable"; Grid1.Rows[48].CellCssClasses[4] = "f-grid-cell-uneditable"; Grid1.Rows[48].CellCssClasses[5] = "f-grid-cell-uneditable"; Grid1.Rows[50].CellCssClasses[4] = "f-grid-cell-uneditable"; Grid1.Rows[50].CellCssClasses[5] = "f-grid-cell-uneditable"; Grid1.Rows[54].CellCssClasses[4] = "f-grid-cell-uneditable"; Grid1.Rows[54].CellCssClasses[5] = "f-grid-cell-uneditable"; Grid1.Rows[70].CellCssClasses[4] = "f-grid-cell-uneditable"; Grid1.Rows[70].CellCssClasses[5] = "f-grid-cell-uneditable"; } //var lastYearReport = IndustryOtherReportService.GetIndustryOtherReportByUnitIdYear(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue) - 1); //if (lastYearReport.Count > 0) //{ // var lastYearReportItems = IndustryOtherReportItemService.GetLastYearItems(Funs.GetNewIntOrZero(drpYear.SelectedValue) - 1); // Grid1.Rows[1].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[2].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[3].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[4].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[5].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[6].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[7].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[8].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[9].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[10].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[11].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[12].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[13].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[15].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[16].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[17].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[19].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[20].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[21].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[22].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[23].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[24].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[25].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[26].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[27].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[28].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[29].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[30].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[31].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[32].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[33].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[34].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[35].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[36].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[37].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[38].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[39].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[40].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[41].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[42].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[43].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[44].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[45].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[46].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[47].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[48].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[49].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[50].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[51].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[52].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[53].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[54].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[55].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[56].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[57].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[59].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // Grid1.Rows[60].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); // SetLastYearUnEditableRow(); //} //else //{ // DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + (Funs.GetNewIntOrZero(this.drpQuarters.SelectedValue) * 3).ToString()); // DateTime lastQuarters = nowDate.Value.AddMonths(-3); // Environmental_IndustryOtherReport lastQuartersReport = IndustryOtherReportService.GetIndustryOtherReportByUnitIdDate(drpUnit.SelectedValue, lastQuarters.Year, Funs.GetNowQuarterlyByTime(lastQuarters)); // if (lastQuartersReport != null) // { // var lastQuartersReportItems = BLL.IndustryOtherReportItemService.GetItems(lastQuartersReport.IndustryOtherReportId); // 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 quarters = Request.QueryString["Quarterss"]; // var items = (from x in Funs.DB.Environmental_ProjectIndustryOtherReportItem // join y in Funs.DB.Environmental_ProjectIndustryOtherReport // on x.IndustryOtherReportId equals y.IndustryOtherReportId // where y.Year == Funs.GetNewIntOrZero(year) && y.Quarters == Funs.GetNewIntOrZero(quarters) // 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)); // } // } //} } 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 private string row0, row15, row17, row19, row21, row23, row25, row27, row48, row50, row54, row70; #region 计算方法 /// /// 计算方法 /// private void GetData() { 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, E19 = 0, F19 = 0, E20 = 0, F20 = 0, E21 = 0, F21 = 0, E22 = 0, F22 = 0, E23 = 0, F23 = 0, E24 = 0, F24 = 0, E25 = 0, F25 = 0, E26 = 0, F26 = 0, E27 = 0, F27 = 0, E28, F28, E29 = 0, F29 = 0, E30 = 0, F30 = 0, E31 = 0, F31 = 0, E32 = 0, F32 = 0, E33 = 0, F33 = 0, E34 = 0, F34 = 0, E35 = 0, F35 = 0, E36, F36, E37 = 0, F37 = 0, E38 = 0, F38 = 0, E39, F39, E40, F40, E41 = 0, F41 = 0, E42, F42, E43, F43, E44, F44, E45, F45, E46, F46, E47, F47, E48, F48, E49, F49, E50, F50, E51, F51, E52, F52, E53, F53, E54 = 0, F54 = 0, E55 = 0, F55 = 0, E56 = 0, F56 = 0, E57 = 0, F57 = 0, E58 = 0, F58 = 0, E59, F59, E60 = 0, F60 = 0, E61 = 0, F61 = 0, E62 = 0, F62 = 0, E63 = 0, F63 = 0, E64 = 0, F64 = 0, E65 = 0, F65 = 0, E66 = 0, F66 = 0, E67 = 0, F67 = 0, E68 = 0, F68 = 0, E69 = 0, F69 = 0, E70 = 0, F70 = 0, E71 = 0, F71 = 0, E72 = 0, F72 = 0, E73 = 0, F73 = 0, E74 = 0, F74 = 0, E75 = 0, F75 = 0, E76 = 0, F76 = 0, E77 = 0, F77 = 0; JArray mergedData = Grid1.GetMergedData(); foreach (JObject mergedRow in mergedData) { JObject values = mergedRow.Value("values"); int rowIndex = mergedRow.Value("index"); string sortIndex = values.Value("SortIndex"); var item = items.FirstOrDefault(x => x.SortIndex == sortIndex); if (item != null) { item.BaseNumber = System.Web.HttpUtility.HtmlDecode(values.Value("BaseNumber")); item.LastYearValue = System.Web.HttpUtility.HtmlDecode(values.Value("LastYearValue")); item.ThisYearValue = System.Web.HttpUtility.HtmlDecode(values.Value("ThisYearValue")); } } this.Grid1.DataSource = items; this.Grid1.DataBind(); SetUnEditableRow(); foreach (JObject mergedRow in mergedData) { JObject values = mergedRow.Value("values"); int rowIndex = mergedRow.Value("index"); if (rowIndex == 1) { E6 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); F6 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F7 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F8 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F9 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F10 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F11 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F12 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F13 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F14 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F15 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F16 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F17 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F18 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); if (E18 > 0 && F18 > 0) { this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F18 - E18) * 100 / E18, 2).ToString() + "%"; } } else if (rowIndex == 14) { E19 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); F19 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); if (E19 > 0 && F19 > 0) { this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F19 - E19) * 100 / E19, 2).ToString() + "%"; } } else if (rowIndex == 15) { E20 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); F20 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F21 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F22 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); if (E22 > 0 && F22 > 0) { this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F22 - E22) * 100 / E22, 2).ToString() + "%"; } } else if (rowIndex == 18) { E23 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); F23 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); if (E23 > 0 && F23 > 0) { this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F23 - E23) * 100 / E23, 2).ToString() + "%"; } } else if (rowIndex == 19) { E24 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); F24 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F25 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F26 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F27 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F28 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F29 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F30 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F31 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F32 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F33 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F34 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F35 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F36 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F37 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F38 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F39 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F40 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F41 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F42 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F43 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F44 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F45 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F46 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F47 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F48 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F49 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F50 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F51 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F52 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F53 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F54 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F55 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F56 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F57 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F58 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F59 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F60 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F61 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F62 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); if (E62 > 0 && F62 > 0) { this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F62 - E62) * 100 / E62, 2).ToString() + "%"; } } else if (rowIndex == 58) { E63 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); F63 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); if (E63 > 0 && F63 > 0) { this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F63 - E63) * 100 / E63, 2).ToString() + "%"; } } else if (rowIndex == 59) { E64 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); F64 = Funs.GetNewDecimalOrZero(values.Value("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("LastYearValue")); F65 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); if (E65 > 0 && F65 > 0) { this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F65 - E65) * 100 / E65, 2).ToString() + "%"; } } else if (rowIndex == 61) { E66 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); F66 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); if (E66 > 0 && F66 > 0) { this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F66 - E66) * 100 / E66, 2).ToString() + "%"; } } else if (rowIndex == 62) { E67 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); F67 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); if (E67 > 0 && F67 > 0) { this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F67 - E67) * 100 / E67, 2).ToString() + "%"; } } else if (rowIndex == 63) { E68 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); F68 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); if (E68 > 0 && F68 > 0) { this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F68 - E68) * 100 / E68, 2).ToString() + "%"; } } else if (rowIndex == 64) { E69 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); F69 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); if (E69 > 0 && F69 > 0) { this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F69 - E69) * 100 / E69, 2).ToString() + "%"; } } else if (rowIndex == 65) { E70 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); F70 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); if (E70 > 0 && F70 > 0) { this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F70 - E70) * 100 / E70, 2).ToString() + "%"; } } else if (rowIndex == 66) { E71 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); F71 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); if (E71 > 0 && F71 > 0) { this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F71 - E71) * 100 / E71, 2).ToString() + "%"; } } else if (rowIndex == 67) { E72 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); F72 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); if (E72 > 0 && F72 > 0) { this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F72 - E72) * 100 / E72, 2).ToString() + "%"; } } else if (rowIndex == 68) { E73 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); F73 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); if (E73 > 0 && F73 > 0) { this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F73 - E73) * 100 / E73, 2).ToString() + "%"; } } else if (rowIndex == 69) { E74 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); F74 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); if (E74 > 0 && F74 > 0) { this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F74 - E74) * 100 / E74, 2).ToString() + "%"; } } else if (rowIndex == 70) { E75 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); F75 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); if (E75 > 0 && F75 > 0) { this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F75 - E75) * 100 / E75, 2).ToString() + "%"; } } else if (rowIndex == 71) { E76 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); F76 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); if (E76 > 0 && F76 > 0) { this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F76 - E76) * 100 / E76, 2).ToString() + "%"; } } else if (rowIndex == 72) { E77 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); F77 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); if (E77 > 0 && F77 > 0) { this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F77 - E77) * 100 / E77, 2).ToString() + "%"; } } } if (E7 > 0 || E10 > 0 || E11 > 0 || E12 > 0 || E13 > 0 || E14 > 0 || E15 > 0 || E16 > 0 || E17 > 0 || E18 > 0 || E19 > 0) { this.Grid1.Rows[0].Values[4] = (E7 + (E10 * Convert.ToDecimal(0.9714) + E11 * Convert.ToDecimal(1.229) + E12 * Convert.ToDecimal(1.4286) + E13 * Convert.ToDecimal(1.4714) + E14 * Convert.ToDecimal(1.4714) + E15 * Convert.ToDecimal(1.4571) + E16 * Convert.ToDecimal(1.4286) + E17 * Convert.ToDecimal(13.3) + E18 * Convert.ToDecimal(0.0341) + E19) / 10000); } if (F7 > 0 || F10 > 0 || F11 > 0 || F12 > 0 || F13 > 0 || F14 > 0 || F15 > 0 || F16 > 0 || F17 > 0 || F18 > 0 || F19 > 0) { this.Grid1.Rows[0].Values[5] = (F7 + (F10 * Convert.ToDecimal(0.9714) + F11 * Convert.ToDecimal(1.229) + F12 * Convert.ToDecimal(1.4286) + F13 * Convert.ToDecimal(1.4714) + F14 * Convert.ToDecimal(1.4714) + F15 * Convert.ToDecimal(1.4571) + F16 * Convert.ToDecimal(1.4286) + F17 * Convert.ToDecimal(13.3) + F18 * Convert.ToDecimal(0.0341) + F19) / 10000); } row0 = this.Grid1.Rows[0].Values[5].ToString(); if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && this.Grid1.Rows[0].Values[4].ToString() != "0" && !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 (E21 > 0) { this.Grid1.Rows[15].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E21, 4); } if (F21 > 0) { this.Grid1.Rows[15].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F21, 4); } row15 = this.Grid1.Rows[15].Values[5].ToString(); if (!string.IsNullOrEmpty(this.Grid1.Rows[15].Values[4].ToString()) && this.Grid1.Rows[15].Values[4].ToString() != "0" && this.Grid1.Rows[15].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[15].Values[5].ToString())) { this.Grid1.Rows[15].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[15].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[15].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[15].Values[4].ToString()), 2).ToString() + "%"; } if (E23 > 0) { this.Grid1.Rows[17].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E23, 4); } if (F23 > 0) { this.Grid1.Rows[17].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F23, 4); } row17 = this.Grid1.Rows[17].Values[5].ToString(); if (!string.IsNullOrEmpty(this.Grid1.Rows[17].Values[4].ToString()) && this.Grid1.Rows[17].Values[4].ToString() != "0" && this.Grid1.Rows[17].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[17].Values[5].ToString())) { this.Grid1.Rows[17].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[17].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[17].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[17].Values[4].ToString()), 2).ToString() + "%"; } if (E25 > 0) { this.Grid1.Rows[19].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E25, 4); } if (F25 > 0) { this.Grid1.Rows[19].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F25, 4); } row19 = this.Grid1.Rows[19].Values[5].ToString(); if (!string.IsNullOrEmpty(this.Grid1.Rows[19].Values[4].ToString()) && this.Grid1.Rows[19].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[19].Values[5].ToString())) { this.Grid1.Rows[19].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[19].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[19].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[19].Values[4].ToString()), 2).ToString() + "%"; } if (E27 > 0) { this.Grid1.Rows[21].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E27, 4); } if (F27 > 0) { this.Grid1.Rows[21].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F27, 4); } row21 = this.Grid1.Rows[21].Values[5].ToString(); if (!string.IsNullOrEmpty(this.Grid1.Rows[21].Values[4].ToString()) && this.Grid1.Rows[21].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[21].Values[5].ToString())) { this.Grid1.Rows[21].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[21].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[21].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[21].Values[4].ToString()), 2).ToString() + "%"; } if (E23 > 0) { this.Grid1.Rows[23].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[24].Values[4].ToString()) * 10000 / E23, 4); } if (F23 > 0) { this.Grid1.Rows[23].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[24].Values[5].ToString()) * 10000 / F23, 4); } row23 = this.Grid1.Rows[23].Values[5].ToString(); if (!string.IsNullOrEmpty(this.Grid1.Rows[23].Values[4].ToString()) && this.Grid1.Rows[23].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[23].Values[5].ToString())) { this.Grid1.Rows[23].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[23].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[23].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[23].Values[4].ToString()), 2).ToString() + "%"; } if (E29 > 0) { this.Grid1.Rows[25].Values[4] = decimal.Round(E31 / (E29 + E31) * 100, 4); } else { this.Grid1.Rows[25].Values[4] = "0"; } if (F29 > 0) { this.Grid1.Rows[25].Values[5] = decimal.Round(F31 / (F29 + F31) * 100, 4); } else { this.Grid1.Rows[25].Values[5] = "0"; } row25 = this.Grid1.Rows[25].Values[5].ToString(); if (!string.IsNullOrEmpty(this.Grid1.Rows[25].Values[4].ToString()) && this.Grid1.Rows[25].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[25].Values[5].ToString())) { this.Grid1.Rows[25].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[25].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[25].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[25].Values[4].ToString()), 2).ToString() + "%"; } if (E34 > 0) { this.Grid1.Rows[27].Values[4] = decimal.Round(1000 * E33 / E34, 4); } if (F34 > 0) { this.Grid1.Rows[27].Values[5] = decimal.Round(1000 * F33 / F34, 4); } row27 = this.Grid1.Rows[27].Values[5].ToString(); if (!string.IsNullOrEmpty(this.Grid1.Rows[27].Values[4].ToString()) && this.Grid1.Rows[27].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[27].Values[5].ToString())) { this.Grid1.Rows[27].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[27].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[27].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[27].Values[4].ToString()), 2).ToString() + "%"; } if (E23 > 0) { this.Grid1.Rows[48].Values[4] = decimal.Round(E54 * 10000 / E23, 4); } if (F23 > 0) { this.Grid1.Rows[48].Values[5] = decimal.Round(F54 * 10000 / F23, 4); } row48 = this.Grid1.Rows[48].Values[5].ToString(); if (!string.IsNullOrEmpty(this.Grid1.Rows[48].Values[4].ToString()) && this.Grid1.Rows[48].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[48].Values[5].ToString())) { this.Grid1.Rows[48].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[48].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[48].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[48].Values[4].ToString()), 2).ToString() + "%"; } if (E58 > 0) { this.Grid1.Rows[50].Values[4] = decimal.Round((E56 - E57) / E58, 4) * 100; } if (F58 > 0) { this.Grid1.Rows[50].Values[5] = decimal.Round((F56 - F57) / F58, 4) * 100; } row50 = this.Grid1.Rows[50].Values[5].ToString(); if (!string.IsNullOrEmpty(this.Grid1.Rows[50].Values[4].ToString()) && this.Grid1.Rows[50].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[50].Values[5].ToString())) { this.Grid1.Rows[50].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[50].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[50].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[50].Values[4].ToString()), 2).ToString() + "%"; } if (E62 > 0) { this.Grid1.Rows[54].Values[4] = decimal.Round((E60 - E61) / E62, 4) * 100; } if (F62 > 0) { this.Grid1.Rows[54].Values[5] = decimal.Round((F60 - F61) / F62, 4) * 100; } row54 = this.Grid1.Rows[54].Values[5].ToString(); if (!string.IsNullOrEmpty(this.Grid1.Rows[54].Values[4].ToString()) && this.Grid1.Rows[54].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[54].Values[5].ToString())) { this.Grid1.Rows[54].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[54].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[54].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[54].Values[4].ToString()), 2).ToString() + "%"; } if (E23 > 0) { this.Grid1.Rows[70].Values[4] = decimal.Round((E76 + E77) / E23, 4); } if (F23 > 0) { this.Grid1.Rows[70].Values[5] = decimal.Round((F76 + F77) / F23, 4); } row70 = this.Grid1.Rows[70].Values[5].ToString(); if (!string.IsNullOrEmpty(this.Grid1.Rows[70].Values[4].ToString()) && this.Grid1.Rows[70].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[70].Values[5].ToString())) { this.Grid1.Rows[70].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[70].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[70].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[70].Values[4].ToString()), 2).ToString() + "%"; } } #endregion #region 关闭窗口 /// /// 关闭窗口 /// /// /// protected void Window1_Close(object sender, WindowCloseEventArgs e) { Model.Environmental_IndustryOtherReport report = BLL.IndustryOtherReportService.GetIndustryOtherReportByIndustryOtherReportId(IndustryOtherReportId); this.btnSave.Hidden = false; } #endregion #region 保存、上报 /// /// 保存数据 /// /// private void Save(string type) { //string IndustryOtherReportId = Request.QueryString["IndustryOtherReportId"]; Model.Environmental_IndustryOtherReport report = new Environmental_IndustryOtherReport { UnitId = drpUnit.SelectedValue, Year = Funs.GetNewIntOrZero(drpYear.SelectedValue), Quarters = Funs.GetNewIntOrZero(drpQuarters.SelectedValue) }; if (!string.IsNullOrEmpty(txtFillingDate.Text.Trim())) { report.FillingDate = Convert.ToDateTime(txtFillingDate.Text.Trim()); } report.DutyPerson = txtDutyPerson.Text.Trim(); if (String.IsNullOrEmpty(IndustryOtherReportId)) { Environmental_IndustryOtherReport old = IndustryOtherReportService.GetIndustryOtherReportByUnitIdDate(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); if (old == null) { report.IndustryOtherReportId = SQLHelper.GetNewID(typeof(Model.Environmental_IndustryOtherReport)); report.UpState = BLL.Const.UpState_2; report.FillingMan = this.CurrUser.UserName; BLL.IndustryOtherReportService.AddIndustryOtherReport(report); BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Quarters.ToString(), report.IndustryOtherReportId, BLL.Const.IndustryOtherReportMenuId, BLL.Const.BtnAdd); } else { ShowNotify("该月份记录已存在!", MessageBoxIcon.Warning); return; } } else { Model.Environmental_IndustryOtherReport oldReport = BLL.IndustryOtherReportService.GetIndustryOtherReportByIndustryOtherReportId(IndustryOtherReportId); report.IndustryOtherReportId = IndustryOtherReportId; report.UpState = BLL.Const.UpState_2; BLL.IndustryOtherReportService.UpdateIndustryOtherReport(report); BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Quarters.ToString(), report.IndustryOtherReportId, BLL.Const.IndustryOtherReportMenuId, BLL.Const.BtnModify); } IndustryOtherReportId = report.IndustryOtherReportId; BLL.IndustryOtherReportItemService.DeleteIndustryOtherReportItemByIndustryOtherReportId(report.IndustryOtherReportId); List mReportItemList = new List(); GetItems(report.IndustryOtherReportId); foreach (var item in items) { Model.Environmental_IndustryOtherReportItem newItem = new Environmental_IndustryOtherReportItem(); newItem.IndustryOtherReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_IndustryOtherReportItem)); newItem.IndustryOtherReportId = report.IndustryOtherReportId; 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); IndustryOtherReportItemService.AddIndustryOtherReportItem(newItem); mReportItemList.Add(newItem); } if (type == "updata") //数据同步 { if (report.UpState == BLL.Const.UpState_2) { string code = CNCECHSSEWebService.UpIndustryOtherReport(report.IndustryOtherReportId, 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("values"); int rowIndex = mergedRow.Value("index"); string sortIndex = values.Value("SortIndex"); if (sortIndex == "18" || sortIndex == "37" || sortIndex == "38") { if (Funs.GetNewDecimalOrZero(System.Web.HttpUtility.HtmlDecode(values.Value("ThisYearValue"))) == 0) { isEmpty = true; break; } } } if (isEmpty) { ShowNotify("营业收入(可比价)、万元收入二氧化碳排放(可比价)和二氧化碳排放量不能为空,必须填报数据!", MessageBoxIcon.Warning); return; }*/ Save("add"); ShowNotify("保存成功!", MessageBoxIcon.Success); PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } protected void btnUpdata_Click(object sender, EventArgs e) { bool isEmpty = false; foreach (JObject mergedRow in Grid1.GetMergedData()) { JObject values = mergedRow.Value("values"); int rowIndex = mergedRow.Value("index"); string sortIndex = values.Value("SortIndex"); if (sortIndex != "01" && sortIndex != "16" && sortIndex != "18" && sortIndex != "20" && sortIndex != "22" && sortIndex != "24" && sortIndex != "26" && sortIndex != "28" && sortIndex != "49" && sortIndex != "51" && sortIndex != "55" && sortIndex != "71") { if (string.IsNullOrEmpty(values.Value("LastYearValue"))) { isEmpty = true; break; } else { if (values.Value("LastYearValue") != "未涉及") { try { decimal d = Convert.ToDecimal(values.Value("LastYearValue")); } catch (Exception) { isEmpty = true; break; } } } if (string.IsNullOrEmpty(values.Value("ThisYearValue"))) { isEmpty = true; break; } else { if (values.Value("ThisYearValue") != "未涉及") { try { decimal d = Convert.ToDecimal(values.Value("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("values"); int rowIndex = mergedRow.Value("index"); string sortIndex = values.Value("SortIndex"); if (sortIndex == "18" || sortIndex == "37" || sortIndex == "38") { if (Funs.GetNewDecimalOrZero(System.Web.HttpUtility.HtmlDecode(values.Value("ThisYearValue"))) == 0) { isEmpty = true; break; } } } if (isEmpty) { ShowNotify("营业收入(可比价)、万元收入二氧化碳排放(可比价)和二氧化碳排放量不能为空,必须填报数据!", MessageBoxIcon.Warning); return; } Save("submit"); } #endregion #region 增加本月明细 private void GetItems(string IndustryOtherReportId) { foreach (JObject mergedRow in Grid1.GetMergedData()) { JObject values = mergedRow.Value("values"); int rowIndex = mergedRow.Value("index"); string sortIndex = values.Value("SortIndex"); var item = items.FirstOrDefault(x => x.SortIndex == sortIndex); if (item != null) { item.LastYearValue = System.Web.HttpUtility.HtmlDecode(values.Value("LastYearValue")); item.ThisYearValue = System.Web.HttpUtility.HtmlDecode(values.Value("ThisYearValue")); item.Rate = System.Web.HttpUtility.HtmlDecode(values.Value("Rate")); } } } #endregion #region 获取明细 private void GetNewItems(string year, string quarters) { var indexNames = IndustryOtherReportItemService.GetIndexNames(); var units = IndustryOtherReportItemService.GetUnits(); foreach (var indexName in indexNames) { //增加明细集合 Model.IndustryOtherReportItem item = new IndustryOtherReportItem { IndustryOtherReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_IndustryOtherReportItem)), 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 单位下拉选择事件 /// /// 单位下拉选择事件 /// /// /// protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e) { items.Clear(); if (drpUnit.SelectedValue != BLL.Const._Null) { //GetNewItems(); } Grid1.DataSource = items; Grid1.DataBind(); } #endregion #region 获取按钮权限 /// /// 获取按钮权限 /// /// /// private void GetButtonPower() { var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.IndustryOtherReportMenuId); 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 复制上个月数据 /// /// 复制上个月的数据 /// /// /// protected void btnCopy_Click(object sender, EventArgs e) { DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + (Funs.GetNewIntOrZero(this.drpQuarters.SelectedValue) * 3).ToString()); if (nowDate.HasValue) { DateTime showDate = new DateTime(); showDate = nowDate.Value.AddMonths(-3); Model.Environmental_IndustryOtherReport IndustryOtherReport = BLL.IndustryOtherReportService.GetIndustryOtherReportByUnitIdAndYearAndQuarters(this.drpUnit.SelectedValue, showDate.Year, Funs.GetNowQuarterlyByTime(showDate)); if (IndustryOtherReport != null) { Model.Environmental_IndustryOtherReport newIndustryOtherReport = new Environmental_IndustryOtherReport(); this.IndustryOtherReportId = SQLHelper.GetNewID(typeof(Model.Environmental_IndustryOtherReport)); newIndustryOtherReport.IndustryOtherReportId = this.IndustryOtherReportId; newIndustryOtherReport.UnitId = this.drpUnit.SelectedValue; newIndustryOtherReport.Year = Convert.ToInt32(this.drpYear.SelectedValue); newIndustryOtherReport.Quarters = Convert.ToInt32(this.drpQuarters.SelectedValue); newIndustryOtherReport.FillingMan = this.CurrUser.UserName; newIndustryOtherReport.FillingDate = DateTime.Now; newIndustryOtherReport.DutyPerson = this.CurrUser.UserName; newIndustryOtherReport.UpState = BLL.Const.UpState_2; BLL.IndustryOtherReportService.AddIndustryOtherReport(newIndustryOtherReport); var oldItems = BLL.IndustryOtherReportItemService.GetItems(IndustryOtherReport.IndustryOtherReportId); if (oldItems.Count > 0) { foreach (var item in oldItems) { Model.Environmental_IndustryOtherReportItem newItem = new Environmental_IndustryOtherReportItem { IndustryOtherReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_IndustryOtherReportItem)), IndustryOtherReportId = this.IndustryOtherReportId, BaseNumber = item.BaseNumber, SortIndex = item.SortIndex, LastYearValue = item.LastYearValue, ThisYearValue = item.ThisYearValue, Rate = item.Rate, }; BLL.IndustryOtherReportItemService.AddIndustryOtherReportItem(newItem); } } GetValues(newIndustryOtherReport.IndustryOtherReportId); } } } /// /// 获取复制的值绑定到文本中 /// private void GetValues(string IndustryOtherReportId) { var report = BLL.IndustryOtherReportService.GetIndustryOtherReportByIndustryOtherReportId(IndustryOtherReportId); if (report != null) { drpQuarters.SelectedValue = report.Quarters.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.IndustryOtherReportItemService.GetShowItems(IndustryOtherReportId); this.Grid1.DataSource = items; this.Grid1.DataBind(); } } #endregion } }