public void DataBindToGridview() { ZWL.BLL.ERPLanEmail MyLanEmail = new ZWL.BLL.ERPLanEmail(); GVData.DataSource = MyLanEmail.GetList("EmailTitle like '%" + this.TextBox1.Text.Trim() + "%' and FromUser like '%" + this.TextBox2.Text.Trim() + "%' and EmailState like '%" + this.TextBox3.Text.Trim() + "%' and ToUser='******' and (EmailState='未读' or EmailState='已读') 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(); }
public void DataBindToGridview() { GVData.PageSize = AspNetPager1.PageSize; GVData.PageIndex = AspNetPager1.CurrentPageIndex - 1; ZWL.BLL.ERPLanEmail MyLanEmail = new ZWL.BLL.ERPLanEmail(); DataSet ds = MyLanEmail.GetList("EmailTitle like '%" + this.TextBox1.Text.Trim() + "%' and ToUser='******' and EmailState='删除' order by ID desc"); GVData.DataSource = ds; GVData.DataBind(); AspNetPager1.RecordCount = ds.Tables[0].Rows.Count; }
public void DataBindToGridview() { string XiaShuUser = ZWL.DBUtility.DbHelperSQL.GetSHSLInt("select top 1 XiaShuUser from ERPUser where UserName='******'"); string SSTempSTR = ""; if (XiaShuUser != "全部") { SSTempSTR = "and ToUser in(" + "'" + XiaShuUser.Replace(",", "','") + "'" + ")"; } ZWL.BLL.ERPLanEmail MyLanEmail = new ZWL.BLL.ERPLanEmail(); GVData.DataSource = MyLanEmail.GetList("EmailTitle like '%" + this.TextBox1.Text.Trim() + "%' and ToUser like '%" + this.TextBox2.Text.Trim() + "%' and EmailState like '%" + this.TextBox3.Text.Trim() + "%' " + SSTempSTR + " and (EmailState='未读' or EmailState='已读') 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(); }