/// <summary> /// 列表档案馆用户数据绑定 /// </summary> /// <param name="pageIndex"></param> private void BindGridView(int pageIndex) { string sqlWhere = " b.CompanyType=" + SystemSet._ARCHIVE; if (txtLoginName.Text.Trim().Length > 0) { sqlWhere += " And a.LoginName like '%" + txtLoginName.Text.Trim() + "%' "; } if (txtUserName.Text.Trim().Length > 0) { sqlWhere += " And a.UserName like '%" + txtUserName.Text.Trim() + "%' "; } if (!String.IsNullOrWhiteSpace(ddlCompany.SelectValue)) { sqlWhere += " And b.CompanyID =" + ddlCompany.SelectValue; } if (PublicModel.isSuperAdmin()) //超级管理员 { sqlWhere += " And b.Area_Code like '" + Common.Session.GetSession("AREA_CODE") + "%' "; } else if (PublicModel.isArchiveUser()) //馆里用户 { sqlWhere += " And b.Area_Code like '" + Common.Session.GetSession("OLD_AREA_CODE") + "%' "; } 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 = userBLL.GetListByCompany(sqlWhere, pageSize, pageIndex, out itemCount); AspNetPager.AlwaysShow = true; AspNetPager.PageSize = pageSize; AspNetPager.RecordCount = itemCount; AspNetPager.CurrentPageIndex = pageIndex; rpData.DataSource = dt; rpData.DataBind(); }