Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/17/18 15:20:29 (6 years ago)
Author:
jzenisek
Message:

#2839 worked on Hive Job Manager: improved project/resource selector to show existent assignments and preserve selections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectResourcesView.cs

    r15576 r15627  
    152152
    153153    private static IEnumerable<Resource> GetAssignedResourcesForProject(Guid projectId) {
    154       var assignedProjectResources = HiveServiceLocator.Instance.CallHiveService(s => s.GetAssignedResourcesForProject(projectId));
     154      var assignedProjectResources = HiveServiceLocator.Instance.CallHiveService(s => s.GetAssignedResourcesForProjectAdministration(projectId));
    155155      return HiveAdminClient.Instance.Resources.Where(x => assignedProjectResources.Select(y => y.ResourceId).Contains(x.Id));
    156156    }
     
    242242
    243243      var mainResources = new HashSet<Resource>(resources.OfType<SlaveGroup>().Where(x => x.ParentResourceId == null));
     244      var parentedMainResources = new HashSet<Resource>(resources.OfType<SlaveGroup>()
     245        .Where(x => x.ParentResourceId.HasValue && !resources.Select(y => y.Id).Contains(x.ParentResourceId.Value)));
     246      mainResources.UnionWith(parentedMainResources);
    244247      var subResources = new HashSet<Resource>(resources.Except(mainResources));
    245248
    246249      var stack = new Stack<Resource>(mainResources.OrderByDescending(x => x.Name));
    247       var top = stack.Peek();
     250      Resource top = null;
    248251
    249252      TreeNode currentNode = null;
     
    262265
    263266      while (stack.Any()) {
     267        if(top == null)  top = stack.Peek();
    264268        var newResource = stack.Pop();
    265269        var newNode = new TreeNode(newResource.Name) { Tag = newResource };
Note: See TracChangeset for help on using the changeset viewer.