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

        try
        {
            string strwhere = this.StrWhere;

            //销售订单编号
            if (!string.IsNullOrEmpty(this.txtSaleBillNo.Text))
            {
                strwhere += " and SAPDocEntry like '%" + this.txtSaleBillNo.Text.Trim().Replace("'", "''").Trim() + "%'";
            }

            //客户
            if (!string.IsNullOrEmpty(this.txtCustNo.Text))
            {
                strwhere += " and (SAPOriginNum like '%" + this.txtCustNo.Text.Replace("'", "''").Trim()
                    + "%' or CustNm like '" + this.txtCustNo.Text.Trim().Replace("'", "''") + "')";
            }

            //订单状态
            if (!string.IsNullOrEmpty(this.ddlState.SelectedValue))
            {
                strwhere += " and InstantState = '" + this.ddlState.SelectedValue.Replace("'", "''").Trim() + "'";
            }

            ds = otherOutINBillBB.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
        {
            otherOutINBillBB.Dispose();
        }
    }
    /// <summary>
    /// 显示销售订单信息
    /// </summary>
    private void ShowInfo()
    {
        OtherOutInBillBB otherOutInBill = new OtherOutInBillBB();
        OtherOutInDetailBB otherOutInDetailBill = new OtherOutInDetailBB();

        try
        {
            string id = Request.Params["id"];
            vOtherOutInBillData otherOutInBIllData = otherOutInBill.GetVModel(Convert.ToInt32(id));
            DataSet ds = new DataSet();

            //this.saleBillNo.Text = saleBillModel.saleBillNo;
            //this.saleBillDt.Text = Convert.ToDateTime(saleBillModel.saleBillDt).ToString("yyyy-MM-dd");
            //this.custNo.Text = saleBillModel.custNo;
            //this.custNm.Text = saleBillModel.custNm;
            //this.saleEmpNo.Text = saleBillModel.saleEmpNo;
           // this.saleBillType.Text = saleBillModel.saleBillType;
            this.mark.Text = otherOutInBIllData.Mark;

            //根据提货单号、销售订单号、采购合同号,查找销售订单明细
            ds = otherOutInDetailBill.GetVList("SAPDocEntry = '"+otherOutInBIllData.SAPDocEntry+"'");

            if (ds != null && ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
            {
                this.grid.DataSource = ds;
                this.grid.DataBind();
            }
        }
        finally
        {
            otherOutInBill.Dispose();
            otherOutInDetailBill.Dispose();
        }
    }
    private void BindSaleBiil()
    {
        OtherOutInBillBB otherOutInBill = new OtherOutInBillBB();
        OtherOutInDetailBB otherOutInDetailBill = new OtherOutInDetailBB();

        try
        {

            string id = Request.Params["id"];
            vOtherOutInBillData otherOutInBIllData = otherOutInBill.GetVModel(Convert.ToInt32(id));
            string SAPDocEntry = otherOutInBIllData.SAPDocEntry;
            DataSet ds = new DataSet();
            ds = otherOutInDetailBill.GetVList("SAPDocEntry = " + SAPDocEntry + " and BoxNumber>0");
            if (ds != null && ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
            {
                DtResult = ds.Tables[0];
                this.gridSaleBill.DataSource = ds;
                this.gridSaleBill.DataBind();
            }
        }
        finally
        {
            otherOutInBill.Dispose();
            otherOutInDetailBill.Dispose();
        }
    }