private void QueryAndBindData(ISession session, int pageIndex, int pageSize, bool fetchRecordCount) { int count = 0; INVCheckHead head = INVCheckHead.Retrieve(session, this.OrderNumber); this.repeatControl.DataSource = INVCheckHead.Query(session, fetchRecordCount, out count , head.LocationCode, this.txtSku.Text, this.txtItemCode.Text, this.txtItemName.Text, this.txtColor.Text, this.txtSize.Text, this.drpArea.SelectedValue, this.txtSection.Text , pageIndex, pageSize); this.repeatControl.DataBind(); if (fetchRecordCount) { this.magicPagerMain.RecordCount = this.magicPagerSub.RecordCount = count; } WebUtil.SetMagicPager(magicPagerMain, pageSize, pageIndex); WebUtil.SetMagicPager(magicPagerSub, pageSize, pageIndex); }