예제 #1
0
        private void FixupUserRole(UserRole previousValue)
        {
            if (previousValue != null && ReferenceEquals(previousValue.RolePermission, this))
            {
                previousValue.RolePermission = null;
            }

            if (UserRole != null)
            {
                UserRole.RolePermission = this;
                if (RolePermissionsID != UserRole.UserRoleID)
                {
                    RolePermissionsID = UserRole.UserRoleID;
                }
            }
        }
예제 #2
0
        private void FixupUserRole(UserRole previousValue)
        {
            if (previousValue != null && previousValue.Users.Contains(this))
            {
                previousValue.Users.Remove(this);
            }

            if (UserRole != null)
            {
                if (!UserRole.Users.Contains(this))
                {
                    UserRole.Users.Add(this);
                }
                if (RoleID != UserRole.UserRoleID)
                {
                    RoleID = UserRole.UserRoleID;
                }
            }
        }