/// <summary> /// 绑定动态费用明细 /// </summary> private void BindDataGrid(BLL.CostBudgetDynamic dyn, bool IsScreenToTable) { try { DataTable tbDtl = dyn.tbHtml; //已批预算的审核日期 this.lblTargetCheckDate.Text = dyn.GetTargetCheckDate(); string VerID = dyn.GetTargetVerID(); this.txtHasTargetHis.Value = (BLL.ConvertRule.ToDecimal(VerID) > 0)?"1":""; if (VerID != "") { VerID = "版本" + VerID; } //版本号链接 this.spanTargetVerID.InnerText = ""; this.hrefTargetVerID.InnerText = ""; if (this.txtHasTargetHis.Value == "1") //有历史版本 { this.hrefTargetVerID.InnerText = VerID; } else { this.spanTargetVerID.InnerText = VerID; } //历史目标费用 string TargetHisHead1 = ""; string TargetHisHead2 = ""; dyn.GenerateTargetHisHead(ref TargetHisHead1, ref TargetHisHead2); ViewState["TargetHisHead1"] = TargetHisHead1; ViewState["TargetHisHead2"] = TargetHisHead2; ViewState["HasTargetChange"] = dyn.HasTargetChange; if (dyn.HasTargetChange) { this.spanListTitleTargetMoneyDesc.InnerText = dyn.TargetChangeDesc; this.spanListTitleTargetMoney.Style["display"] = ""; } else { this.spanListTitleTargetMoneyDesc.InnerText = ""; this.spanListTitleTargetMoney.Style["display"] = "none"; } if (IsScreenToTable) { //屏幕数据保存到临时表 tbDtl = ScreenToTable(false); } else { //折叠全部费用项 BLL.CostBudgetPageRule.CollapseAll(tbDtl); if (dyn.NeedApport) //有分摊时,多了一级总计 { BLL.CostBudgetPageRule.ExpandDeep(tbDtl, 3); } else { BLL.CostBudgetPageRule.ExpandDeep(tbDtl, 2); } } this.dgList.DataSource = tbDtl; this.dgList.DataBind(); /* * string[] arrField = {"ItemMoney", "OldItemMoney", "TotalPayoutMoney", "RemainItemMoney"}; * decimal[] arrSum = BLL.MathRule.SumColumn(tb, arrField); * this.dgList.Columns[2].FooterText = arrSum[0].ToString("N"); * this.dgList.Columns[3].FooterText = arrSum[1].ToString("N"); * this.dgList.Columns[6].FooterText = arrSum[2].ToString("N"); * this.dgList.Columns[7].FooterText = arrSum[3].ToString("N"); * * this.dgList.DataSource = tb; * this.dgList.DataBind(); */ } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, ""); Response.Write(Rms.Web.JavaScript.Alert(true, "绑定动态费用明细出错:" + ex.Message)); } }
/// <summary> /// 绑定动态费用明细 /// </summary> private void BindDataGrid(BLL.CostBudgetDynamic dyn, bool IsScreenToTable) { try { DataTable tbDtl = dyn.tbHtml; //已批预算的审核日期 this.lblTargetCheckDate.Text = dyn.GetTargetCheckDate(); string VerID = dyn.GetTargetVerID(); this.txtHasTargetHis.Value = (BLL.ConvertRule.ToDecimal(VerID) > 0) ? "1" : ""; if (VerID != "") { VerID = "版本" + VerID; } //版本号链接 this.spanTargetVerID.InnerText = ""; this.hrefTargetVerID.InnerText = ""; if (this.txtHasTargetHis.Value == "1") //有历史版本 { this.hrefTargetVerID.InnerText = VerID; } else { this.spanTargetVerID.InnerText = VerID; } /* * //历史目标费用 * string TargetHisHead1 = ""; * string TargetHisHead2 = ""; * dyn.GenerateTargetHisHead(ref TargetHisHead1, ref TargetHisHead2); * * ViewState["TargetHisHead1"] = TargetHisHead1; * ViewState["TargetHisHead2"] = TargetHisHead2; * * ViewState["HasTargetChange"] = dyn.HasTargetChange; * if (dyn.HasTargetChange) * { * this.spanListTitleTargetMoneyDesc.InnerText = dyn.TargetChangeDesc; * this.spanListTitleTargetMoney.Style["display"] = ""; * } * else * { * this.spanListTitleTargetMoneyDesc.InnerText = ""; * this.spanListTitleTargetMoney.Style["display"] = "none"; * } * * if (IsScreenToTable) * { * //屏幕数据保存到临时表 * tbDtl = ScreenToTable(false); * } * else * { * //折叠全部费用项 * BLL.CostBudgetPageRule.CollapseAll(tbDtl); * * if (dyn.NeedApport) //有分摊时,多了一级总计 * { * BLL.CostBudgetPageRule.ExpandDeep(tbDtl, 3); * } * else * { * BLL.CostBudgetPageRule.ExpandDeep(tbDtl, 2); * } * } */ } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, ""); Response.Write(Rms.Web.JavaScript.Alert(true, "绑定动态费用明细出错:" + ex.Message)); } }