private void PageInit() { WebPager.RecordCount = bll.GetCount(0); List <UserInfo> list = bll.GetUserList(WebPager.CurrentPageIndex, WebPager.PageSize, 0); if (txtusername.Value != "") { list = list.FindAll(delegate(UserInfo info) { return(info.UserName.IndexOf(txtusername.Value.Trim()) > -1); }); } if (txtmobile.Value != "") { list = list.FindAll(delegate(UserInfo info) { return(info.Mobile == txtmobile.Value.Trim()); }); } myGrid.DataSource = list; myGrid.DataBind(); }
private void PageInit() { string username = ""; string shopname = ""; if (txtusername.Value != "") { username = "******" + txtusername.Value + "%"; } if (txtshopname.Value != "") { shopname = "%" + txtshopname.Value + "%"; } WebPager.RecordCount = bll.GetCount(username, shopname); myGrid.DataSource = bll.GetUserList(WebPager.CurrentPageIndex, WebPager.PageSize, username, shopname); myGrid.DataBind(); }