/// <summary> /// 绑定数据 /// </summary> /// <param name="pageIndex"></param> private void BindGrid(int pageIndex) { string strWhere = " archive_form_no =(select ProjectType from T_SingleProject where SingleProjectID=" + DNTRequest.GetQueryString("SingleProjectID") + ")"; if (!String.IsNullOrWhiteSpace(ddlFileType.SelectedValue)) { strWhere += " AND bh LIKE '%" + ddlFileType.SelectedValue + "%'"; } if (txtTitle.Text.Trim().Length > 0) { strWhere += " AND title LIKE '%" + txtTitle.Text.Trim() + "%'"; } DataTable dt = fileListTmpBLL.GetListPaging(strWhere, pageSize, pageIndex, out itemCount);; AspNetPager.AlwaysShow = true; AspNetPager.PageSize = pageSize; AspNetPager.RecordCount = itemCount; AspNetPager.CurrentPageIndex = pageIndex; rpData.DataSource = dt; rpData.DataBind(); }
/// <summary> /// 绑定列表 /// </summary> /// <param name="pageIndex">索引页</param> private void BindGridView(int pageIndex) { string strWhere = " 1=1 "; if (!String.IsNullOrWhiteSpace(archive_form_no.SelectValue)) { strWhere += " And archive_form_no=" + archive_form_no.SelectValue + " "; } if (ConvertEx.ToString(PID.SelectValue) != "0") { strWhere += " AND BH like '" + PID.SelectValue + "%' "; } if (!String.IsNullOrWhiteSpace(txtTitle.Text.Trim())) { strWhere += " AND title like '%" + txtTitle.Text.Trim() + "%' "; } if (chkSignature.Checked) { strWhere += " AND ((select COUNT(1) from T_FileList_SignatureTmp tt where tt.FileListID=recid)>0) "; } if (ViewState["CurrentPageIndex"] == null && Common.ConvertEx.ToInt(DNTRequest.GetQueryString("PageIndex")) > 0) { pageIndex = Common.ConvertEx.ToInt(DNTRequest.GetQueryString("PageIndex")); ViewState["CurrentPageIndex"] = pageIndex; } else { pageIndex = ConvertEx.ToInt(ViewState["CurrentPageIndex"]); } DataTable dt = fileListTmpBLL.GetListPaging(strWhere, pageSize, pageIndex, out itemCount);; AspNetPager.AlwaysShow = true; AspNetPager.PageSize = pageSize; AspNetPager.RecordCount = itemCount; AspNetPager.CurrentPageIndex = pageIndex; rpData.DataSource = dt; rpData.DataBind(); }