/// <summary>
    /// 绑定Grid
    /// </summary>
    protected void BindGrid()
    {
        CStockUpBillBB stockUpBillBB = new CStockUpBillBB();
        DataSet ds = new DataSet();

        try
        {
            string strs = this.StrWhere;

            //限制备货单的所有托盘都在发货区
            strs += @" and not exists(
                                          select 1 from
                                          (
                                              select distinct stockUpDetail.stockUpBillNo,arrangeBillBox.wareType
                                              from dbo.vBArrangeBillBox as arrangeBillBox
                                              inner join dbo.CStockUpDetail as stockUpDetail on stockUpDetail.palletNo=arrangeBillBox.palletNo
                                              where stockUpDetail.instantState='03'
                                          ) as main where main.wareType<>'08' and main.stockUpBillNo=a.stockUpBillNo)";

            //备货单编号
            if (!string.IsNullOrEmpty(txtStockUpBill.Text))
            {
                strs += " and a.stockUpBillNo like '%" + txtStockUpBill.Text.Trim().Replace("'", "''") + "%'";
            }

            //客户编号
            if (!string.IsNullOrEmpty(txtCustNo.Text))
            {
                strs += " and custNo='" + txtCustNo.Text.Trim().Replace("'", "''") + "'";
            }

            //发票号
            if (!string.IsNullOrEmpty(txtInvoke.Text))
            {
                strs += " and invoiceNo='" + txtInvoke.Text.Trim().Replace("'", "''") + "'";
            }

            //唛头
            if (!string.IsNullOrEmpty(txtShippingmark.Text))
            {
                strs += " and shippingMarkNo='" + txtShippingmark.Text.Trim().Replace("'", "''") + "'";
            }

            ds = stockUpBillBB.GetVListInFHQ(strs);
            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
        {
            stockUpBillBB.Dispose();
        }
    }