Index: branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/AccessService.cs
===================================================================
--- branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/AccessService.cs	(revision 6825)
+++ branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/AccessService.cs	(revision 6840)
@@ -20,10 +20,306 @@
 #endregion
 
+using System;
+using System.Collections.Generic;
+using System.Linq;
 using System.ServiceModel;
+using DA = HeuristicLab.Services.Access.DataAccess;
+using DT = HeuristicLab.Services.Access.DataTransfer;
 
 namespace HeuristicLab.Services.Access {
   [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
-  public class AccessService {
-
+  public class AccessService : IAccessService {
+
+    #region Client Members
+    public bool ClientExists(Guid id) {
+      if (id != Guid.Empty) {
+        using (DA.ClientManagementDataContext context = new DA.ClientManagementDataContext()) {
+          return (context.Resources.Where(x => x.Id == id).Count() != 0);
+        }
+      }
+      return false;
+    }
+
+    public DT.Client GetClient(Guid id) {
+      using (DA.ClientManagementDataContext context = new DA.ClientManagementDataContext()) {
+        var query = from c in context.GetTable<DA.Resource>().OfType<DA.Client>()
+                    where c.Id == id
+                    select c;
+
+        return Convert.ToDto(query.FirstOrDefault());
+      }
+    }
+
+    public IEnumerable<DT.Client> GetClients(IEnumerable<Guid> ids) {
+      using (DA.ClientManagementDataContext context = new DA.ClientManagementDataContext()) {
+        var query = from c in context.GetTable<DA.Resource>().OfType<DA.Client>()
+                    where ids.Contains(c.Id)
+                    select Convert.ToDto(c);
+        return query.ToList();
+      }
+    }
+
+    public IEnumerable<DT.Client> GetAllClients() {
+      using (DA.ClientManagementDataContext context = new DA.ClientManagementDataContext()) {
+        var query = from c in context.GetTable<DA.Resource>().OfType<DA.Client>()
+                    select Convert.ToDto(c);
+        return query.ToList();
+      }
+    }
+
+    public Guid AddClient(DT.Client client) {
+      using (DA.ClientManagementDataContext context = new DA.ClientManagementDataContext()) {
+        DA.Client entity = Convert.ToEntity(client);
+        context.Resources.InsertOnSubmit(entity);
+        context.SubmitChanges();
+        return entity.Id;
+      }
+    }
+
+    public void UpdateClient(DT.Client client) {
+      AddClient(client);
+    }
+
+    public void DeleteClient(DT.Client client) {
+      using (DA.ClientManagementDataContext context = new DA.ClientManagementDataContext()) {
+        context.Resources.DeleteOnSubmit(Convert.ToEntity(client));
+        context.SubmitChanges();
+      }
+    }
+    #endregion
+
+    #region ClientGroup
+    public IEnumerable<DT.ClientGroup> GetAllClientGroups() {
+      using (DA.ClientManagementDataContext context = new DA.ClientManagementDataContext()) {
+        var query = from c in context.GetTable<DA.Resource>().OfType<DA.ClientGroup>()
+                    select Convert.ToDto(c);
+        return query.ToList();
+      }
+    }
+
+    public IEnumerable<DT.ClientGroup> GetClientGroups(IEnumerable<Guid> ids) {
+      using (DA.ClientManagementDataContext context = new DA.ClientManagementDataContext()) {
+        var query = from c in context.GetTable<DA.Resource>().OfType<DA.ClientGroup>()
+                    where ids.Contains(c.Id)
+                    select Convert.ToDto(c);
+        return query.ToList();
+      }
+    }
+
+    public Guid AddClientGroup(DT.ClientGroup group) {
+      using (DA.ClientManagementDataContext context = new DA.ClientManagementDataContext()) {
+        var entity = Convert.ToEntity(group);
+        context.Resources.InsertOnSubmit(entity);
+        context.SubmitChanges();
+        return entity.Id;
+      }
+    }
+
+    public void UpdateClientGroup(DT.ClientGroup group) {
+      AddClientGroup(group);
+    }
+
+    public void DeleteClientGroup(DT.ClientGroup group) {
+      using (DA.ClientManagementDataContext context = new DA.ClientManagementDataContext()) {
+        context.Resources.DeleteOnSubmit(Convert.ToEntity(group));
+        context.SubmitChanges();
+      }
+    }
+
+    public void AddResourceToGroup(DT.Resource resource, DT.UserGroup group) {
+      using (DA.ClientManagementDataContext context = new DA.ClientManagementDataContext()) {
+        DA.ResourceResourceGroup rrg = new DA.ResourceResourceGroup() {
+          ResourceId = resource.Id,
+          ResourceGroupId = group.Id
+        };
+
+        context.ResourceResourceGroups.InsertOnSubmit(rrg);
+        context.SubmitChanges();
+      }
+    }
+
+    public void RemoveResourceFromGroup(DT.Resource resource, DT.UserGroup group) {
+      using (DA.ClientManagementDataContext context = new DA.ClientManagementDataContext()) {
+        var query = context.ResourceResourceGroups.Where(x => x.ResourceId == resource.Id && x.ResourceGroupId == group.Id);
+        if (query.Count() > 0) {
+          context.ResourceResourceGroups.DeleteOnSubmit(query.First());
+          context.SubmitChanges();
+        }
+      }
+    }
+    #endregion
+
+    #region ClientGroupMapping
+    public IEnumerable<DT.ClientGroupMapping> GetClientGroupMapping() {
+      using (DA.ClientManagementDataContext context = new DA.ClientManagementDataContext()) {
+        var query = from c in context.GetTable<DA.ResourceResourceGroup>()
+                    select Convert.ToDto(c);
+        return query.ToList();
+      }
+    }
+    #endregion
+
+    #region Resource
+    public IEnumerable<DT.Resource> GetResources() {
+      using (DA.ClientManagementDataContext context = new DA.ClientManagementDataContext()) {
+        var query = from r in context.Resources
+                    select Convert.ToDto(r);
+        return query.ToList();
+      }
+    }
+    #endregion
+
+    #region ClientLog
+    public DT.ClientLog GetLastClientLog(Guid clientId) {
+      using (DA.ClientManagementDataContext context = new DA.ClientManagementDataContext()) {
+        var query = from r in context.ClientLogs
+                    where r.ResourceId == clientId
+                    select r;
+        return Convert.ToDto(query.OrderBy(x => x.Timestamp).LastOrDefault());
+      }
+    }
+
+    public IEnumerable<DT.ClientLog> GetClientLogs(Guid clientId) {
+      using (DA.ClientManagementDataContext context = new DA.ClientManagementDataContext()) {
+        var query = from r in context.ClientLogs
+                    where r.ResourceId == clientId
+                    select Convert.ToDto(r);
+        return query.ToList();
+      }
+    }
+
+    public IEnumerable<DT.ClientLog> GetClientLogsSince(DateTime startDate) {
+      using (DA.ClientManagementDataContext context = new DA.ClientManagementDataContext()) {
+        var query = from r in context.ClientLogs
+                    where r.Timestamp >= startDate
+                    select Convert.ToDto(r);
+        return query.ToList();
+      }
+    }
+
+    public void AddClientLog(DT.ClientLog log) {
+      using (DA.ClientManagementDataContext context = new DA.ClientManagementDataContext()) {
+        context.ClientLogs.InsertOnSubmit(Convert.ToEntity(log));
+        context.SubmitChanges();
+      }
+    }
+
+    public void DeleteClientLog(DT.ClientLog log) {
+      using (DA.ClientManagementDataContext context = new DA.ClientManagementDataContext()) {
+        context.ClientLogs.DeleteOnSubmit(Convert.ToEntity(log));
+        context.SubmitChanges();
+      }
+    }
+    #endregion
+
+    #region User
+    public DT.User Login() {
+      throw new System.NotImplementedException();
+    }
+
+    public IEnumerable<DT.User> GetAllUsers() {
+      throw new System.NotImplementedException();
+    }
+
+    public IEnumerable<DT.User> GetUsers(IEnumerable<DT.User> ids) {
+      throw new System.NotImplementedException();
+    }
+
+    public DT.User AddUser(DT.User user) {
+      throw new System.NotImplementedException();
+    }
+
+    public void DeleteUser(DT.User user) {
+      throw new System.NotImplementedException();
+    }
+
+    public void UpdateUser(DT.User user) {
+      throw new System.NotImplementedException();
+    }
+
+    public void AddUserToRole(DT.Role role, DT.User user) {
+      throw new System.NotImplementedException();
+    }
+
+    public void RemoveUserFromRole(DT.Role role, DT.User user) {
+      throw new System.NotImplementedException();
+    }
+
+    public void ResetPassword(DT.User user, string password) {
+      throw new System.NotImplementedException();
+    }
+    #endregion
+
+    public IEnumerable<DT.UserGroup> GetAllUserGroups() {
+      throw new System.NotImplementedException();
+    }
+
+    public IEnumerable<DT.UserGroup> GetUserGroups(IEnumerable<Guid> ids) {
+      throw new System.NotImplementedException();
+    }
+
+    public DT.UserGroup AddUserGroup(DT.UserGroup group) {
+      throw new System.NotImplementedException();
+    }
+
+    public void UpdateUserGroup(DT.UserGroup group) {
+      throw new System.NotImplementedException();
+    }
+
+    public void DeleteUserGroup(DT.UserGroup group) {
+      throw new System.NotImplementedException();
+    }
+
+    public void AddUserGroupBaseToGroup(DT.UserGroupBase resource, DT.UserGroup group) {
+      throw new System.NotImplementedException();
+    }
+
+    public void RemoveUserGroupBaseFromGroup(DT.UserGroupBase resource, DT.UserGroup group) {
+      throw new System.NotImplementedException();
+    }
+
+    public IEnumerable<DT.UserGroupBase> GetUsersAndGroups() {
+      throw new System.NotImplementedException();
+    }
+
+    public IEnumerable<DT.UserGroupMapping> GetUserGroupMapping() {
+      throw new System.NotImplementedException();
+    }
+
+    public IEnumerable<DT.Role> GetRoles() {
+      throw new System.NotImplementedException();
+    }
+
+    public DT.Role AddRole(DT.Role role) {
+      throw new System.NotImplementedException();
+    }
+
+    public void UpdateRole(DT.Role role) {
+      throw new System.NotImplementedException();
+    }
+
+    public void DeleteRole(DT.Role role) {
+      throw new System.NotImplementedException();
+    }
+
+    public IEnumerable<DT.Role> GetUserRoles(DT.User user) {
+      throw new System.NotImplementedException();
+    }
+
+    public void ReportError(DT.ClientError error) {
+      throw new System.NotImplementedException();
+    }
+
+    public IEnumerable<DT.ClientError> GetClientErrors() {
+      throw new System.NotImplementedException();
+    }
+
+    public IEnumerable<DT.ClientError> GetLastClientErrors(DateTime startDate) {
+      throw new System.NotImplementedException();
+    }
+
+    public void DeleteError(DT.ClientError error) {
+      throw new System.NotImplementedException();
+    }
   }
 }
Index: branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/Convert.cs
===================================================================
--- branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/Convert.cs	(revision 6825)
+++ branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/Convert.cs	(revision 6840)
@@ -26,5 +26,5 @@
 
 
-namespace HeuristicLab.Services.ClientManagement {
+namespace HeuristicLab.Services.Access {
   public static class Convert {
 
@@ -95,5 +95,4 @@
         Id = source.Id,
         Name = source.Name,
-
       };
     }
@@ -301,4 +300,14 @@
     }
     #endregion
+
+    #region ClientGroupMapping
+    public static DT.ClientGroupMapping ToDto(DA.ResourceResourceGroup c) {
+      return new DT.ClientGroupMapping() {
+        Child = c.ResourceId, Parent = c.ResourceGroupId
+      };
+    }
+    #endregion
+
+
   }
 }
Index: branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/DataTransfer/ClientGroupMapping.cs
===================================================================
--- branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/DataTransfer/ClientGroupMapping.cs	(revision 6840)
+++ branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/DataTransfer/ClientGroupMapping.cs	(revision 6840)
@@ -0,0 +1,33 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Runtime.Serialization;
+
+namespace HeuristicLab.Services.Access.DataTransfer {
+  [DataContract]
+  public class ClientGroupMapping {
+    [DataMember]
+    public Guid Child { get; set; }
+    [DataMember]
+    public Guid Parent { get; set; }
+  }
+}
Index: branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/DataTransfer/Resource.cs
===================================================================
--- branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/DataTransfer/Resource.cs	(revision 6825)
+++ branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/DataTransfer/Resource.cs	(revision 6840)
@@ -25,4 +25,6 @@
 namespace HeuristicLab.Services.Access.DataTransfer {
   [DataContract]
+  [KnownType(typeof(Client))]
+  [KnownType(typeof(ClientGroup))]
   public class Resource : AccessItem {
     [DataMember]
Index: branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/DataTransfer/UserGroupBase.cs
===================================================================
--- branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/DataTransfer/UserGroupBase.cs	(revision 6825)
+++ branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/DataTransfer/UserGroupBase.cs	(revision 6840)
@@ -25,4 +25,6 @@
 namespace HeuristicLab.Services.Access.DataTransfer {
   [DataContract]
+  [KnownType(typeof(User))]
+  [KnownType(typeof(UserGroup))]
   public class UserGroupBase : AccessItem {
     [DataMember]
Index: branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/DataTransfer/UserGroupMapping.cs
===================================================================
--- branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/DataTransfer/UserGroupMapping.cs	(revision 6840)
+++ branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/DataTransfer/UserGroupMapping.cs	(revision 6840)
@@ -0,0 +1,33 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Runtime.Serialization;
+
+namespace HeuristicLab.Services.Access.DataTransfer {
+  [DataContract]
+  public class UserGroupMapping {
+    [DataMember]
+    public Guid Child { get; set; }
+    [DataMember]
+    public Guid Parent { get; set; }
+  }
+}
Index: branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/HeuristicLab.Services.Access-3.3.csproj
===================================================================
--- branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/HeuristicLab.Services.Access-3.3.csproj	(revision 6825)
+++ branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/HeuristicLab.Services.Access-3.3.csproj	(revision 6840)
@@ -56,4 +56,5 @@
     <Compile Include="DataTransfer\ClientConfiguration.cs" />
     <Compile Include="DataTransfer\ClientError.cs" />
+    <Compile Include="DataTransfer\ClientGroupMapping.cs" />
     <Compile Include="DataTransfer\ClientLog.cs" />
     <Compile Include="DataTransfer\AccessItem.cs" />
@@ -68,4 +69,5 @@
     <Compile Include="DataTransfer\UserGroup.cs" />
     <Compile Include="DataTransfer\UserGroupBase.cs" />
+    <Compile Include="DataTransfer\UserGroupMapping.cs" />
     <Compile Include="IAccessService.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
Index: branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/IAccessService.cs
===================================================================
--- branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/IAccessService.cs	(revision 6825)
+++ branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/IAccessService.cs	(revision 6840)
@@ -38,5 +38,8 @@
 
     [OperationContract]
-    IEnumerable<Client> GetClients();
+    IEnumerable<Client> GetClients(IEnumerable<Guid> ids);
+
+    [OperationContract]
+    IEnumerable<Client> GetAllClients();
 
     [OperationContract]
@@ -48,4 +51,37 @@
     [OperationContract]
     void DeleteClient(Client client);
+    #endregion
+
+    #region Client Group
+    [OperationContract]
+    IEnumerable<ClientGroup> GetAllClientGroups();
+
+    [OperationContract]
+    IEnumerable<ClientGroup> GetClientGroups(IEnumerable<Guid> ids);
+
+    [OperationContract]
+    Guid AddClientGroup(ClientGroup group);
+
+    [OperationContract]
+    void UpdateClientGroup(ClientGroup group);
+
+    [OperationContract]
+    void DeleteClientGroup(ClientGroup group);
+
+    [OperationContract]
+    void AddResourceToGroup(Resource resource, UserGroup group);
+
+    [OperationContract]
+    void RemoveResourceFromGroup(Resource resource, UserGroup group);
+    #endregion
+
+    #region ClientGroupMapping
+    [OperationContract]
+    IEnumerable<ClientGroupMapping> GetClientGroupMapping();
+    #endregion
+
+    #region Resource
+    [OperationContract]
+    IEnumerable<Resource> GetResources();
     #endregion
 
@@ -61,33 +97,19 @@
 
     [OperationContract]
-    void AddClientLogEntry(ClientLog log);
+    void AddClientLog(ClientLog log);
 
     [OperationContract]
-    void DeleteClientLogEntry(ClientLog log);
-    #endregion
-
-    #region Client Group
-    [OperationContract]
-    IEnumerable<ClientGroup> GetClientGroups();
-
-    [OperationContract]
-    IEnumerable<ClientGroup> GetParentGroups(Guid id);
-
-    [OperationContract]
-    Guid AddClientGroup(ClientGroup group);
-
-    [OperationContract]
-    void UpdateClientGroup(ClientGroup group);
-
-    [OperationContract]
-    void DeleteClientGroup(ClientGroup group);
+    void DeleteClientLog(ClientLog log);
     #endregion
 
     #region User
     [OperationContract]
-    void Login();
+    User Login();
 
     [OperationContract]
-    IEnumerable<User> GetUsers();
+    IEnumerable<User> GetAllUsers();
+
+    [OperationContract]
+    IEnumerable<User> GetUsers(IEnumerable<User> ids);
 
     [OperationContract]
@@ -110,4 +132,37 @@
     #endregion
 
+    #region UserGroup
+    [OperationContract]
+    IEnumerable<UserGroup> GetAllUserGroups();
+
+    [OperationContract]
+    IEnumerable<UserGroup> GetUserGroups(IEnumerable<Guid> ids);
+
+    [OperationContract]
+    UserGroup AddUserGroup(UserGroup group);
+
+    [OperationContract]
+    void UpdateUserGroup(UserGroup group);
+
+    [OperationContract]
+    void DeleteUserGroup(UserGroup group);
+
+    [OperationContract]
+    void AddUserGroupBaseToGroup(UserGroupBase resource, UserGroup group);
+
+    [OperationContract]
+    void RemoveUserGroupBaseFromGroup(UserGroupBase resource, UserGroup group);
+    #endregion
+
+    #region UserGroupBase
+    [OperationContract]
+    IEnumerable<UserGroupBase> GetUsersAndGroups();
+    #endregion
+
+    #region UserGroupMapping
+    [OperationContract]
+    IEnumerable<UserGroupMapping> GetUserGroupMapping();
+    #endregion
+
     #region Role
     [OperationContract]
@@ -127,16 +182,16 @@
     #endregion
 
-    #region UserGroup
+    #region ClientError
     [OperationContract]
-    IEnumerable<UserGroup> GetUserGroups();
+    void ReportError(ClientError error);
 
     [OperationContract]
-    UserGroup AddUserGroup(UserGroup group);
+    IEnumerable<ClientError> GetClientErrors();
 
     [OperationContract]
-    void UpdateUserGroup(UserGroup group);
+    IEnumerable<ClientError> GetLastClientErrors(DateTime startDate);
 
     [OperationContract]
-    void DeleteUserGroup(UserGroup group);
+    void DeleteError(ClientError error);
     #endregion
   }
