private void BindGrid() { bool isAdmin = IsAdmin; // 审核员角色Id string role = ConfigurationManager.AppSettings["CheckRoleId"]; int roleId = Convert.ToInt32(role); UserRoleService urs = new UserRoleService(); // 如果用户有审核员的角色,则能审核全部文章 if (urs.Exists(cmsUserRole._.UserId == UserID && cmsUserRole._.RoleId == roleId)) { isAdmin = true; } int recordCount = 0; DataTable dt = ns.GetListByFilter2( "", txtTitle.Text, txtSource.Text, txtAuthor.Text, txtTags.Text, Convert.ToInt32(ddlIndex.SelectedValue), Convert.ToInt32(ddlTop.SelectedValue), Convert.ToInt32(type), txtAddTime1.Text, txtAddTime2.Text, txtEditTime1.Text, txtEditTime2.Text, UserID, isAdmin, pager.CurrentPageIndex, pager.PageSize, ref recordCount); // 绑定数据到GridView base.BindGrid(recordCount, dt); }
private void BindGrid() { bool isAdmin = IsAdmin; // 审核员角色Id string role = ConfigurationManager.AppSettings["CheckRoleId"]; int roleId = Convert.ToInt32(role); UserRoleService urs = new UserRoleService(); // 如果用户有审核员的角色,则能审核全部文章 if (urs.Exists(cmsUserRole._.UserId == UserID && cmsUserRole._.RoleId == roleId)) { isAdmin = true; } int recordCount = 0; DataTable dt = ns.GetListByFilter2( "", txtTitle.Text, txtSource.Text, txtAuthor.Text, txtTags.Text, Convert.ToInt32(ddlIndex.SelectedValue), Convert.ToInt32(ddlTop.SelectedValue), Convert.ToInt32(type), txtAddTime1.Text, txtAddTime2.Text, txtEditTime1.Text, txtEditTime2.Text, UserID, isAdmin, pager.CurrentPageIndex, pager.PageSize, ref recordCount); // 绑定数据到GridView base.BindGrid(recordCount, dt); }