Changeset 15992 for branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectView.cs
- Timestamp:
- 07/10/18 23:06:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectView.cs
r15966 r15992 82 82 nameTextBox.Text = Content.Name; 83 83 descriptionTextBox.Text = Content.Description; 84 ownerComboBox.SelectedItem = AccessClient.Instance.UsersAndGroups.FirstOrDefault(x => x.Id == Content.OwnerUserId); 84 85 ownerComboBox.SelectedIndexChanged -= ownerComboBox_SelectedIndexChanged; 86 var users = AccessClient.Instance.UsersAndGroups.OfType<LightweightUser>(); 87 if (!Content.ParentProjectId.HasValue) users = users.Where(x => x.Roles.Select(y => y.Name).Contains(HiveRoles.Administrator)); 88 ownerComboBox.DataSource = users.ToList(); 89 ownerComboBox.SelectedItem = users.FirstOrDefault(x => x.Id == Content.OwnerUserId); 90 ownerComboBox.SelectedIndexChanged += ownerComboBox_SelectedIndexChanged; 91 85 92 createdTextBox.Text = Content.DateCreated.ToString("ddd, dd.MM.yyyy, HH:mm:ss"); 86 93 startDateTimePicker.Value = Content.StartDate; … … 135 142 finallyCallback: () => { 136 143 ownerComboBox.SelectedIndexChanged -= ownerComboBox_SelectedIndexChanged; 137 ownerComboBox.DataSource = AccessClient.Instance.UsersAndGroups.OfType<LightweightUser>().ToList(); 144 var users = AccessClient.Instance.UsersAndGroups.OfType<LightweightUser>(); 145 if (Content != null && !Content.ParentProjectId.HasValue) users = users.Where(x => x.Roles.Select(y => y.Name).Contains(HiveRoles.Administrator)); 146 ownerComboBox.DataSource = users.ToList(); 138 147 ownerComboBox.SelectedIndexChanged += ownerComboBox_SelectedIndexChanged; 139 148 }); … … 150 159 finallyCallback: () => { 151 160 ownerComboBox.SelectedIndexChanged -= ownerComboBox_SelectedIndexChanged; 152 ownerComboBox.DataSource = AccessClient.Instance.UsersAndGroups.OfType<LightweightUser>().ToList(); 153 ownerComboBox.SelectedItem = AccessClient.Instance.UsersAndGroups.FirstOrDefault(x => x.Id == persistedOwnerUserId); 161 var users = AccessClient.Instance.UsersAndGroups.OfType<LightweightUser>(); 162 if (Content != null && !Content.ParentProjectId.HasValue) users = users.Where(x => x.Roles.Select(y => y.Name).Contains(HiveRoles.Administrator)); 163 ownerComboBox.DataSource = users.ToList(); 164 ownerComboBox.SelectedItem = users.FirstOrDefault(x => x.Id == persistedOwnerUserId); 154 165 ownerComboBox.SelectedIndexChanged += ownerComboBox_SelectedIndexChanged; 155 166 refreshButton.Enabled = true; … … 203 214 private void indefiniteCheckBox_CheckedChanged(object sender, EventArgs e) { 204 215 if (Content == null) return; 205 var newEndDate = indefiniteCheckBox.Checked ? (DateTime?)null : Content.StartDate;216 var newEndDate = indefiniteCheckBox.Checked ? (DateTime?)null : endDateTimePicker.Value; 206 217 endDateTimePicker.Enabled = !indefiniteCheckBox.Checked; 207 218 if (Content.EndDate != newEndDate) { 208 219 DeregisterContentEvents(); 209 220 Content.EndDate = newEndDate; 210 endDateTimePicker.Value = newEndDate.HasValue ? newEndDate.Value : Content.StartDate;211 221 RegisterContentEvents(); 212 222 }
Note: See TracChangeset
for help on using the changeset viewer.