/// <summary> /// BindGrid loads the data grid from the Database /// </summary> /// <history> /// [cnurse] 9/10/2004 Updated to reflect design changes for Help, 508 support /// and localisation /// </history> private void BindGrid() { RoleController objRoleController = new RoleController(); if( _roleId != - 1 ) { string RoleName = objRoleController.GetRole( _roleId, PortalId ).RoleName; grdUserRoles.DataKeyField = "UserId"; grdUserRoles.Columns[2].Visible = false; grdUserRoles.DataSource = objRoleController.GetUserRolesByRoleName( PortalId, RoleName ); grdUserRoles.DataBind(); } if( _userId != - 1 ) { UserInfo objUserInfo = UserController.GetUser( PortalId, _userId, false ); grdUserRoles.DataKeyField = "RoleId"; grdUserRoles.Columns[1].Visible = false; grdUserRoles.DataSource = objRoleController.GetUserRolesByUsername( PortalId, objUserInfo.Username, Null.NullString ); grdUserRoles.DataBind(); } }
/// ----------------------------------------------------------------------------- /// <summary> /// BindGrid loads the data grid from the Database /// </summary> /// <remarks> /// </remarks> /// <history> /// [cnurse] 9/10/2004 Updated to reflect design changes for Help, 508 support /// and localisation /// </history> /// ----------------------------------------------------------------------------- private void BindGrid() { var objRoleController = new RoleController(); if (RoleId != Null.NullInteger) { cmdAdd.Text = Localization.GetString("AddUser.Text", LocalResourceFile); grdUserRoles.DataKeyField = "UserId"; grdUserRoles.Columns[2].Visible = false; grdUserRoles.DataSource = objRoleController.GetUserRolesByRoleName(PortalId, Role.RoleName); grdUserRoles.DataBind(); } if (UserId != -1) { cmdAdd.Text = Localization.GetString("AddRole.Text", LocalResourceFile); grdUserRoles.DataKeyField = "RoleId"; grdUserRoles.Columns[1].Visible = false; grdUserRoles.DataSource = objRoleController.GetUserRolesByUsername(PortalId, User.Username, Null.NullString); grdUserRoles.DataBind(); } }