/// <summary> /// 绑定Grid /// </summary> protected void BindGrid() { BTallyBillBB tallyBillBB = new BTallyBillBB(); DataSet ds = new DataSet(); string strwhere = " 1=1 "; if (!string.IsNullOrEmpty(this.ddlWare.SelectedValue)) { strwhere += " and wareNo='" + this.ddlWare.SelectedValue + "'"; } if (!string.IsNullOrEmpty(this.ddlWarelocater.SelectedValue)) { strwhere += " and wareLocatorNo='" + this.ddlWarelocater.SelectedValue + "'"; } if (!string.IsNullOrEmpty(this.txtPllateno.Text.Trim())) { strwhere += " and palletNo like '%" + this.txtPllateno.Text.Trim().Replace("'","''") + "%'"; } try { ds = tallyBillBB.GetVList(strwhere); this.grid.DataSource = ds.Tables[0]; this.grid.DataBind(); //赋值记录条数、页面总数 this.Label3.Text = ds.Tables[0].Rows.Count.ToString(); this.Label2.Text = this.grid.PageCount.ToString(); this.currPage.Text = (this.grid.PageIndex + 1).ToString(); } finally { tallyBillBB.Dispose(); } }
public DataTable GetTallyBill(string strPalletNo) { BTallyBillBB tallyBillBB = new BTallyBillBB(); try { DataTable dt = new DataTable(); dt = tallyBillBB.GetVList("palletNo='" + strPalletNo + "' and isInStock=0").Tables[0]; return dt; } finally { tallyBillBB.Dispose(); } }