private void BindUserList() { using (SysUserBusiness user = new SysUserBusiness()) { if (IsAdmin) { UserList.DataSource = user.GetSysUsers(); List <SysUserViewEntity> SysUsers = user.GetSysUsers(); List <RoleMemberEntity> RoleMembers = m_Role.GetRoleMembers(RoleNo); SysUserViewEntity SysUser; foreach (RoleMemberEntity RoleMember in RoleMembers) { SysUser = SysUsers.Where(p => p.UserNo == RoleMember.UserNo).ToList().FirstOrDefault(); SysUsers.Remove(SysUser); } UserList.DataSource = SysUsers; } UserList.DataBind(); } }
/// <summary> /// 系统用户数据绑定 /// </summary> public override void DataBind() { int recordCount = 0; UserRepeater.DataSource = m_User.GetSysUsers(Pager.CurrentPageIndex, Pager.PageSize, out recordCount); using (DepartmentBusiness Dept = new DepartmentBusiness()) { drpDeparts.DataSource = Dept.GetDepartments(); drpDeparts.DataTextField = "DeptName"; drpDeparts.DataValueField = "DeptID"; } Pager.RecordCount = recordCount; base.DataBind(); }
private void BindUserList() { using (SysUserBusiness user = new SysUserBusiness()) { if (IsAdmin) UserList.DataSource = user.GetSysUsers(); UserList.DataBind(); } }