Changeset 15966
- Timestamp:
- 06/19/18 15:51:41 (6 years ago)
- Location:
- branches/2839_HiveProjectManagement
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/HeuristicLab.Clients.Hive.Administrator-3.3.csproj
r15908 r15966 132 132 </Compile> 133 133 <Compile Include="MenuItems\AdministratorMenuItem.cs" /> 134 <Compile Include="Views\ProjectJobsView.cs"> 135 <SubType>UserControl</SubType> 136 </Compile> 137 <Compile Include="Views\ProjectJobsView.Designer.cs"> 138 <DependentUpon>ProjectJobsView.cs</DependentUpon> 139 </Compile> 134 140 <Compile Include="Views\ProjectPermissionsView.cs"> 135 141 <SubType>UserControl</SubType> … … 248 254 <Private>False</Private> 249 255 </ProjectReference> 256 <ProjectReference Include="..\..\HeuristicLab.Data.Views\3.3\HeuristicLab.Data.Views-3.3.csproj"> 257 <Project>{72104A0B-90E7-42F3-9ABE-9BBBADD4B943}</Project> 258 <Name>HeuristicLab.Data.Views-3.3</Name> 259 </ProjectReference> 250 260 <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj"> 251 261 <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project> … … 283 293 <Private>False</Private> 284 294 </ProjectReference> 295 </ItemGroup> 296 <ItemGroup> 297 <EmbeddedResource Include="Views\ProjectJobsView.resx"> 298 <DependentUpon>ProjectJobsView.cs</DependentUpon> 299 </EmbeddedResource> 285 300 </ItemGroup> 286 301 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectView.cs
r15760 r15966 28 28 using HeuristicLab.Core.Views; 29 29 using HeuristicLab.MainForm; 30 using System.Drawing; 30 31 31 32 namespace HeuristicLab.Clients.Hive.Administrator.Views { … … 35 36 private readonly object locker = new object(); 36 37 38 private Guid persistedOwnerUserId; 39 37 40 public new Project Content { 38 41 get { return (Project)base.Content; } 39 set { base.Content = value; }42 set { base.Content = value; persistedOwnerUserId = Content != null ? Content.OwnerUserId : Guid.Empty; } 40 43 } 41 44 … … 82 85 createdTextBox.Text = Content.DateCreated.ToString("ddd, dd.MM.yyyy, HH:mm:ss"); 83 86 startDateTimePicker.Value = Content.StartDate; 84 if (indefiniteCheckBox.Checked = !Content.EndDate.HasValue) { 85 endDateTimePicker.Value = startDateTimePicker.Value;86 } else {87 endDateTimePicker.Value = Content.EndDate.Value;88 }87 88 indefiniteCheckBox.Checked = !Content.EndDate.HasValue; 89 if(!indefiniteCheckBox.Checked) endDateTimePicker.Value = Content.EndDate.Value; 90 else endDateTimePicker.Value = Content.StartDate; 91 endDateTimePicker.Enabled = !indefiniteCheckBox.Checked; 89 92 } 90 93 } … … 148 151 ownerComboBox.SelectedIndexChanged -= ownerComboBox_SelectedIndexChanged; 149 152 ownerComboBox.DataSource = AccessClient.Instance.UsersAndGroups.OfType<LightweightUser>().ToList(); 150 ownerComboBox.SelectedItem = AccessClient.Instance.UsersAndGroups.FirstOrDefault(x => x.Id == Content.OwnerUserId);153 ownerComboBox.SelectedItem = AccessClient.Instance.UsersAndGroups.FirstOrDefault(x => x.Id == persistedOwnerUserId); 151 154 ownerComboBox.SelectedIndexChanged += ownerComboBox_SelectedIndexChanged; 152 155 refreshButton.Enabled = true; … … 201 204 if (Content == null) return; 202 205 var newEndDate = indefiniteCheckBox.Checked ? (DateTime?)null : Content.StartDate; 203 if (Content.EndDate != newEndDate) 206 endDateTimePicker.Enabled = !indefiniteCheckBox.Checked; 207 if (Content.EndDate != newEndDate) { 208 DeregisterContentEvents(); 204 209 Content.EndDate = newEndDate; 210 endDateTimePicker.Value = newEndDate.HasValue ? newEndDate.Value : Content.StartDate; 211 RegisterContentEvents(); 212 } 205 213 } 206 214 #endregion -
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectsView.Designer.cs
r15953 r15966 39 39 this.resourcesTabPage = new System.Windows.Forms.TabPage(); 40 40 this.projectResourcesView = new HeuristicLab.Clients.Hive.Administrator.Views.ProjectResourcesView(); 41 this.jobsTabPage = new System.Windows.Forms.TabPage(); 42 this.projectJobsView = new HeuristicLab.Clients.Hive.Administrator.Views.ProjectJobsView(); 41 43 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 42 44 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); … … 48 50 this.permissionsTabPage.SuspendLayout(); 49 51 this.resourcesTabPage.SuspendLayout(); 52 this.jobsTabPage.SuspendLayout(); 50 53 this.SuspendLayout(); 51 54 // … … 152 155 this.tabControl.Controls.Add(this.permissionsTabPage); 153 156 this.tabControl.Controls.Add(this.resourcesTabPage); 157 this.tabControl.Controls.Add(this.jobsTabPage); 154 158 this.tabControl.Location = new System.Drawing.Point(3, 3); 155 159 this.tabControl.Name = "tabControl"; … … 225 229 this.projectResourcesView.Size = new System.Drawing.Size(571, 509); 226 230 this.projectResourcesView.TabIndex = 0; 231 // 232 // jobsTabPage 233 // 234 this.jobsTabPage.Controls.Add(this.projectJobsView); 235 this.jobsTabPage.Location = new System.Drawing.Point(4, 22); 236 this.jobsTabPage.Name = "jobsTabPage"; 237 this.jobsTabPage.Padding = new System.Windows.Forms.Padding(3); 238 this.jobsTabPage.Size = new System.Drawing.Size(577, 515); 239 this.jobsTabPage.TabIndex = 3; 240 this.jobsTabPage.Text = "Jobs"; 241 this.jobsTabPage.UseVisualStyleBackColor = true; 242 // 243 // projectJobsView 244 // 245 this.projectJobsView.Caption = "ProjectView"; 246 this.projectJobsView.Content = null; 247 this.projectJobsView.Dock = System.Windows.Forms.DockStyle.Fill; 248 this.projectJobsView.Location = new System.Drawing.Point(3, 3); 249 this.projectJobsView.Name = "projectJobsView"; 250 this.projectJobsView.ReadOnly = false; 251 this.projectJobsView.Size = new System.Drawing.Size(571, 509); 252 this.projectJobsView.TabIndex = 0; 227 253 // 228 254 // ProjectsView … … 242 268 this.permissionsTabPage.ResumeLayout(false); 243 269 this.resourcesTabPage.ResumeLayout(false); 270 this.jobsTabPage.ResumeLayout(false); 244 271 this.ResumeLayout(false); 245 272 … … 260 287 private System.Windows.Forms.ImageList imageList; 261 288 private System.Windows.Forms.TabPage resourcesTabPage; 289 private System.Windows.Forms.TabPage jobsTabPage; 262 290 private ProjectResourcesView projectResourcesView; 263 291 private ProjectPermissionsView projectPermissionsView; 292 private ProjectJobsView projectJobsView; 264 293 private System.Windows.Forms.ToolTip toolTip; 265 294 } -
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectsView.cs
r15953 r15966 100 100 projectPermissionsView.Content = null; 101 101 projectResourcesView.Content = null; 102 projectJobsView.Content = null; 102 103 } else { 103 104 BuildProjectTree(Content); … … 115 116 projectPermissionsView.Enabled = enabled; 116 117 projectResourcesView.Enabled = enabled; 118 projectJobsView.Enabled = enabled; 117 119 } 118 120 #endregion … … 228 230 MessageBox.Show( 229 231 "Only empty projects can be deleted.", 232 "HeuristicLab Hive Administrator", 233 MessageBoxButtons.OK, 234 MessageBoxIcon.Error); 235 return; 236 } 237 238 if (HiveAdminClient.Instance.Jobs.ContainsKey(selectedProject.Id) 239 && HiveAdminClient.Instance.Jobs[selectedProject.Id] != null 240 && HiveAdminClient.Instance.Jobs[selectedProject.Id].Any()) { 241 MessageBox.Show( 242 "There are " + HiveAdminClient.Instance.Jobs[selectedProject.Id].Count + " jobs using this project and/or child-projects. It is necessary to delete them before the project.", 230 243 "HeuristicLab Hive Administrator", 231 244 MessageBoxButtons.OK, … … 442 455 projectPermissionsView.Content = project; 443 456 projectResourcesView.Content = project; 457 projectJobsView.Content = project; 444 458 445 459 bool projectIsNew = project != null && project.Id == Guid.Empty; … … 454 468 projectPermissionsView.Locked = locked; 455 469 projectResourcesView.Locked = locked; 470 projectJobsView.Locked = locked; 456 471 selectedProject = project; 457 472 } -
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.cs
r15956 r15966 48 48 private const string ADDED_SELECTION_TAG = " [added selection]"; 49 49 private const string REMOVED_SELECTION_TAG = " [removed selection]"; 50 private const string SELECTED_TAG = " [selected]"; 50 51 private const string INCLUDED_TAG = " [included]"; 51 52 private const string ADDED_INCLUDE_TAG = " [added include]"; … … 537 538 if (newAssignedResources.Select(x => x.Id).Contains(newResource.Id)) { 538 539 newNode.Checked = true; 540 if(!addedAssignments.Select(x => x.Id).Contains(newResource.Id) && !removedAssignments.Select(x => x.Id).Contains(newResource.Id)) { 541 newNode.Text += SELECTED_TAG; 542 } 539 543 } else if (newIncludedResources.Select(x => x.Id).Contains(newResource.Id)) { 540 544 newNode.Checked = true; … … 702 706 if (newAssignedResources.Select(x => x.Id).Contains(resource.Id)) { 703 707 n.Checked = true; 708 if (!addedAssignments.Select(x => x.Id).Contains(resource.Id) && !removedAssignments.Select(x => x.Id).Contains(resource.Id)) { 709 n.Text += SELECTED_TAG; 710 } 704 711 } else if (newIncludedResources.Select(x => x.Id).Contains(resource.Id)) { 705 712 n.Checked = true; -
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs
r15920 r15966 479 479 480 480 private void updateButton_Click(object sender, EventArgs e) { 481 if (Content.ExecutionState == ExecutionState.Stopped) { 482 MessageBox.Show("Job cannot be updated once it stopped.", "HeuristicLab Hive Job Manager", MessageBoxButtons.OK, MessageBoxIcon.Information); 483 return; 484 } 485 481 486 HiveClient.UpdateJob( 482 487 (Exception ex) => ErrorHandling.ShowErrorDialog(this, "Update failed.", ex), -
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive/3.3/HiveAdminClient.cs
r15922 r15966 70 70 } 71 71 72 private Dictionary<Guid, HiveItemCollection<Job>> jobs; 73 public Dictionary<Guid, HiveItemCollection<Job>> Jobs { 74 get { return jobs; } 75 set { 76 if (value != jobs) 77 jobs = value; 78 } 79 } 80 81 72 82 //private Dictionary<Guid, HashSet<Project>> projectAncestors; 73 83 //public Dictionary<Guid, HashSet<Project>> ProjectAncestors { … … 134 144 projects = new ItemList<Project>(); 135 145 projectResourceAssignments = new ItemList<AssignedProjectResource>(); 136 137 //projectAncestors = new Dictionary<Guid, HashSet<Project>>(); 138 //projectDescendants = new Dictionary<Guid, HashSet<Project>>(); 139 //resourceAncestors = new Dictionary<Guid, HashSet<Resource>>(); 140 //resourceDescendants = new Dictionary<Guid, HashSet<Resource>>(); 146 jobs = new Dictionary<Guid, HiveItemCollection<Job>>(); 147 141 148 projectAncestors = new Dictionary<Guid, HashSet<Guid>>(); 142 149 projectDescendants = new Dictionary<Guid, HashSet<Guid>>(); … … 149 156 service.GetProjectsForAdministration().ForEach(p => projects.Add(p)); 150 157 var projectIds = projects.Select(p => p.Id).ToList(); 151 if (projectIds.Any())158 if (projectIds.Any()) { 152 159 service.GetAssignedResourcesForProjectsAdministration(projectIds) 153 .ForEach(a => projectResourceAssignments.Add(a)); 160 .ForEach(a => projectResourceAssignments.Add(a)); 161 projectIds.ForEach(p => jobs.Add(p, new HiveItemCollection<Job>())); 162 service.GetJobsByProjectIds(projectIds) 163 .ForEach(j => jobs[j.ProjectId].Add(j)); 164 } 154 165 }); 155 166 -
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive/3.3/ServiceClients/HiveServiceClient.cs
r15913 r15966 2385 2385 System.Collections.Generic.List<HeuristicLab.Clients.Hive.Job> GetJobs(); 2386 2386 2387 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetJobsByProjectId", ReplyAction="http://tempuri.org/IHiveService/GetJobsByProjectIdResponse")] 2388 System.Collections.Generic.List<HeuristicLab.Clients.Hive.Job> GetJobsByProjectId(System.Guid projectId); 2389 2390 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetJobsByProjectIds", ReplyAction="http://tempuri.org/IHiveService/GetJobsByProjectIdsResponse")] 2391 System.Collections.Generic.List<HeuristicLab.Clients.Hive.Job> GetJobsByProjectIds(System.Collections.Generic.List<System.Guid> projectIds); 2392 2387 2393 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/AddJob", ReplyAction="http://tempuri.org/IHiveService/AddJobResponse")] 2388 2394 System.Guid AddJob(HeuristicLab.Clients.Hive.Job jobDto, System.Collections.Generic.List<System.Guid> resourceIds); … … 2655 2661 } 2656 2662 2663 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.Job> GetJobsByProjectId(System.Guid projectId) 2664 { 2665 return base.Channel.GetJobsByProjectId(projectId); 2666 } 2667 2668 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.Job> GetJobsByProjectIds(System.Collections.Generic.List<System.Guid> projectIds) 2669 { 2670 return base.Channel.GetJobsByProjectIds(projectIds); 2671 } 2672 2657 2673 public System.Guid AddJob(HeuristicLab.Clients.Hive.Job jobDto, System.Collections.Generic.List<System.Guid> resourceIds) 2658 2674 { -
branches/2839_HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/JobDao.cs
r15908 r15966 32 32 return GetByIdQuery(DataContext, id); 33 33 } 34 34 35 35 public void DeleteByState(JobState state) { 36 36 DataContext.ExecuteCommand(DeleteByStateQueryString, Enum.GetName(typeof(JobState), state)); 37 } 38 39 public IEnumerable<Job> GetByProjectId(Guid id) { 40 return GetByProjectIdQuery(DataContext, id); 41 } 42 43 public IEnumerable<Job> GetByProjectIds(IEnumerable<Guid> projectIds) { 44 string paramProjectIds = string.Join(",", projectIds.ToList().Select(x => string.Format("'{0}'", x))); 45 if(!string.IsNullOrWhiteSpace(paramProjectIds)) { 46 string queryString = string.Format(GetByProjectIdsQueryString, paramProjectIds); 47 return DataContext.ExecuteQuery<Job>(queryString); 48 } 49 return Enumerable.Empty<Job>(); 37 50 } 38 51 … … 56 69 where job.JobId == jobId 57 70 select job).SingleOrDefault()); 71 private static readonly Func<DataContext, Guid, IEnumerable<Job>> GetByProjectIdQuery = 72 CompiledQuery.Compile((DataContext db, Guid projectId) => 73 (from job in db.GetTable<Job>() 74 where job.ProjectId == projectId 75 select job)); 58 76 private static readonly Func<DataContext, JobState, IEnumerable<Job>> GetByStateQuery = 59 77 CompiledQuery.Compile((DataContext db, JobState jobState) => … … 92 110 WHERE t.JobId = j.JobId) 93 111 "; 112 private const string GetByProjectIdsQueryString = @" 113 SELECT DISTINCT j.* 114 FROM [Job] j 115 WHERE j.ProjectId IN ({0}) 116 "; 94 117 #endregion 95 118 } -
branches/2839_HiveProjectManagement/HeuristicLab.Services.Hive/3.3/HiveService.cs
r15954 r15966 366 366 } 367 367 368 public IEnumerable<DT.Job> GetJobsByProjectId(Guid projectId) { 369 RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client); 370 var pm = PersistenceManager; 371 using (new PerformanceLogger("GetJobsByProjectId")) { 372 var currentUserId = UserManager.CurrentUserId; 373 var projectDao = pm.ProjectDao; 374 var jobDao = pm.JobDao; 375 376 return pm.UseTransaction(() => { 377 // check if user is granted to administer the requested projectId 378 var administrationGrantedProjects = projectDao 379 .GetAdministrationGrantedProjectsForUser(currentUserId) 380 .ToList(); 381 382 if(administrationGrantedProjects.Select(x => x.ProjectId).Contains(projectId)) { 383 return jobDao.GetByProjectId(projectId) 384 .Select(x => x.ToDto()) 385 .ToList(); 386 } else { 387 return Enumerable.Empty<DT.Job>(); 388 } 389 }); 390 } 391 } 392 393 public IEnumerable<DT.Job> GetJobsByProjectIds(IEnumerable<Guid> projectIds) { 394 RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client); 395 var pm = PersistenceManager; 396 using (new PerformanceLogger("GetJobsByProjectIds")) { 397 var currentUserId = UserManager.CurrentUserId; 398 var projectDao = pm.ProjectDao; 399 var jobDao = pm.JobDao; 400 return pm.UseTransaction(() => { 401 // check for which of requested projectIds the user is granted to administer 402 var administrationGrantedProjectIds = projectDao 403 .GetAdministrationGrantedProjectsForUser(currentUserId) 404 .Select(x => x.ProjectId) 405 .ToList(); 406 var requestedAndGrantedProjectIds = projectIds.Intersect(administrationGrantedProjectIds); 407 408 if(requestedAndGrantedProjectIds.Any()) { 409 return jobDao.GetByProjectIds(requestedAndGrantedProjectIds) 410 .Select(x => x.ToDto()) 411 .ToList(); 412 } else { 413 return Enumerable.Empty<DT.Job>(); 414 } 415 }); 416 } 417 } 418 368 419 public Guid AddJob(DT.Job jobDto, IEnumerable<Guid> resourceIds) { 369 420 RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client); 421 var dateCreated = DateTime.Now; 422 var pm = PersistenceManager; 423 424 // check project availability (cf. duration) 425 CheckProjectAvailability(pm, jobDto.ProjectId, dateCreated); 426 370 427 // check user - project 371 428 AuthorizationManager.AuthorizeUserForProjectUse(UserManager.CurrentUserId, jobDto.ProjectId); 429 372 430 // check project - resources 373 431 AuthorizationManager.AuthorizeProjectForResourcesUse(jobDto.ProjectId, resourceIds); 374 var pm = PersistenceManager;432 375 433 using (new PerformanceLogger("AddJob")) { 376 434 var jobDao = pm.JobDao; … … 380 438 var newJob = jobDto.ToEntity(); 381 439 newJob.OwnerUserId = UserManager.CurrentUserId; 382 newJob.DateCreated = DateTime.Now;440 newJob.DateCreated = dateCreated; 383 441 384 442 // add resource assignments … … 406 464 RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client); 407 465 AuthorizationManager.AuthorizeForJob(jobDto.Id, DT.Permission.Full); 466 var pm = PersistenceManager; 467 var dateUpdated = DateTime.Now; 468 469 // check project availability 470 CheckProjectAvailability(pm, jobDto.ProjectId, dateUpdated); 408 471 // check user - project permission 409 472 AuthorizationManager.AuthorizeUserForProjectUse(UserManager.CurrentUserId, jobDto.ProjectId); … … 411 474 AuthorizationManager.AuthorizeProjectForResourcesUse(jobDto.ProjectId, resourceIds); 412 475 413 var pm = PersistenceManager;414 476 using (new PerformanceLogger("UpdateJob")) { 415 477 bool exists = true; … … 466 528 if(job != null) { 467 529 var jobStateEntity = jobState.ToEntity(); 468 // note: allow solely state changes from "Online" to "StatisticsPending" 469 // and from "StatisticsPending" to "DeletionPending" 530 // note: allow solely state changes from "Online" to "StatisticsPending" = deletion request by user for HiveStatisticGenerator 531 // and from "StatisticsPending" to "DeletionPending" = deletion request by HiveStatisticGenerator for EventManager 470 532 if (job.State == DA.JobState.Online && jobStateEntity == DA.JobState.StatisticsPending) { 471 533 job.State = jobStateEntity; … … 774 836 using (new PerformanceLogger("DeleteProject")) { 775 837 var projectDao = pm.ProjectDao; 838 var jobDao = pm.JobDao; 776 839 var assignedJobResourceDao = pm.AssignedJobResourceDao; 777 840 pm.UseTransaction(() => { … … 779 842 projectIds.Union(projectDao.GetChildProjectIdsById(projectId)); 780 843 781 assignedJobResourceDao.DeleteByProjectIds(projectIds); 782 projectDao.DeleteByIds(projectIds); 783 pm.SubmitChanges(); 844 var jobs = jobDao.GetByProjectIds(projectIds) 845 .Select(x => x.ToDto()) 846 .ToList(); 847 848 if(jobs.Count > 0) { 849 throw new InvalidOperationException("There are " + jobs.Count + " job(s) using this project and/or child-projects. It is necessary to delete them before the project."); 850 } else { 851 assignedJobResourceDao.DeleteByProjectIds(projectIds); 852 projectDao.DeleteByIds(projectIds); 853 pm.SubmitChanges(); 854 } 784 855 }); 785 856 } … … 814 885 userAndGroupIds.AddRange(UserManager.GetUserGroupIdsOfUser(currentUserId)); 815 886 return pm.UseTransaction(() => { 816 returnprojectDao.GetUsageGrantedProjectsForUser(userAndGroupIds)887 var projects = projectDao.GetUsageGrantedProjectsForUser(userAndGroupIds) 817 888 .Select(x => x.ToDto()).ToList(); 889 var now = DateTime.Now; 890 return projects.Where(x => x.StartDate <= now && x.EndDate >= now).ToList(); 818 891 }); 819 892 } … … 1650 1723 } 1651 1724 1725 private void CheckProjectAvailability(IPersistenceManager pm, Guid projectId, DateTime date) { 1726 var projectDao = pm.ProjectDao; 1727 using (new PerformanceLogger("UpdateJob")) { 1728 var project = pm.UseTransaction(() => { 1729 return projectDao.GetById(projectId); 1730 }); 1731 if (project != null) { 1732 if (project.StartDate > date) throw new ArgumentException("Cannot add job to specified project. The start date of the project is still in the future."); 1733 else if (project.EndDate < date) throw new ArgumentException("Cannot add job to specified project. The end date of the project is already in the past."); 1734 } else { 1735 throw new ArgumentException("Cannot add job to specified project. The project seems not to be available anymore."); 1736 } 1737 } 1738 } 1739 1652 1740 #endregion 1653 1741 } -
branches/2839_HiveProjectManagement/HeuristicLab.Services.Hive/3.3/ServiceContracts/IHiveService.cs
r15913 r15966 79 79 80 80 [OperationContract] 81 IEnumerable<Job> GetJobsByProjectId(Guid projectId); 82 83 [OperationContract] 84 IEnumerable<Job> GetJobsByProjectIds(IEnumerable<Guid> projectIds); 85 86 [OperationContract] 81 87 Guid AddJob(Job jobDto, IEnumerable<Guid> resourceIds); 82 88
Note: See TracChangeset
for help on using the changeset viewer.