Beispiel #1
0
    public void DataBindToGridview()
    {
        ZWL.BLL.ERPContractChanPin MyModel = new ZWL.BLL.ERPContractChanPin();
        string XiaShuUser = ZWL.DBUtility.DbHelperSQL.GetSHSLInt("select top 1 XiaShuUser from ERPUser where UserName='******'");
        string SSTempSTR  = "";

        if (XiaShuUser != "全部")
        {
            SSTempSTR = "and UserName in(" + "'" + XiaShuUser.Replace(",", "','") + "'" + ")";
        }
        string sql = "";

        if (!string.IsNullOrEmpty(this.TextBox1.Text))
        {
            sql += "(HeTongName Like '%" + this.TextBox1.Text + "%' or ChanPinName Like '%" + this.TextBox1.Text + "%' or DanJia Like '%" + this.TextBox1.Text + "%' or ShuLiang Like '%" + this.TextBox1.Text + "%' or UserName Like '%" + this.TextBox1.Text + "%' or IFJiaoFu Like '%" + this.TextBox1.Text + "%')";
        }
        if (!string.IsNullOrEmpty(this.TextBox3.Text))
        {
            if (string.IsNullOrEmpty(sql))
            {
                sql += " TimeStr >='" + this.TextBox3.Text.Trim() + " 00:00:00' and TimeStr<='" + this.TextBox4.Text.Trim() + " 23:59:59' ";
            }
            else
            {
                sql += "and TimeStr >='" + this.TextBox3.Text.Trim() + " 00:00:00' and TimeStr<='" + this.TextBox4.Text.Trim() + " 23:59:59' ";
            }
            sql += " " + SSTempSTR + "  order by ID desc";
        }
        GVData.DataSource = MyModel.GetList(sql);
        GVData.DataBind();
        LabPageSum.Text     = Convert.ToString(GVData.PageCount);
        LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1));
        this.GoPage.Text    = LabCurrentPage.Text.ToString();
    }
Beispiel #2
0
 public void DataBindToGridview()
 {
     ZWL.BLL.ERPContractChanPin MyModel = new ZWL.BLL.ERPContractChanPin();
     GVData.DataSource = MyModel.GetList("HeTongName Like '%" + this.TextBox1.Text + "%' order by ID desc");
     GVData.DataBind();
     LabPageSum.Text     = Convert.ToString(GVData.PageCount);
     LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1));
     this.GoPage.Text    = LabCurrentPage.Text.ToString();
 }