protected void btnBindResource_Click(object sender, EventArgs e) { this.UpdateStorageStockDataSource(); DataTable dataTable = this.ViewState[this.stockDataSourceName] as DataTable; if (dataTable != null) { ISerializable serializable = new JsonSerializer(); string[] array = serializable.Deserialize <string[]>(this.hfldResourceId.Value); if (array != null) { DataTable resourceInitialize = this.resource.GetResourceInitialize(array); dataTable.PrimaryKey = new DataColumn[] { dataTable.Columns["ResourceId"] }; resourceInitialize.PrimaryKey = new DataColumn[] { resourceInitialize.Columns["ResourceId"] }; dataTable.Merge(resourceInitialize, true); this.gvwStorageStock.DataSource = dataTable; this.gvwStorageStock.DataBind(); if (dataTable.Rows.Count > 0) { string total = Convert.ToDecimal(dataTable.Compute("SUM(Total)", string.Empty)).ToString("0.000"); GridViewUtility.AddTotalRow(this.gvwStorageStock, total, 11); } this.DisabledBtnSave(); } } }
protected void btnBindResource_Click(object sender, System.EventArgs e) { this.UpdateStorageStockDataSource(); DataTable dataTable = this.ViewState[this.stockDataSourceName] as DataTable; if (dataTable != null) { ISerializable serializable = new JsonSerializer(); string[] array = serializable.Deserialize <string[]>(this.hfldResourceCode.Value); //string[] array2 = serializable.Deserialize<string[]>(this.hfldResourceCode2.Value); if (array != null) { DataTable purchaseInfoByStorgeStock = this.purhaseStock.GetPurchaseInfoByStorgeStock(array); foreach (DataRow row in purchaseInfoByStorgeStock.Rows) { this.SetResourceTable(row, dataTable); } this.gvwStorageStock.DataSource = dataTable; this.gvwStorageStock.DataBind(); if (dataTable.Rows.Count > 0) { string total = System.Convert.ToDecimal(dataTable.Compute("SUM(Total)", string.Empty)).ToString("0.000"); GridViewUtility.AddTotalRow(this.gvwStorageStock, total, 13); } } } }
public void BindGv(DataTable storageDataSource) { this.gvConract.DataSource = storageDataSource; this.gvConract.DataBind(); if (storageDataSource.Rows.Count == 0) { storageDataSource.Rows.Add(storageDataSource.NewRow()); this.gvConract.DataSource = storageDataSource; this.gvConract.DataBind(); this.gvConract.HeaderRow.Cells[0].Visible = false; this.gvConract.Rows[0].Visible = false; return; } this.gvConract.DataSource = storageDataSource; this.gvConract.DataBind(); string[] array = new string[] { storageDataSource.Compute("sum(PayMoney)", "").ToString(), storageDataSource.Compute("sum(IncomMoney)", "").ToString() }; this.hdfsummony.Value = array[0]; this.hdfIncomSum.Value = array[1]; int[] index = new int[] { 4, 5 }; GridViewUtility.AddTotalRow(this.gvConract, array, index); }
public void ExportToExcel(string FileType, string FileName) { GridView gridView = new GridView(); DataTable dataSource = this.ViewState["gvwCostIndirectOrg"] as DataTable; base.Response.Charset = "GB2312"; base.Response.ContentEncoding = System.Text.Encoding.UTF8; base.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(FileName, System.Text.Encoding.UTF8).ToString()); base.Response.ContentType = FileType; this.EnableViewState = false; System.IO.StringWriter stringWriter = new System.IO.StringWriter(); HtmlTextWriter writer = new HtmlTextWriter(stringWriter); gridView.DataSource = dataSource; gridView.DataBind(); this.RowSpanTalbe(1, 3, gridView); string[] sumAmount = this.GetSumAmount(this.ViewState["gvwdataSouce"] as DataTable); int[] index = new int[] { 7, 9, 12, 14 }; GridViewUtility.AddTotalRow(gridView, sumAmount, index); gridView.RenderControl(writer); base.Response.Write(stringWriter.ToString()); base.Response.End(); }
public void BindGv(DataTable storageDataSource) { if (storageDataSource.Rows.Count == 0) { storageDataSource.Rows.Add(storageDataSource.NewRow()); this.gvConract.DataSource = storageDataSource; this.gvConract.DataBind(); this.gvConract.HeaderRow.Cells[0].Visible = false; this.gvConract.Rows[0].Visible = false; return; } this.gvConract.DataSource = storageDataSource; this.gvConract.DataBind(); decimal d = 0m; for (int i = 0; i < storageDataSource.Rows.Count; i++) { d += System.Convert.ToDecimal(WebUtil.GetEnPrice(storageDataSource.Rows[i]["ContractPrice"].ToString(), storageDataSource.Rows[i]["ContractId"].ToString())); } string[] value = new string[] { d.ToString() }; int[] index = new int[] { 4 }; GridViewUtility.AddTotalRow(this.gvConract, value, index); }
public void BindGv(DataTable storageDataSource) { if (storageDataSource.Rows.Count == 0) { storageDataSource.Rows.Add(storageDataSource.NewRow()); this.gvConract.DataSource = storageDataSource; this.gvConract.DataBind(); this.gvConract.HeaderRow.Cells[0].Visible = false; this.gvConract.Rows[0].Visible = false; return; } this.gvConract.DataSource = storageDataSource; this.gvConract.DataBind(); string[] value = new string[] { this.contractCount.Compute("sum(EndPrice)", "").ToString(), this.contractCount.Compute("sum(BalancePrice)", "").ToString() }; int[] index = new int[] { 3, 10 }; GridViewUtility.AddTotalRow(this.gvConract, value, index); }
private void BindGv() { DataTable dataTable = new DataTable(); dataTable = formBLL.PaymentReport(this.txtContractCode.Text.Trim(), this.txtContractName.Text.Trim(), this.txtConType.Text.Trim(), this.txtPrjName.Value, this.hldfIsExamineApprove.Value); this.AspNetPager1.RecordCount = dataTable.Rows.Count; DataTable dataSource = formBLL.PaymentReport(this.txtContractCode.Text.Trim(), this.txtContractName.Text.Trim(), this.txtConType.Text.Trim(), this.txtPrjName.Value, this.hldfIsExamineApprove.Value, this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize); this.gvwContract.DataSource = dataSource; this.gvwContract.DataBind(); if (dataTable.Rows.Count > 0) { string[] value = new string[] { dataTable.Compute("SUM(ContractAmount)", string.Empty).ToString(), dataTable.Compute("SUM(PayAmount)", string.Empty).ToString(), dataTable.Compute("SUM(ApplyAmount)", string.Empty).ToString(), dataTable.Compute("SUM(DiffAmount)", string.Empty).ToString() }; int[] index = new int[] { 3, 4, 5, 6 }; GridViewUtility.AddTotalRow(this.gvwContract, value, index); } }
protected void ShowAllocationData() { AllocationBllAction allocationBllAction = new AllocationBllAction(); AllocationModel allocationModel = new AllocationModel(); allocationModel = allocationBllAction.ReturnAllocatonModel("aid='" + base.Request.QueryString["ic"] + "' "); this.lblAllocationNo.Text = allocationModel.Acode; this.FileLink1.FID = allocationModel.Acode; this.txtOutDepository.Text = allocationBllAction.GetTreasuryNameByCode(allocationModel.TCodea).Rows[0][0].ToString(); this.txtInDepository.Text = allocationBllAction.GetTreasuryNameByCode(allocationModel.TCodeb).Rows[0][0].ToString(); this.txtInDate.Text = allocationModel.InTime; this.txtOutAllocationPerson.Text = allocationBllAction.GetUserNameByCode(allocationModel.OutAllocationPerson); this.txtInAllocationPerson.Text = allocationBllAction.GetUserNameByCode(allocationModel.InAllocationPerson); this.txtRemark.Text = allocationModel.Explain; this.HdnTCodea.Value = allocationModel.TCodea; this.HdnAcode.Value = allocationModel.Acode; DataTable allocationStockList = allocationBllAction.GetAllocationStockList(allocationModel.TCodea, "acode='" + allocationModel.Acode + "'"); this.GVMaterialList.DataSource = allocationStockList; this.GVMaterialList.DataBind(); if (allocationStockList.Rows.Count > 0) { string total = Convert.ToDecimal(allocationStockList.Compute("SUM(Total)", string.Empty)).ToString("0.000"); GridViewUtility.AddTotalRow(this.GVMaterialList, total, 11); } this.lblBllProducer.Text = PageHelper.QueryUser(this, base.UserCode); this.lblPrintDate.Text = DateTime.Now.ToShortDateString(); }
protected void BindGv() { this.AspNetPager1.RecordCount = ConstructReport.GetConsResCount(this.txtTaskCode.Text.Trim(), this.txtTaskName.Text.Trim(), this.txtReourceCode.Text.Trim(), this.txtReourceName.Text.Trim(), this.prjId, WebUtil.GetUserNames(base.UserCode)); this.gvConstruct.DataSource = ConstructReport.GetConsRes(this.txtTaskCode.Text.Trim(), this.txtTaskName.Text.Trim(), this.txtReourceCode.Text.Trim(), this.txtReourceName.Text.Trim(), this.prjId, WebUtil.GetUserNames(base.UserCode), this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize); this.gvConstruct.DataBind(); string[] value = (string[])this.ViewState["Total"]; int[] index = (int[])this.ViewState["index"]; GridViewUtility.AddTotalRow(this.gvConstruct, value, index); }
protected void BindGv() { this.AspNetPager1.RecordCount = ProjectInfo.GetPrjCountByCondition(this.txtName.Text.Trim(), this.txtCode.Text.Trim(), this.txtManager.Value.Trim(), this.txtPrjPlace.Value.Trim(), this.txtPrjDutyPerson.Value.Trim(), this.txtStartTime.Text.Trim(), this.txtEndTime.Text.Trim(), base.UserCode); DataTable prjByCondition = ProjectInfo.GetPrjByCondition(this.txtName.Text.Trim(), this.txtCode.Text.Trim(), this.txtManager.Value.Trim(), this.txtPrjPlace.Value.Trim(), this.txtPrjDutyPerson.Value.Trim(), this.txtStartTime.Text.Trim(), this.txtEndTime.Text.Trim(), base.UserCode, this.AspNetPager1.PageSize, this.AspNetPager1.CurrentPageIndex); this.gvProject.DataSource = this.BindPrjType(prjByCondition, false, false); this.gvProject.DataBind(); string[] value = (string[])this.ViewState["Total"]; int[] index = (int[])this.ViewState["index"]; GridViewUtility.AddTotalRow(this.gvProject, value, index); }
public void BindGv(DataTable storageDataSource) { if (storageDataSource.Rows.Count == 0) { storageDataSource.Rows.Add(storageDataSource.NewRow()); this.gvPurchaseplan.DataSource = storageDataSource; this.gvPurchaseplan.DataBind(); this.gvPurchaseplan.HeaderRow.Cells[0].Visible = false; this.gvPurchaseplan.Rows[0].Visible = false; return; } this.gvPurchaseplan.DataSource = storageDataSource; this.gvPurchaseplan.DataBind(); GridViewUtility.AddTotalRow(this.gvPurchaseplan, System.Convert.ToDecimal(storageDataSource.Compute("sum(xjsprice)", "")).ToString("0.000"), 13); }
private void DataBindPurchaseplanStock() { if (this.ViewState[Equ_Purchase_EquipmentPurchaseView.resourceDataSourceName] is DataTable) { DataTable dataTable = this.ViewState[Equ_Purchase_EquipmentPurchaseView.resourceDataSourceName] as DataTable; if (dataTable.Rows.Count > 0) { GridViewUtility.DataBind(this.gvwMaterialStock, dataTable); string total = Convert.ToDecimal(dataTable.Compute("SUM(Total)", string.Empty)).ToString("0.000"); GridViewUtility.AddTotalRow(this.gvwMaterialStock, total, 11); return; } this.gvwMaterialStock.DataSource = null; this.gvwMaterialStock.DataBind(); } }
private void DataBindPurchaseplanStock() { if (this.ViewState["resource"] is DataTable) { DataTable dataTable = this.ViewState["resource"] as DataTable; if (dataTable.Rows.Count > 0) { this.lblTitalPurchase.Text = "采购单"; GridViewUtility.DataBind(this.gvwPurchaseplanStock, dataTable); string total = System.Convert.ToDecimal(dataTable.Compute("SUM(Total)", string.Empty)).ToString("0.000"); GridViewUtility.AddTotalRow(this.gvwPurchaseplanStock, total, 8); return; } this.lblTitalPurchase.Text = ""; } }
protected void BindGv() { DataTable dataTable = (DataTable)this.ViewState["DataTable"]; if (dataTable.Rows.Count == 0) { this.gvWastageStock.DataSource = dataTable; this.gvWastageStock.DataBind(); return; } this.gvWastageStock.DataSource = dataTable; this.gvWastageStock.DataBind(); string total = System.Convert.ToDecimal(dataTable.Compute("SUM(Total)", string.Empty)).ToString("0.000"); GridViewUtility.AddTotalRow(this.gvWastageStock, total, 9); }
private void DataBindTreasury(DataTable table) { if (table.Rows.Count == 0) { table.Rows.Add(table.NewRow()); this.gvwTreasury.DataSource = table; this.gvwTreasury.DataBind(); this.gvwTreasury.Rows[0].Visible = false; return; } this.gvwTreasury.DataSource = table; this.gvwTreasury.DataBind(); string total = Convert.ToString(table.Compute("Sum(total)", string.Empty)); GridViewUtility.AddTotalRow(this.gvwTreasury, total, 10); }
private void DataBindStorage(DataTable table) { if (table.Rows.Count == 0) { table.Rows.Add(table.NewRow()); this.gvwStorage.DataSource = table; this.gvwStorage.DataBind(); this.gvwStorage.Rows[0].Visible = false; return; } this.gvwStorage.DataSource = table; this.gvwStorage.DataBind(); string total = System.Convert.ToString(table.Compute("sum(total)", string.Empty)); GridViewUtility.AddTotalRow(this.gvwStorage, total, 11); }
public void BindGv() { DataTable dataTable = (DataTable)this.ViewState["DataTable"]; if (dataTable.Rows.Count == 0) { this.gvNeedNote.DataSource = dataTable; this.gvNeedNote.DataBind(); return; } this.gvNeedNote.DataSource = dataTable; this.gvNeedNote.DataBind(); string total = Convert.ToDecimal(dataTable.Compute("SUM(Total)", string.Empty)).ToString("0.000"); GridViewUtility.AddTotalRow(this.gvNeedNote, total, 10); }
private void DataBindPurchaseplanStock() { if (this.ViewState["resource"] is DataTable) { DataTable dataTable = this.ViewState["resource"] as DataTable; if (dataTable.Rows.Count > 0) { this.gvwPurchaseplanStock.DataSource = dataTable; this.gvwPurchaseplanStock.DataBind(); string total = Convert.ToDecimal(dataTable.Compute("SUM(Total)", string.Empty)).ToString("0.000"); GridViewUtility.AddTotalRow(this.gvwPurchaseplanStock, total, 9); return; } this.gvwPurchaseplanStock.DataSource = dataTable; this.gvwPurchaseplanStock.DataBind(); } }
private void DBbind() { DataTable data = this.GetData(); if (base.Request["PlanType"].ToString() == "allplan") { this.GridView1.DataSource = data; this.GridView1.DataBind(); return; } DataView defaultView = data.DefaultView; defaultView.Sort = " NewPlanMoney DESC"; DataTable dataTable = defaultView.ToTable(); string text = "0.00"; if (dataTable.Compute("SUM(conPayMoney)", string.Empty).ToString() != "0.000") { text = dataTable.Compute("(SUM(conPayMoney)/SUM(planMoney))*100", string.Empty).ToString(); if (!string.IsNullOrEmpty(text)) { text = decimal.Parse(text).ToString("f2"); } else { text = "0.00"; } } string[] value = new string[] { dataTable.Compute("SUM(planMoney)", string.Empty).ToString(), dataTable.Compute("SUM(conPayMoney)", string.Empty).ToString(), dataTable.Compute("sum(NewPlanMoney)", string.Empty).ToString(), text + "%" }; this.gvPayoutPlan.DataSource = dataTable; this.gvPayoutPlan.DataBind(); int[] index = new int[] { 2, 3, 4, 5 }; GridViewUtility.AddTotalRow(this.gvPayoutPlan, value, index); }
public void BindGv() { DataTable dataTable = (DataTable)this.ViewState["DataTable"]; if (dataTable.Rows.Count == 0) { this.gvNeedNote.DataSource = dataTable; this.gvNeedNote.DataBind(); //return; } else { this.gvNeedNote.DataSource = dataTable; this.gvNeedNote.DataBind(); string total = Convert.ToDecimal(dataTable.Compute("SUM(Total)", string.Empty)).ToString("0.000"); GridViewUtility.AddTotalRow(this.gvNeedNote, total, 9); } DataTable dt2 = GetList(hfldResourceIdsZZCL.Value.ToString()); if (dt2 != null && dt2.Rows.Count > 0) { this.gvNeedNote2.DataSource = dt2; this.gvNeedNote2.DataBind(); div.Visible = true; } else { div.Visible = false; } DataTable dt3 = BindNeedNote(); if (dt3 != null && dt3.Rows.Count > 0) { this.gvNeedNote3.DataSource = dt3; this.gvNeedNote3.DataBind(); div3.Visible = true; } else { div3.Visible = false; } }
private void DataBindContract() { DataTable data = this.GetData(); this.gvwContract.DataSource = data; this.gvwContract.DataBind(); string[] value = new string[] { this.contractCount.Compute("SUM(ModifiedMoney)", string.Empty).ToString(), this.contractCount.Compute("SUM(BalanceTotal)", string.Empty).ToString() }; int[] index = new int[] { 5, 6 }; GridViewUtility.AddTotalRow(this.gvwContract, value, index); }
private void DataBindPurchase() { DataTable purchaseDataSource = this.GetPurchaseDataSource(); if (purchaseDataSource.Rows.Count == 0) { purchaseDataSource.Rows.Add(purchaseDataSource.NewRow()); this.gvwPurchase.DataSource = purchaseDataSource; this.gvwPurchase.DataBind(); this.gvwPurchase.Rows[0].Visible = false; return; } this.gvwPurchase.DataSource = purchaseDataSource; this.gvwPurchase.DataBind(); string total = purchaseDataSource.Compute("Sum(total)", string.Empty).ToString(); GridViewUtility.AddTotalRow(this.gvwPurchase, total, 11); }
private void BindGvw() { DataTable treasuryData = new TreasuryStockBll().GetTreasuryData(this.txtResourceName.Text.Trim(), this.txtResourceCode.Text.Trim(), this.txtTrea.Text.Trim(), this.txtCorpName.Text.Trim(), base.UserCode, this.txtSpecification.Text.Trim(), this.txtBrand.Text.Trim(), this.txtModelNumber.Text.Trim()); if (treasuryData.Rows.Count == 0) { treasuryData.Rows.Add(treasuryData.NewRow()); this.gvwTreasury.DataSource = treasuryData; this.gvwTreasury.DataBind(); this.gvwTreasury.Rows[0].Visible = false; return; } this.gvwTreasury.DataSource = treasuryData; this.gvwTreasury.DataBind(); string total = Convert.ToString(treasuryData.Compute("Sum(total)", string.Empty)); GridViewUtility.AddTotalRow(this.gvwTreasury, total, 10); }
public void BindGv() { DataTable dataTable = (DataTable)this.ViewState["DataTable"]; if (dataTable.Rows.Count == 0) { dataTable.Rows.Add(dataTable.NewRow()); this.gvNeedNote.DataSource = dataTable; this.gvNeedNote.DataBind(); this.gvNeedNote.HeaderRow.Cells[0].Visible = false; this.gvNeedNote.Rows[0].Visible = false; return; } this.gvNeedNote.DataSource = dataTable; this.gvNeedNote.DataBind(); string total = Convert.ToDecimal(dataTable.Compute("SUM(Total)", string.Empty)).ToString("0.000"); GridViewUtility.AddTotalRow(this.gvNeedNote, total, 8); }
protected void BtnDel_ServerClick(object sender, EventArgs e) { this.UpdateDataSource(); DataTable dataTable = (DataTable)this.ViewState["DataTable"]; foreach (GridViewRow gridViewRow in this.GVMaterialList.Rows) { CheckBox checkBox = gridViewRow.FindControl("chkBox") as CheckBox; string text = gridViewRow.Attributes["id"].ToString(); string text2 = gridViewRow.Attributes["sprice"].ToString(); string text3 = gridViewRow.Attributes["corp"].ToString(); if (checkBox != null && checkBox.Checked) { DataRow dataRow = dataTable.Select(string.Concat(new string[] { "scode='", text, "' and sprice='", text2, "' and corp='", text3, "'" }))[0]; if (dataRow != null) { ((DataTable)this.ViewState["DataTable"]).Rows.Remove(dataRow); } } } this.HdnViewCodeList.Value = ""; dataTable = (DataTable)this.ViewState["DataTable"]; if (dataTable.Rows.Count > 0) { this.GVMaterialList.DataSource = dataTable; this.GVMaterialList.DataBind(); string total = Convert.ToDecimal(dataTable.Compute("SUM(Total)", string.Empty)).ToString("0.000"); GridViewUtility.AddTotalRow(this.GVMaterialList, total, 12); return; } this.GVMaterialList.DataSource = dataTable; this.GVMaterialList.DataBind(); }
private void DataBindContracts(DataTable dtcontract) { this.gvwContract.DataSource = dtcontract; this.gvwContract.DataBind(); decimal d = 0m; for (int i = 0; i < this.contracts.Count; i++) { d += System.Convert.ToDecimal(this.contracts[i].ModifiedMoney); } string[] value = new string[] { d.ToString() }; int[] index = new int[] { 4 }; GridViewUtility.AddTotalRow(this.gvwContract, value, index); }
protected void BindGv() { this.dtCostSum = ConstructReport.GetCostSummary(this.ddlPrject.SelectedValue, 1); this.ViewState["dtCostSum"] = this.dtCostSum; this.gvCost.DataSource = this.dtCostSum; this.gvCost.DataBind(); string[] value = new string[] { System.Convert.ToDecimal(this.dtCostSum.Compute("sum(BudAmount)", "1>0")).ToString("0.000"), System.Convert.ToDecimal(this.dtCostSum.Compute("sum(Cost)", "1>0")).ToString("0.000"), System.Convert.ToDecimal(this.dtCostSum.Compute("sum(Disparity)", "1>0")).ToString("0.000") }; int[] index = new int[] { 2, 3, 4 }; GridViewUtility.AddTotalRow(this.gvCost, value, index); }
private void DataBindStorageStock() { if (this.ViewState[this.stockDataSourceName] is DataTable) { DataTable dataTable = this.ViewState[this.stockDataSourceName] as DataTable; this.gvwStorageStock.DataSource = dataTable; this.gvwStorageStock.DataBind(); if (dataTable.Rows.Count > 0) { string total = System.Convert.ToDecimal(dataTable.Compute("SUM(Total)", string.Empty)).ToString("0.000"); GridViewUtility.AddTotalRow(this.gvwStorageStock, total, 13); return; } } else { this.gvwStorageStock.DataSource = null; this.gvwStorageStock.DataBind(); } }
protected void btnBind_ServerClick(object sender, EventArgs e) { this.UpdateDataSource(); DataTable dataTable = this.ViewState["DataTable"] as DataTable; DataTable materialOfDepositoryList = AllocationAction.GetMaterialOfDepositoryList(this.HdnSelectOutDepo.Value, this.HdnViewCodeList.Value); DataColumn dataColumn = new DataColumn("Total", typeof(decimal)); dataColumn.DefaultValue = 0m; materialOfDepositoryList.Columns.Add(dataColumn); if (dataTable != null && materialOfDepositoryList != null) { if (dataTable.Rows.Count == 1 && string.IsNullOrEmpty(dataTable.Rows[0]["scode"].ToString())) { dataTable.Rows.RemoveAt(0); } dataTable.PrimaryKey = new DataColumn[] { dataTable.Columns["scode"], dataTable.Columns["sprice"], dataTable.Columns["corp"] }; materialOfDepositoryList.PrimaryKey = new DataColumn[] { materialOfDepositoryList.Columns["scode"], materialOfDepositoryList.Columns["sprice"], materialOfDepositoryList.Columns["corp"] }; dataTable.Merge(materialOfDepositoryList, true); this.ViewState["DataTable"] = dataTable; } if (dataTable.Rows.Count > 0) { this.GVMaterialList.DataSource = dataTable; this.GVMaterialList.DataBind(); string total = Convert.ToDecimal(dataTable.Compute("SUM(Total)", string.Empty)).ToString("0.000"); GridViewUtility.AddTotalRow(this.GVMaterialList, total, 12); return; } this.GVMaterialList.DataSource = dataTable; this.GVMaterialList.DataBind(); }
public void BindGv(DataTable storageDataSource) { if (storageDataSource.Rows.Count == 0) { storageDataSource.Rows.Add(storageDataSource.NewRow()); this.gvConract.DataSource = storageDataSource; this.gvConract.DataBind(); this.gvConract.HeaderRow.Cells[0].Visible = false; this.gvConract.Rows[0].Visible = false; return; } this.gvConract.DataSource = storageDataSource; this.gvConract.DataBind(); decimal d = 0m; decimal d2 = 0m; decimal d3 = 0m; decimal d4 = 0m; for (int i = 0; i < storageDataSource.Rows.Count; i++) { d2 += Convert.ToDecimal(storageDataSource.Rows[i]["EndPrice"].ToString()); d += Convert.ToDecimal(WebUtil.GetPaymentSum(storageDataSource.Rows[i]["ContractId"].ToString(), "Con_Incomet_Payment", "CllectionPrice")); d3 += Convert.ToDecimal(storageDataSource.Rows[i]["InvoicePrice"].ToString()); d4 += Convert.ToDecimal(this.GetBlInvoice(storageDataSource.Rows[i]["ContractId"].ToString())); } string[] value = new string[] { d2.ToString(), d.ToString(), d3.ToString(), d4.ToString() }; int[] index = new int[] { 7, 8, 9, 10 }; GridViewUtility.AddTotalRow(this.gvConract, value, index); }