public void DataBindToGridview() { ZWL.BLL.ERPBuyChanPin MyModel = new ZWL.BLL.ERPBuyChanPin(); 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 += "(OrderName Like '%" + this.TextBox1.Text + "%' or ProductName Like '%" + this.TextBox1.Text + "%' or ProductSerils Like '%" + this.TextBox1.Text + "%' or GongYingShang Like '%" + this.TextBox1.Text + "%' or UserName Like '%" + this.TextBox1.Text + "%' or ProductType 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(); }
public void DataBindToGridview() { ZWL.BLL.ERPBuyChanPin MyModel = new ZWL.BLL.ERPBuyChanPin(); GVData.DataSource = MyModel.GetList("OrderName 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(); }