Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1633 for trunk/sources


Ignore:
Timestamp:
04/23/09 16:43:55 (16 years ago)
Author:
msteinbi
Message:

added empty group for all clients that aren't in a group (#599)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ClientManager.cs

    r1530 r1633  
    7979        IClientGroupAdapter clientGroupAdapter =
    8080          session.GetDataAdapter<ClientGroup, IClientGroupAdapter>();
     81        IClientAdapter clientAdapter =
     82          session.GetDataAdapter<ClientInfo, IClientAdapter>();
    8183        ResponseList<ClientGroup> response = new ResponseList<ClientGroup>();
    8284
    83         response.List = new List<ClientGroup>(clientGroupAdapter.GetAll());
     85        List<ClientGroup> allClientGroups = new List<ClientGroup>(clientGroupAdapter.GetAll());
     86        ClientGroup emptyClientGroup = new ClientGroup();
     87        ICollection<ClientInfo> groupLessClients = clientAdapter.GetGrouplessClients();
     88        if (groupLessClients != null) {
     89          foreach (ClientInfo currClient in groupLessClients) {
     90            emptyClientGroup.Resources.Add(currClient);
     91          }
     92        }
     93        allClientGroups.Add(emptyClientGroup);
     94
     95        response.List = allClientGroups;
    8496        response.StatusMessage = ApplicationConstants.RESPONSE_CLIENT_GET_ALL_CLIENTGROUPS;
    8597        response.Success = true;
Note: See TracChangeset for help on using the changeset viewer.