private void BindBu() { TB_BU mTB_BU = new TB_BU(); BUBLL mBUBLL = new BUBLL(); Pager pager = null; mTB_BU.SiteID = (base.UserInfo == null ? base.SystemAdminInfo.SiteID : base.UserInfo.SiteID); var dtSource = mBUBLL.GetPagerData(mTB_BU, ref pager); this.ddlBu.DataValueField = TB_BU.col_ID; this.ddlBu.DataTextField = TB_BU.col_Name; this.ddlBu.DataSource = dtSource; this.ddlBu.DataBind(); this.ddlBu.Items.Insert(0, new ListItem() { Value = "0", Text = "--请选择--" }); }
private void Bind(int intCurrentIndex) { TB_BU mTB_BU = new TB_BU(); BUBLL mBUBLL = new BUBLL(); Pager pager = new Pager(); DataTable dtSource = null; pager.CurrentPageIndex = intCurrentIndex; pager.srcOrder = " ID asc"; mTB_BU.SiteID = (base.UserInfo == null ? base.SystemAdminInfo.SiteID : base.UserInfo.SiteID); mTB_BU.Name = this.txtBU.Text.Trim(); dtSource = mBUBLL.GetPagerData(mTB_BU, ref pager); GridView1.DataSource = dtSource; GridView1.DataBind(); this.Pager1.ItemCount = pager.TotalRecord; this.Pager1.PageCount = pager.TotalPage; this.Pager1.CurrentIndex = pager.CurrentPageIndex; this.Pager1.PageSize = pager.PageSize; }