private void DataBindBalanceStock() { 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[] value = new string[] { dataTable.Compute("SUM(ThisTimeTotal)", string.Empty).ToString(), dataTable.Compute("SUM(AlreadyTotal)", string.Empty).ToString() }; int[] index = new int[] { 9, 11 }; this.AddTotalRow(value, index); return; } this.lblTitalPurchase.Text = ""; } }
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); }
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(); }
private void DataBindPurchaseStock() { System.Collections.Generic.List <string> purchasePlanStock = this.GetPurchasePlanStock(); DataTable tableByPurchaseCodes = this.purchaseStock.GetTableByPurchaseCodes(purchasePlanStock.ToArray()); GridViewUtility.DataBind(this.gvwPurchaseStock, tableByPurchaseCodes); }
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(); }
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); } }
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); }
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); } } } }
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(); } } }
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); }
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); }
private void TradeTreeView_Click(object sender, RoutedEventArgs e) { var head = e.OriginalSource as GridViewColumnHeader; if (head != null) { GridViewUtility.Sort(head.Column, TradeTreeView.Items); } }
private void DataBindPurchase() { System.Collections.Generic.List <PurchaseModel> purchses = this.GetPurchses(); int currentPageIndex = this.AspNetPager1.CurrentPageIndex; this.AspNetPager1.RecordCount = purchses.Count; System.Collections.Generic.IEnumerable <PurchaseModel> source = purchses.Skip(this.AspNetPager1.PageSize * (currentPageIndex - 1)).Take(this.AspNetPager1.PageSize); GridViewUtility.DataBind <PurchaseModel>(this.gvwPurchase, source.ToList <PurchaseModel>()); }
private void ShowPageContent(string searchKey, string searchID) { // create filter paramters string filterStr = string.Format("AND ({1} = '{0}')", searchKey, searchID); gvItems.DataSource = new CarsSaleInvoiceManager().GetCarSaleInvoice(filterStr); gvItems.DataBind(); GridViewUtility.SetHeaderFooter(gvItems); }
private void ShowPageContent(string searchKey, string searchID) { // create filter paramters string filterStr = string.Format("AND InvoiceNo <> '' AND InvoiceDate IS NOT NULL AND ({1} LIKE '%{0}%')", searchKey, searchID); gvItems.DataSource = new ShippInvoiceManager().GetShippInvoice(filterStr); gvItems.DataBind(); GridViewUtility.SetHeaderFooter(gvItems); }
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); }
protected void Bind_GVAllocationList() { AllocationBllAction allocationBllAction = new AllocationBllAction(); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(" flowstate!=-3 and flowstate=1 "); stringBuilder.Append(" and isouta=1 and InAllocationPerson='" + base.UserCode + "' "); stringBuilder.Append(" order by intime desc "); DataTable allocationList = allocationBllAction.GetAllocationList(stringBuilder.ToString()); GridViewUtility.DataBind(this.GVAllocationList, allocationList); }
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); }
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 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); }
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 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 = ""; } }
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 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 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); }
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(); } }
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 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 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 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); }