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

        try
        {
            string strWhere = this.StrWhere;

            strWhere = "1=1";

            ds = noPassReasonBB.GetList(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
        {
            noPassReasonBB.Dispose();
        }
    }
Esempio n. 2
0
    //2015-09-30 添加 用于增加选择出库原因
    //2015-09-29 进行添加 增加有关于其他入库类型选择的功能
    /// <summary>
    /// 绑定特殊入库原因
    /// </summary>
    protected void BindReson()
    {
        string strWhere = "1=1 and outInType = '02'";
        DataSet ds = new DataSet();
        TSOutInTypeBB outinTypeBB = new TSOutInTypeBB();

        //物料
        if (this.tbTSReason.Text.Trim() != "")
        {
            strWhere += " and (outIntypeName like '%" + this.tbTSReason.Text.Replace("'", "''") + ")";
        }
        ds = outinTypeBB.GetList(strWhere);//获取所有的入库原因
        this.grvReason.DataSource = ds.Tables[0];
        this.grvReason.DataBind();

        //赋值记录条数、页面总数
        this.Label1.Text = ds.Tables[0].Rows.Count.ToString();
        this.Label4.Text = this.grvReason.PageCount.ToString();
        this.currPage.Text = (this.grvReason.PageIndex + 1).ToString();
    }