protected void btnSearch_Click(object sender, EventArgs e) { DataTable dt = prod_bar_bll.GetPROD_PcbaCodeByPcbaCode(txtPcbaCode.Text.Trim()); GridView_ProBarcode.DataSource = dt; GridView_ProBarcode.DataBind(); PageQueryAdapter1.RecordCount = dt.Rows.Count; int tmp = PageQueryAdapter1.RecordCount / PageQueryAdapter1.PageSize; PageQueryAdapter1.PageCount = PageQueryAdapter1.RecordCount % PageQueryAdapter1.PageSize > 0 ? tmp + 1 : tmp; }
private void GetData(int index, int PageSize) { int count = 0; DataTable dt = new DataTable(); if (Request.QueryString["mt_id"] != null) { dt = prod_bar_bll.GetPROD_BarcodeByMtid(Request.QueryString["mt_id"].ToString(), index, PageSize, out count); } else { dt = prod_bar_bll.GetPROD_BarcodeAll(index, PageSize, out count); } GridView_ProBarcode.DataSource = dt; GridView_ProBarcode.DataBind(); PageQueryAdapter1.RecordCount = count; int tmp = PageQueryAdapter1.RecordCount / PageQueryAdapter1.PageSize; PageQueryAdapter1.PageCount = PageQueryAdapter1.RecordCount % PageQueryAdapter1.PageSize > 0 ? tmp + 1 : tmp; }