Ejemplo n.º 1
0
    protected void BindData()
    {
        QSMBLL          qsmBLL  = new QSMBLL(CurrentFactoryID);
        IList <QSMInfo> qsmList = new List <QSMInfo>();

        string strWhere = " 1=1 ";

        if (tb_DateStart.Text.Trim() != "")
        {
            strWhere += " and datediff(d,ent_Date,'" + tb_DateStart.Text + "') <= 0 ";
        }
        if (tb_DateEnd.Text.Trim() != "")
        {
            strWhere += " and datediff(d,ent_Date,'" + tb_DateEnd.Text + "') >= 0";
        }
        if (tb_CustName.Text.Trim() != "")
        {
            strWhere += " and cust_name like '%" + tb_CustName.Text.Trim() + "'";
        }

        qsmList = qsmBLL.FindBySql(strWhere);

        GridView1.DataSource = qsmList;
        GridView1.DataBind();
    }