Changeset 17223


Ignore:
Timestamp:
08/28/19 09:32:31 (12 months ago)
Author:
jkarder
Message:

#3024: fixed automatic change of project owner

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectView.cs

    r17180 r17223  
    9595        descriptionTextBox.Text = Content.Description;
    9696
    97         ownerComboBox.SelectedIndexChanged -= ownerComboBox_SelectedIndexChanged;
    9897        if (AccessClient.Instance.UsersAndGroups != null) {
    9998          var users = AccessClient.Instance.UsersAndGroups.OfType<LightweightUser>();
     
    103102          ownerComboBox.SelectedItem = users.FirstOrDefault(x => x.Id == projectOwnerId);
    104103        }
    105         ownerComboBox.SelectedIndexChanged += ownerComboBox_SelectedIndexChanged;
    106104
    107105        createdTextBox.Text = Content.DateCreated.ToString("ddd, dd.MM.yyyy, HH:mm:ss");
     
    175173          var users = AccessClient.Instance.UsersAndGroups.OfType<LightweightUser>();
    176174          if (Content != null && !Content.ParentProjectId.HasValue) users = users.Where(x => x.Roles.Select(y => y.Name).Contains(HiveRoles.Administrator));
     175          var projectOwnerId = Content != null ? Content.OwnerUserId : (Guid?)null;
    177176          ownerComboBox.DataSource = users.OrderBy(x => x.UserName).ToList();
     177          ownerComboBox.SelectedItem = projectOwnerId.HasValue ? users.FirstOrDefault(x => x.Id == projectOwnerId) : null;
    178178          ownerComboBox.SelectedIndexChanged += ownerComboBox_SelectedIndexChanged;
    179179        });
Note: See TracChangeset for help on using the changeset viewer.