Index: /branches/UserManagement/HeuristicLab.Services.Authentication.DataAccess/HeuristicLab.Services.Authentication.DataAccess.csproj
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.DataAccess/HeuristicLab.Services.Authentication.DataAccess.csproj	(revision 4646)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.DataAccess/HeuristicLab.Services.Authentication.DataAccess.csproj	(revision 4647)
@@ -57,4 +57,9 @@
       <DependentUpon>UserManagement.dbml</DependentUpon>
     </Compile>
+    <Compile Include="_HeuristicLab_AuthenticationDataSet.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>_HeuristicLab_AuthenticationDataSet.xsd</DependentUpon>
+    </Compile>
   </ItemGroup>
   <ItemGroup>
@@ -68,4 +73,15 @@
       <LastGenOutput>UserManagement.designer.cs</LastGenOutput>
       <SubType>Designer</SubType>
+    </None>
+    <None Include="_HeuristicLab_AuthenticationDataSet.xsc">
+      <DependentUpon>_HeuristicLab_AuthenticationDataSet.xsd</DependentUpon>
+    </None>
+    <None Include="_HeuristicLab_AuthenticationDataSet.xsd">
+      <Generator>MSDataSetGenerator</Generator>
+      <LastGenOutput>_HeuristicLab_AuthenticationDataSet.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </None>
+    <None Include="_HeuristicLab_AuthenticationDataSet.xss">
+      <DependentUpon>_HeuristicLab_AuthenticationDataSet.xsd</DependentUpon>
     </None>
   </ItemGroup>
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.DataAccess/UserManagement.dbml
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.DataAccess/UserManagement.dbml	(revision 4646)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.DataAccess/UserManagement.dbml	(revision 4647)
@@ -148,3 +148,100 @@
     <Return Type="System.Int32" />
   </Function>
+  <Function Name="dbo.aspnet_Users_CreateUser" Method="aspnet_Users_CreateUser">
+    <Parameter Name="ApplicationId" Parameter="applicationId" Type="System.Guid" DbType="UniqueIdentifier" />
+    <Parameter Name="UserName" Parameter="userName" Type="System.String" DbType="NVarChar(256)" />
+    <Parameter Name="IsUserAnonymous" Parameter="isUserAnonymous" Type="System.Boolean" DbType="Bit" />
+    <Parameter Name="LastActivityDate" Parameter="lastActivityDate" Type="System.DateTime" DbType="DateTime" />
+    <Parameter Name="UserId" Parameter="userId" Type="System.Guid" DbType="UniqueIdentifier" Direction="InOut" />
+    <Return Type="System.Int32" />
+  </Function>
+  <Function Name="dbo.aspnet_UsersInRoles_AddUsersToRoles" Method="aspnet_UsersInRoles_AddUsersToRoles">
+    <Parameter Name="ApplicationName" Parameter="applicationName" Type="System.String" DbType="NVarChar(256)" />
+    <Parameter Name="UserNames" Parameter="userNames" Type="System.String" DbType="NVarChar(4000)" />
+    <Parameter Name="RoleNames" Parameter="roleNames" Type="System.String" DbType="NVarChar(4000)" />
+    <Parameter Name="CurrentTimeUtc" Parameter="currentTimeUtc" Type="System.DateTime" DbType="DateTime" />
+    <ElementType Name="aspnet_UsersInRoles_AddUsersToRolesResult">
+      <Column Name="Name" Type="System.String" DbType="NVarChar(256) NOT NULL" CanBeNull="false" />
+    </ElementType>
+  </Function>
+  <Function Name="dbo.aspnet_UsersInRoles_RemoveUsersFromRoles" Method="aspnet_UsersInRoles_RemoveUsersFromRoles">
+    <Parameter Name="ApplicationName" Parameter="applicationName" Type="System.String" DbType="NVarChar(256)" />
+    <Parameter Name="UserNames" Parameter="userNames" Type="System.String" DbType="NVarChar(4000)" />
+    <Parameter Name="RoleNames" Parameter="roleNames" Type="System.String" DbType="NVarChar(4000)" />
+    <ElementType Name="aspnet_UsersInRoles_RemoveUsersFromRolesResult">
+      <Column Name="" Member="Column1" Type="System.String" DbType="NVarChar(1) NOT NULL" CanBeNull="false" />
+      <Column Name="Name" Type="System.String" DbType="NVarChar(256) NOT NULL" CanBeNull="false" />
+    </ElementType>
+  </Function>
+  <Function Name="dbo.aspnet_UsersInRoles_IsUserInRole" Method="aspnet_UsersInRoles_IsUserInRole">
+    <Parameter Name="ApplicationName" Parameter="applicationName" Type="System.String" DbType="NVarChar(256)" />
+    <Parameter Name="UserName" Parameter="userName" Type="System.String" DbType="NVarChar(256)" />
+    <Parameter Name="RoleName" Parameter="roleName" Type="System.String" DbType="NVarChar(256)" />
+    <Return Type="System.Int32" />
+  </Function>
+  <Function Name="dbo.aspnet_UsersInRoles_GetUsersInRoles" Method="aspnet_UsersInRoles_GetUsersInRoles">
+    <Parameter Name="ApplicationName" Parameter="applicationName" Type="System.String" DbType="NVarChar(256)" />
+    <Parameter Name="RoleName" Parameter="roleName" Type="System.String" DbType="NVarChar(256)" />
+    <ElementType Name="aspnet_UsersInRoles_GetUsersInRolesResult">
+      <Column Name="UserName" Type="System.String" DbType="NVarChar(256) NOT NULL" CanBeNull="false" />
+    </ElementType>
+  </Function>
+  <Function Name="dbo.aspnet_UsersInRoles_GetRolesForUser" Method="aspnet_UsersInRoles_GetRolesForUser">
+    <Parameter Name="ApplicationName" Parameter="applicationName" Type="System.String" DbType="NVarChar(256)" />
+    <Parameter Name="UserName" Parameter="userName" Type="System.String" DbType="NVarChar(256)" />
+    <ElementType Name="aspnet_UsersInRoles_GetRolesForUserResult">
+      <Column Name="RoleName" Type="System.String" DbType="NVarChar(256) NOT NULL" CanBeNull="false" />
+    </ElementType>
+  </Function>
+  <Function Name="dbo.aspnet_UsersInRoles_FindUsersInRole" Method="aspnet_UsersInRoles_FindUsersInRole">
+    <Parameter Name="ApplicationName" Parameter="applicationName" Type="System.String" DbType="NVarChar(256)" />
+    <Parameter Name="RoleName" Parameter="roleName" Type="System.String" DbType="NVarChar(256)" />
+    <Parameter Name="UserNameToMatch" Parameter="userNameToMatch" Type="System.String" DbType="NVarChar(256)" />
+    <ElementType Name="aspnet_UsersInRoles_FindUsersInRoleResult">
+      <Column Name="UserName" Type="System.String" DbType="NVarChar(256) NOT NULL" CanBeNull="false" />
+    </ElementType>
+  </Function>
+  <Function Name="dbo.aspnet_Roles_CreateRole" Method="aspnet_Roles_CreateRole">
+    <Parameter Name="ApplicationName" Parameter="applicationName" Type="System.String" DbType="NVarChar(256)" />
+    <Parameter Name="RoleName" Parameter="roleName" Type="System.String" DbType="NVarChar(256)" />
+    <Return Type="System.Int32" />
+  </Function>
+  <Function Name="dbo.aspnet_Roles_DeleteRole" Method="aspnet_Roles_DeleteRole">
+    <Parameter Name="ApplicationName" Parameter="applicationName" Type="System.String" DbType="NVarChar(256)" />
+    <Parameter Name="RoleName" Parameter="roleName" Type="System.String" DbType="NVarChar(256)" />
+    <Parameter Name="DeleteOnlyIfRoleIsEmpty" Parameter="deleteOnlyIfRoleIsEmpty" Type="System.Boolean" DbType="Bit" />
+    <Return Type="System.Int32" />
+  </Function>
+  <Function Name="dbo.aspnet_Applications_CreateApplication" Method="aspnet_Applications_CreateApplication">
+    <Parameter Name="ApplicationName" Parameter="applicationName" Type="System.String" DbType="NVarChar(256)" />
+    <Parameter Name="ApplicationId" Parameter="applicationId" Type="System.Guid" DbType="UniqueIdentifier" Direction="InOut" />
+    <Return Type="System.Int32" />
+  </Function>
+  <Function Name="dbo.aspnet_Roles_RoleExists" Method="aspnet_Roles_RoleExists">
+    <Parameter Name="ApplicationName" Parameter="applicationName" Type="System.String" DbType="NVarChar(256)" />
+    <Parameter Name="RoleName" Parameter="roleName" Type="System.String" DbType="NVarChar(256)" />
+    <Return Type="System.Int32" />
+  </Function>
+  <Function Name="dbo.aspnet_Roles_GetAllRoles" Method="aspnet_Roles_GetAllRoles">
+    <Parameter Name="ApplicationName" Parameter="applicationName" Type="System.String" DbType="NVarChar(256)" />
+    <ElementType Name="aspnet_Roles_GetAllRolesResult">
+      <Column Name="RoleName" Type="System.String" DbType="NVarChar(256) NOT NULL" CanBeNull="false" />
+    </ElementType>
+  </Function>
+  <Function Name="dbo.aspnet_Membership_CreateUser" Method="aspnet_Membership_CreateUser">
+    <Parameter Name="ApplicationName" Parameter="applicationName" Type="System.String" DbType="NVarChar(256)" />
+    <Parameter Name="UserName" Parameter="userName" Type="System.String" DbType="NVarChar(256)" />
+    <Parameter Name="Password" Parameter="password" Type="System.String" DbType="NVarChar(128)" />
+    <Parameter Name="PasswordSalt" Parameter="passwordSalt" Type="System.String" DbType="NVarChar(128)" />
+    <Parameter Name="Email" Parameter="email" Type="System.String" DbType="NVarChar(256)" />
+    <Parameter Name="PasswordQuestion" Parameter="passwordQuestion" Type="System.String" DbType="NVarChar(256)" />
+    <Parameter Name="PasswordAnswer" Parameter="passwordAnswer" Type="System.String" DbType="NVarChar(128)" />
+    <Parameter Name="IsApproved" Parameter="isApproved" Type="System.Boolean" DbType="Bit" />
+    <Parameter Name="CurrentTimeUtc" Parameter="currentTimeUtc" Type="System.DateTime" DbType="DateTime" />
+    <Parameter Name="CreateDate" Parameter="createDate" Type="System.DateTime" DbType="DateTime" />
+    <Parameter Name="UniqueEmail" Parameter="uniqueEmail" Type="System.Int32" DbType="Int" />
+    <Parameter Name="PasswordFormat" Parameter="passwordFormat" Type="System.Int32" DbType="Int" />
+    <Parameter Name="UserId" Parameter="userId" Type="System.Guid" DbType="UniqueIdentifier" Direction="InOut" />
+    <Return Type="System.Int32" />
+  </Function>
 </Database>
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.DataAccess/UserManagement.dbml.layout
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.DataAccess/UserManagement.dbml.layout	(revision 4646)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.DataAccess/UserManagement.dbml.layout	(revision 4647)
@@ -1,19 +1,19 @@
 ﻿<?xml version="1.0" encoding="utf-8"?>
-<ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 11, 14.875" name="UserManagement">
+<ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 13.375, 11.75" name="UserManagement">
   <DataContextMoniker Name="/UserManagementDataContext" />
   <nestedChildShapes>
-    <classShape Id="ec805621-974f-4416-9b33-1f52c9efaa02" absoluteBounds="0.5, 0.5, 2, 1.5785953776041666">
+    <classShape Id="ec805621-974f-4416-9b33-1f52c9efaa02" absoluteBounds="1.875, 6, 2, 1.5785953776041666">
       <DataClassMoniker Name="/UserManagementDataContext/aspnet_Application" />
       <nestedChildShapes>
-        <elementListCompartment Id="d2f5e07d-74d6-4c49-808d-d6ea4f17d8fc" absoluteBounds="0.515, 0.96, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="d2f5e07d-74d6-4c49-808d-d6ea4f17d8fc" absoluteBounds="1.8899999999999997, 6.46, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <classShape Id="7dc71a3b-61f9-453c-8e9b-ebf950468436" absoluteBounds="3.625, 1.125, 2, 4.8477197265625">
+    <classShape Id="7dc71a3b-61f9-453c-8e9b-ebf950468436" absoluteBounds="4.625, 0.5, 2, 4.8477197265625">
       <DataClassMoniker Name="/UserManagementDataContext/aspnet_Membership" />
       <nestedChildShapes>
-        <elementListCompartment Id="4245b681-0b9d-40fd-bda3-b6fc3aadf805" absoluteBounds="3.64, 1.585, 1.9700000000000002, 4.2877197265625" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="4245b681-0b9d-40fd-bda3-b6fc3aadf805" absoluteBounds="4.6400000000000006, 0.96, 1.9700000000000002, 4.2877197265625" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <associationConnector edgePoints="[(2.5 : 1.60179768880208); (2.66666666666667 : 1.60179768880208 : JumpStart); (2.83333333333333 : 1.60179768880208 : JumpEnd); (3.625 : 1.60179768880208)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(3.78125 : 6); (3.78125 : 2.56814697265625); (4.625 : 2.56814697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/UserManagementDataContext/aspnet_Application/aspnet_Application_aspnet_Membership" />
       <nodes>
@@ -22,11 +22,11 @@
       </nodes>
     </associationConnector>
-    <classShape Id="7343514d-b96d-43be-aac1-1642639dfda8" absoluteBounds="7.375, 1, 2, 1.5785953776041666">
+    <classShape Id="7343514d-b96d-43be-aac1-1642639dfda8" absoluteBounds="1.5, 3.125, 2, 1.5785953776041666">
       <DataClassMoniker Name="/UserManagementDataContext/aspnet_Path" />
       <nestedChildShapes>
-        <elementListCompartment Id="0b555909-5553-437e-8fb3-d8bb04dd2960" absoluteBounds="7.39, 1.46, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="0b555909-5553-437e-8fb3-d8bb04dd2960" absoluteBounds="1.5149999999999997, 3.585, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <associationConnector edgePoints="[(2.5 : 1.03125); (2.66666666666667 : 1.03125 : JumpStart); (2.83333333333333 : 1.03125 : JumpEnd); (5.79166666666667 : 1.03125 : JumpStart); (5.95833333333333 : 1.03125 : JumpEnd); (7.375 : 1.03125)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(2.6875 : 6); (2.6875 : 4.70359537760417)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/UserManagementDataContext/aspnet_Application/aspnet_Application_aspnet_Path" />
       <nodes>
@@ -35,11 +35,11 @@
       </nodes>
     </associationConnector>
-    <classShape Id="3b521864-bc4c-4283-8733-af46ed4fe8a7" absoluteBounds="0.5, 2.75, 2, 1.3862939453125">
+    <classShape Id="3b521864-bc4c-4283-8733-af46ed4fe8a7" absoluteBounds="1.625, 0.625, 2, 1.3862939453125">
       <DataClassMoniker Name="/UserManagementDataContext/aspnet_PersonalizationAllUser" />
       <nestedChildShapes>
-        <elementListCompartment Id="508a8e64-87d9-40bc-8fdb-f1cf0f62124c" absoluteBounds="0.515, 3.21, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="508a8e64-87d9-40bc-8fdb-f1cf0f62124c" absoluteBounds="1.6400000000000001, 1.085, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <associationConnector edgePoints="[(7.375 : 1.83617468880208); (5.875 : 1.83617468880208); (5.875 : 0.625); (2.75 : 0.625); (2.75 : 2.32859537760417); (1.5 : 2.32859537760417); (1.5 : 2.75)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(3.05292168109001 : 3.125); (3.05292168109001 : 2.0112939453125)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/UserManagementDataContext/aspnet_Path/aspnet_Path_aspnet_PersonalizationAllUser" />
       <nodes>
@@ -48,11 +48,11 @@
       </nodes>
     </associationConnector>
-    <classShape Id="5013ff3a-8cce-4550-ac77-e9cee0ddc9ba" absoluteBounds="7.75, 3.875, 2, 1.7708968098958331">
+    <classShape Id="5013ff3a-8cce-4550-ac77-e9cee0ddc9ba" absoluteBounds="11.125, 1.75, 2, 1.7708968098958331">
       <DataClassMoniker Name="/UserManagementDataContext/aspnet_PersonalizationPerUser" />
       <nestedChildShapes>
-        <elementListCompartment Id="3c2e4362-9781-4d55-af9c-599ad3861a16" absoluteBounds="7.765, 4.335, 1.9700000000000002, 1.2108968098958333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="3c2e4362-9781-4d55-af9c-599ad3861a16" absoluteBounds="11.14, 2.21, 1.9700000000000002, 1.2108968098958333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <associationConnector edgePoints="[(8.9375 : 2.57859537760417); (8.9375 : 3.875)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(3.5 : 3.91429768880208); (4.375 : 3.91429768880208); (4.375 : 5.5977197265625); (7.875 : 5.5977197265625); (7.875 : 3.875); (12.39062575 : 3.875); (12.39062575 : 3.52089680989583)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/UserManagementDataContext/aspnet_Path/aspnet_Path_aspnet_PersonalizationPerUser" />
       <nodes>
@@ -61,17 +61,17 @@
       </nodes>
     </associationConnector>
-    <classShape Id="86d1546c-0a9b-4dd7-844e-6eb30600f1b2" absoluteBounds="0.5, 5, 2, 1.7708968098958331">
+    <classShape Id="86d1546c-0a9b-4dd7-844e-6eb30600f1b2" absoluteBounds="8, 0.5, 2, 1.7708968098958331">
       <DataClassMoniker Name="/UserManagementDataContext/aspnet_Profile" />
       <nestedChildShapes>
-        <elementListCompartment Id="75b89f84-1a81-4940-8c47-c3935a3bc84d" absoluteBounds="0.515, 5.46, 1.9700000000000002, 1.2108968098958333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="75b89f84-1a81-4940-8c47-c3935a3bc84d" absoluteBounds="8.015, 0.96, 1.9700000000000002, 1.2108968098958333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <classShape Id="833e2796-ac5a-4a62-b3a1-6cfd97c9a7b1" absoluteBounds="8, 6.375, 2, 1.7708968098958331">
+    <classShape Id="833e2796-ac5a-4a62-b3a1-6cfd97c9a7b1" absoluteBounds="3.625, 9, 2, 1.7708968098958331">
       <DataClassMoniker Name="/UserManagementDataContext/aspnet_Role" />
       <nestedChildShapes>
-        <elementListCompartment Id="4ebc7fb9-2342-4359-950b-d59908adb887" absoluteBounds="8.015, 6.835, 1.9700000000000002, 1.2108968098958333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="4ebc7fb9-2342-4359-950b-d59908adb887" absoluteBounds="3.6400000000000006, 9.46, 1.9700000000000002, 1.2108968098958333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <associationConnector edgePoints="[(2.5 : 0.78125); (9.90625 : 0.78125); (9.90625 : 6.375)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(2.7499995 : 7.57859537760417); (2.7499995 : 9.88544840494792); (3.625 : 9.88544840494792)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/UserManagementDataContext/aspnet_Application/aspnet_Application_aspnet_Role" />
       <nodes>
@@ -80,17 +80,17 @@
       </nodes>
     </associationConnector>
-    <classShape Id="da1e6fa8-2149-42f4-a56c-f492cd62deb6" absoluteBounds="5, 6.75, 2, 1.3862939453125">
+    <classShape Id="da1e6fa8-2149-42f4-a56c-f492cd62deb6" absoluteBounds="6.625, 10.125, 2, 1.3862939453125">
       <DataClassMoniker Name="/UserManagementDataContext/aspnet_SchemaVersion" />
       <nestedChildShapes>
-        <elementListCompartment Id="7a2a020f-f4bb-490e-9a84-81f0f66b5e68" absoluteBounds="5.015, 7.21, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="7a2a020f-f4bb-490e-9a84-81f0f66b5e68" absoluteBounds="6.6400000000000006, 10.585, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <classShape Id="6bceff2f-2d6b-4f24-b50d-2296ff7f62c3" absoluteBounds="0.75, 8.25, 2, 2.1554996744791666">
+    <classShape Id="6bceff2f-2d6b-4f24-b50d-2296ff7f62c3" absoluteBounds="8.125, 4.125, 2, 2.1554996744791666">
       <DataClassMoniker Name="/UserManagementDataContext/aspnet_User" />
       <nestedChildShapes>
-        <elementListCompartment Id="bf2f1444-f051-4d39-9055-c21643a53875" absoluteBounds="0.76500000000000012, 8.71, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="bf2f1444-f051-4d39-9055-c21643a53875" absoluteBounds="8.14, 4.5850000000000009, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <associationConnector edgePoints="[(2.65625 : 8.25); (2.65625 : 4.56814697265625); (3.04166666666667 : 4.56814697265625 : JumpStart); (3.20833333333333 : 4.56814697265625 : JumpEnd); (3.625 : 4.56814697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+    <associationConnector edgePoints="[(8.125 : 4.73635986328125); (6.625 : 4.73635986328125)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/UserManagementDataContext/aspnet_User/aspnet_User_aspnet_Membership" />
       <nodes>
@@ -99,5 +99,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(2.75 : 9.32774983723958); (3.54166666666667 : 9.32774983723958 : JumpStart); (3.70833333333333 : 9.32774983723958 : JumpEnd); (7.84375 : 9.32774983723958); (7.84375 : 5.64589680989583)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+    <associationConnector edgePoints="[(10.125 : 5.20274983723958); (11.5937475 : 5.20274983723958); (11.5937475 : 3.52089680989583)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/UserManagementDataContext/aspnet_User/aspnet_User_aspnet_PersonalizationPerUser" />
       <nodes>
@@ -106,5 +106,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(1.625 : 8.25); (1.625 : 6.77089680989583)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+    <associationConnector edgePoints="[(9.0625 : 4.125); (9.0625 : 2.27089680989583)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/UserManagementDataContext/aspnet_User/aspnet_User_aspnet_Profile" />
       <nodes>
@@ -113,5 +113,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(2.5 : 2.07859537760417); (3.125 : 2.70359537760417); (3.125 : 7.875); (2.75 : 8.25153746153846)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(3.875 : 6.96080002604167); (9.2500025 : 6.96080002604167); (9.2500025 : 6.28049967447917)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/UserManagementDataContext/aspnet_Application/aspnet_Application_aspnet_User" />
       <nodes>
@@ -120,11 +120,11 @@
       </nodes>
     </associationConnector>
-    <classShape Id="a25c9c99-735f-4294-aabd-ba04c3f98575" absoluteBounds="1.25, 12.375, 2, 1.1939925130208333">
+    <classShape Id="a25c9c99-735f-4294-aabd-ba04c3f98575" absoluteBounds="6.5, 8.25, 2, 1.1939925130208333">
       <DataClassMoniker Name="/UserManagementDataContext/aspnet_UsersInRole" />
       <nestedChildShapes>
-        <elementListCompartment Id="f223e83f-c7c9-4564-8465-9e039f273520" absoluteBounds="1.2650000000000001, 12.835, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="f223e83f-c7c9-4564-8465-9e039f273520" absoluteBounds="6.5150000000000006, 8.71, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <associationConnector edgePoints="[(8 : 8.14589680989583); (7.90267556509888 : 8.24322124479695 : JumpStart); (7.78482443490112 : 8.36107237499471 : JumpEnd); (7.625 : 8.52089680989583); (3.625 : 8.52089680989583); (3.625 : 12); (3.25 : 12.375)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(5.625 : 9.22199625651042); (6.5 : 9.22199625651042)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/UserManagementDataContext/aspnet_Role/aspnet_Role_aspnet_UsersInRole" />
       <nodes>
@@ -133,5 +133,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(2 : 10.4054996744792); (2 : 12.375)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+    <associationConnector edgePoints="[(8.3125 : 6.28049967447917); (8.3125 : 8.25)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/UserManagementDataContext/aspnet_User/aspnet_User_aspnet_UsersInRole" />
       <nodes>
@@ -140,8 +140,8 @@
       </nodes>
     </associationConnector>
-    <classShape Id="c85c3936-32dd-417e-a0af-7a03fb14cc36" absoluteBounds="7.375, 10.875, 2, 3.6939111328124996">
+    <classShape Id="c85c3936-32dd-417e-a0af-7a03fb14cc36" absoluteBounds="10.25, 7.375, 2, 3.6939111328124996">
       <DataClassMoniker Name="/UserManagementDataContext/aspnet_WebEvent_Event" />
       <nestedChildShapes>
-        <elementListCompartment Id="6a3d388c-ec23-47c6-a139-35716577f2d8" absoluteBounds="7.39, 11.335, 1.9700000000000002, 3.1339111328125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="6a3d388c-ec23-47c6-a139-35716577f2d8" absoluteBounds="10.265, 7.8350000000000009, 1.9700000000000002, 3.1339111328125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.DataAccess/UserManagement.designer.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.DataAccess/UserManagement.designer.cs	(revision 4646)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.DataAccess/UserManagement.designer.cs	(revision 4647)
@@ -189,4 +189,98 @@
 			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), applicationName, userName, tablesToDeleteFrom, numTablesDeletedFrom);
 			numTablesDeletedFrom = ((System.Nullable<int>)(result.GetParameterValue(3)));
+			return ((int)(result.ReturnValue));
+		}
+		
+		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.aspnet_Users_CreateUser")]
+		public int aspnet_Users_CreateUser([global::System.Data.Linq.Mapping.ParameterAttribute(Name="ApplicationId", DbType="UniqueIdentifier")] System.Nullable<System.Guid> applicationId, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="UserName", DbType="NVarChar(256)")] string userName, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="IsUserAnonymous", DbType="Bit")] System.Nullable<bool> isUserAnonymous, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="LastActivityDate", DbType="DateTime")] System.Nullable<System.DateTime> lastActivityDate, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="UserId", DbType="UniqueIdentifier")] ref System.Nullable<System.Guid> userId)
+		{
+			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), applicationId, userName, isUserAnonymous, lastActivityDate, userId);
+			userId = ((System.Nullable<System.Guid>)(result.GetParameterValue(4)));
+			return ((int)(result.ReturnValue));
+		}
+		
+		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.aspnet_UsersInRoles_AddUsersToRoles")]
+		public ISingleResult<aspnet_UsersInRoles_AddUsersToRolesResult> aspnet_UsersInRoles_AddUsersToRoles([global::System.Data.Linq.Mapping.ParameterAttribute(Name="ApplicationName", DbType="NVarChar(256)")] string applicationName, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="UserNames", DbType="NVarChar(4000)")] string userNames, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="RoleNames", DbType="NVarChar(4000)")] string roleNames, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="CurrentTimeUtc", DbType="DateTime")] System.Nullable<System.DateTime> currentTimeUtc)
+		{
+			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), applicationName, userNames, roleNames, currentTimeUtc);
+			return ((ISingleResult<aspnet_UsersInRoles_AddUsersToRolesResult>)(result.ReturnValue));
+		}
+		
+		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.aspnet_UsersInRoles_RemoveUsersFromRoles")]
+		public ISingleResult<aspnet_UsersInRoles_RemoveUsersFromRolesResult> aspnet_UsersInRoles_RemoveUsersFromRoles([global::System.Data.Linq.Mapping.ParameterAttribute(Name="ApplicationName", DbType="NVarChar(256)")] string applicationName, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="UserNames", DbType="NVarChar(4000)")] string userNames, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="RoleNames", DbType="NVarChar(4000)")] string roleNames)
+		{
+			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), applicationName, userNames, roleNames);
+			return ((ISingleResult<aspnet_UsersInRoles_RemoveUsersFromRolesResult>)(result.ReturnValue));
+		}
+		
+		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.aspnet_UsersInRoles_IsUserInRole")]
+		public int aspnet_UsersInRoles_IsUserInRole([global::System.Data.Linq.Mapping.ParameterAttribute(Name="ApplicationName", DbType="NVarChar(256)")] string applicationName, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="UserName", DbType="NVarChar(256)")] string userName, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="RoleName", DbType="NVarChar(256)")] string roleName)
+		{
+			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), applicationName, userName, roleName);
+			return ((int)(result.ReturnValue));
+		}
+		
+		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.aspnet_UsersInRoles_GetUsersInRoles")]
+		public ISingleResult<aspnet_UsersInRoles_GetUsersInRolesResult> aspnet_UsersInRoles_GetUsersInRoles([global::System.Data.Linq.Mapping.ParameterAttribute(Name="ApplicationName", DbType="NVarChar(256)")] string applicationName, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="RoleName", DbType="NVarChar(256)")] string roleName)
+		{
+			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), applicationName, roleName);
+			return ((ISingleResult<aspnet_UsersInRoles_GetUsersInRolesResult>)(result.ReturnValue));
+		}
+		
+		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.aspnet_UsersInRoles_GetRolesForUser")]
+		public ISingleResult<aspnet_UsersInRoles_GetRolesForUserResult> aspnet_UsersInRoles_GetRolesForUser([global::System.Data.Linq.Mapping.ParameterAttribute(Name="ApplicationName", DbType="NVarChar(256)")] string applicationName, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="UserName", DbType="NVarChar(256)")] string userName)
+		{
+			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), applicationName, userName);
+			return ((ISingleResult<aspnet_UsersInRoles_GetRolesForUserResult>)(result.ReturnValue));
+		}
+		
+		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.aspnet_UsersInRoles_FindUsersInRole")]
+		public ISingleResult<aspnet_UsersInRoles_FindUsersInRoleResult> aspnet_UsersInRoles_FindUsersInRole([global::System.Data.Linq.Mapping.ParameterAttribute(Name="ApplicationName", DbType="NVarChar(256)")] string applicationName, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="RoleName", DbType="NVarChar(256)")] string roleName, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="UserNameToMatch", DbType="NVarChar(256)")] string userNameToMatch)
+		{
+			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), applicationName, roleName, userNameToMatch);
+			return ((ISingleResult<aspnet_UsersInRoles_FindUsersInRoleResult>)(result.ReturnValue));
+		}
+		
+		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.aspnet_Roles_CreateRole")]
+		public int aspnet_Roles_CreateRole([global::System.Data.Linq.Mapping.ParameterAttribute(Name="ApplicationName", DbType="NVarChar(256)")] string applicationName, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="RoleName", DbType="NVarChar(256)")] string roleName)
+		{
+			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), applicationName, roleName);
+			return ((int)(result.ReturnValue));
+		}
+		
+		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.aspnet_Roles_DeleteRole")]
+		public int aspnet_Roles_DeleteRole([global::System.Data.Linq.Mapping.ParameterAttribute(Name="ApplicationName", DbType="NVarChar(256)")] string applicationName, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="RoleName", DbType="NVarChar(256)")] string roleName, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="DeleteOnlyIfRoleIsEmpty", DbType="Bit")] System.Nullable<bool> deleteOnlyIfRoleIsEmpty)
+		{
+			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), applicationName, roleName, deleteOnlyIfRoleIsEmpty);
+			return ((int)(result.ReturnValue));
+		}
+		
+		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.aspnet_Applications_CreateApplication")]
+		public int aspnet_Applications_CreateApplication([global::System.Data.Linq.Mapping.ParameterAttribute(Name="ApplicationName", DbType="NVarChar(256)")] string applicationName, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="ApplicationId", DbType="UniqueIdentifier")] ref System.Nullable<System.Guid> applicationId)
+		{
+			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), applicationName, applicationId);
+			applicationId = ((System.Nullable<System.Guid>)(result.GetParameterValue(1)));
+			return ((int)(result.ReturnValue));
+		}
+		
+		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.aspnet_Roles_RoleExists")]
+		public int aspnet_Roles_RoleExists([global::System.Data.Linq.Mapping.ParameterAttribute(Name="ApplicationName", DbType="NVarChar(256)")] string applicationName, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="RoleName", DbType="NVarChar(256)")] string roleName)
+		{
+			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), applicationName, roleName);
+			return ((int)(result.ReturnValue));
+		}
+		
+		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.aspnet_Roles_GetAllRoles")]
+		public ISingleResult<aspnet_Roles_GetAllRolesResult> aspnet_Roles_GetAllRoles([global::System.Data.Linq.Mapping.ParameterAttribute(Name="ApplicationName", DbType="NVarChar(256)")] string applicationName)
+		{
+			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), applicationName);
+			return ((ISingleResult<aspnet_Roles_GetAllRolesResult>)(result.ReturnValue));
+		}
+		
+		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.aspnet_Membership_CreateUser")]
+		public int aspnet_Membership_CreateUser([global::System.Data.Linq.Mapping.ParameterAttribute(Name="ApplicationName", DbType="NVarChar(256)")] string applicationName, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="UserName", DbType="NVarChar(256)")] string userName, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="Password", DbType="NVarChar(128)")] string password, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="PasswordSalt", DbType="NVarChar(128)")] string passwordSalt, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="Email", DbType="NVarChar(256)")] string email, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="PasswordQuestion", DbType="NVarChar(256)")] string passwordQuestion, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="PasswordAnswer", DbType="NVarChar(128)")] string passwordAnswer, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="IsApproved", DbType="Bit")] System.Nullable<bool> isApproved, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="CurrentTimeUtc", DbType="DateTime")] System.Nullable<System.DateTime> currentTimeUtc, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="CreateDate", DbType="DateTime")] System.Nullable<System.DateTime> createDate, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="UniqueEmail", DbType="Int")] System.Nullable<int> uniqueEmail, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="PasswordFormat", DbType="Int")] System.Nullable<int> passwordFormat, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="UserId", DbType="UniqueIdentifier")] ref System.Nullable<System.Guid> userId)
+		{
+			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), applicationName, userName, password, passwordSalt, email, passwordQuestion, passwordAnswer, isApproved, currentTimeUtc, createDate, uniqueEmail, passwordFormat, userId);
+			userId = ((System.Nullable<System.Guid>)(result.GetParameterValue(12)));
 			return ((int)(result.ReturnValue));
 		}
@@ -3157,4 +3251,178 @@
 		}
 	}
+	
+	public partial class aspnet_UsersInRoles_AddUsersToRolesResult
+	{
+		
+		private string _Name;
+		
+		public aspnet_UsersInRoles_AddUsersToRolesResult()
+		{
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(256) NOT NULL", CanBeNull=false)]
+		public string Name
+		{
+			get
+			{
+				return this._Name;
+			}
+			set
+			{
+				if ((this._Name != value))
+				{
+					this._Name = value;
+				}
+			}
+		}
+	}
+	
+	public partial class aspnet_UsersInRoles_RemoveUsersFromRolesResult
+	{
+		
+		private string _Column1;
+		
+		private string _Name;
+		
+		public aspnet_UsersInRoles_RemoveUsersFromRolesResult()
+		{
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="", Storage="_Column1", DbType="NVarChar(1) NOT NULL", CanBeNull=false)]
+		public string Column1
+		{
+			get
+			{
+				return this._Column1;
+			}
+			set
+			{
+				if ((this._Column1 != value))
+				{
+					this._Column1 = value;
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(256) NOT NULL", CanBeNull=false)]
+		public string Name
+		{
+			get
+			{
+				return this._Name;
+			}
+			set
+			{
+				if ((this._Name != value))
+				{
+					this._Name = value;
+				}
+			}
+		}
+	}
+	
+	public partial class aspnet_UsersInRoles_GetUsersInRolesResult
+	{
+		
+		private string _UserName;
+		
+		public aspnet_UsersInRoles_GetUsersInRolesResult()
+		{
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserName", DbType="NVarChar(256) NOT NULL", CanBeNull=false)]
+		public string UserName
+		{
+			get
+			{
+				return this._UserName;
+			}
+			set
+			{
+				if ((this._UserName != value))
+				{
+					this._UserName = value;
+				}
+			}
+		}
+	}
+	
+	public partial class aspnet_UsersInRoles_GetRolesForUserResult
+	{
+		
+		private string _RoleName;
+		
+		public aspnet_UsersInRoles_GetRolesForUserResult()
+		{
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RoleName", DbType="NVarChar(256) NOT NULL", CanBeNull=false)]
+		public string RoleName
+		{
+			get
+			{
+				return this._RoleName;
+			}
+			set
+			{
+				if ((this._RoleName != value))
+				{
+					this._RoleName = value;
+				}
+			}
+		}
+	}
+	
+	public partial class aspnet_UsersInRoles_FindUsersInRoleResult
+	{
+		
+		private string _UserName;
+		
+		public aspnet_UsersInRoles_FindUsersInRoleResult()
+		{
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserName", DbType="NVarChar(256) NOT NULL", CanBeNull=false)]
+		public string UserName
+		{
+			get
+			{
+				return this._UserName;
+			}
+			set
+			{
+				if ((this._UserName != value))
+				{
+					this._UserName = value;
+				}
+			}
+		}
+	}
+	
+	public partial class aspnet_Roles_GetAllRolesResult
+	{
+		
+		private string _RoleName;
+		
+		public aspnet_Roles_GetAllRolesResult()
+		{
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RoleName", DbType="NVarChar(256) NOT NULL", CanBeNull=false)]
+		public string RoleName
+		{
+			get
+			{
+				return this._RoleName;
+			}
+			set
+			{
+				if ((this._RoleName != value))
+				{
+					this._RoleName = value;
+				}
+			}
+		}
+	}
 }
 #pragma warning restore 1591
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/Membership.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/Membership.cs	(revision 4646)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/Membership.cs	(revision 4647)
@@ -15,6 +15,6 @@
         // [DataMember]
         //  public string PasswordFormat { get; set; }
-        //  [DataMember]
-        //  public string PasswordSalt { get; set; }
+          [DataMember]
+          public string PasswordSalt { get; set; }
         // [DataMember]
         // public string MobilePIN { get; set; }
@@ -23,8 +23,8 @@
         [DataMember]
         public string LoweredEmail { get; set; }
-        //  [DataMember]
-        //  public string PasswordQuestion { get; set; }
-        //  [DataMember]
-        //  public string PasswordAnswer { get; set; }
+        [DataMember]
+        public string PasswordQuestion { get; set; }
+        [DataMember]
+        public string PasswordAnswer { get; set; }
         [DataMember]
         public bool IsApproved { get; set; }
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/User.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/User.cs	(revision 4646)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/User.cs	(revision 4647)
@@ -10,5 +10,25 @@
     public class User
     {
-        
+
+        [DataMember]
+        public Membership Membership { get; set; }
+        [DataMember]
+        public string Email
+        {
+            get { return Membership.Email; }
+            set { Membership.Email = value; }
+        }
+        [DataMember]
+        public string Password
+        {
+            get { return Membership.Password; }
+            set { Membership.Password = value; }
+        }
+        [DataMember]
+        public string PasswordQuestion
+        {
+            get { return Membership.PasswordQuestion; }
+            set { this.Membership.PasswordQuestion = value; }
+        }
         [DataMember]
         public Guid ApplicationId { get; set; }
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/HeuristicLab.Services.Authentication.TestClient.csproj
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/HeuristicLab.Services.Authentication.TestClient.csproj	(revision 4646)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/HeuristicLab.Services.Authentication.TestClient.csproj	(revision 4647)
@@ -35,6 +35,8 @@
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="HeuristicLab.Services.Authentication.DataAccess, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
     <Reference Include="System" />
     <Reference Include="System.Core" />
+    <Reference Include="System.Data.Linq" />
     <Reference Include="System.Data.Services.Client" />
     <Reference Include="System.Drawing" />
@@ -48,18 +50,6 @@
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="RoleDetail.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="RoleDetail.Designer.cs">
-      <DependentUpon>RoleDetail.cs</DependentUpon>
-    </Compile>
     <Compile Include="TestClient.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="UserDetail.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="UserDetail.Designer.cs">
-      <DependentUpon>UserDetail.cs</DependentUpon>
-    </Compile>
     <Compile Include="UserManagement.cs">
       <SubType>Form</SubType>
@@ -80,10 +70,4 @@
   </ItemGroup>
   <ItemGroup>
-    <EmbeddedResource Include="RoleDetail.resx">
-      <DependentUpon>RoleDetail.cs</DependentUpon>
-    </EmbeddedResource>
-    <EmbeddedResource Include="UserDetail.resx">
-      <DependentUpon>UserDetail.cs</DependentUpon>
-    </EmbeddedResource>
     <EmbeddedResource Include="UserManagement.resx">
       <DependentUpon>UserManagement.cs</DependentUpon>
Index: anches/UserManagement/HeuristicLab.Services.Authentication.TestClient/RoleDetail.Designer.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/RoleDetail.Designer.cs	(revision 4646)
+++ 	(revision )
@@ -1,185 +1,0 @@
-﻿namespace HeuristicLab.Services.Authentication.TestClient
-{
-    partial class RoleDetail
-    {
-        /// <summary>
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows Form Designer generated code
-
-        /// <summary>
-        /// Required method for Designer support - do not modify
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.components = new System.ComponentModel.Container();
-            System.Windows.Forms.Label applicationIdLabel;
-            System.Windows.Forms.Label descriptionLabel;
-            System.Windows.Forms.Label loweredRoleNameLabel;
-            System.Windows.Forms.Label roleIdLabel;
-            System.Windows.Forms.Label roleNameLabel;
-            this.bsRole = new System.Windows.Forms.BindingSource(this.components);
-            this.applicationIdTextBox = new System.Windows.Forms.TextBox();
-            this.descriptionTextBox = new System.Windows.Forms.TextBox();
-            this.loweredRoleNameTextBox = new System.Windows.Forms.TextBox();
-            this.roleIdTextBox = new System.Windows.Forms.TextBox();
-            this.roleNameTextBox = new System.Windows.Forms.TextBox();
-            this.btnSave = new System.Windows.Forms.Button();
-            applicationIdLabel = new System.Windows.Forms.Label();
-            descriptionLabel = new System.Windows.Forms.Label();
-            loweredRoleNameLabel = new System.Windows.Forms.Label();
-            roleIdLabel = new System.Windows.Forms.Label();
-            roleNameLabel = new System.Windows.Forms.Label();
-            ((System.ComponentModel.ISupportInitialize)(this.bsRole)).BeginInit();
-            this.SuspendLayout();
-            // 
-            // bsRole
-            // 
-            this.bsRole.DataSource = typeof(HeuristicLab.Services.Authentication.DataTransfer.Role);
-            // 
-            // applicationIdLabel
-            // 
-            applicationIdLabel.AutoSize = true;
-            applicationIdLabel.Location = new System.Drawing.Point(12, 9);
-            applicationIdLabel.Name = "applicationIdLabel";
-            applicationIdLabel.Size = new System.Drawing.Size(74, 13);
-            applicationIdLabel.TabIndex = 1;
-            applicationIdLabel.Text = "Application Id:";
-            // 
-            // applicationIdTextBox
-            // 
-            this.applicationIdTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsRole, "ApplicationId", true));
-            this.applicationIdTextBox.Location = new System.Drawing.Point(125, 6);
-            this.applicationIdTextBox.Name = "applicationIdTextBox";
-            this.applicationIdTextBox.Size = new System.Drawing.Size(100, 20);
-            this.applicationIdTextBox.TabIndex = 2;
-            // 
-            // descriptionLabel
-            // 
-            descriptionLabel.AutoSize = true;
-            descriptionLabel.Location = new System.Drawing.Point(12, 35);
-            descriptionLabel.Name = "descriptionLabel";
-            descriptionLabel.Size = new System.Drawing.Size(63, 13);
-            descriptionLabel.TabIndex = 3;
-            descriptionLabel.Text = "Description:";
-            // 
-            // descriptionTextBox
-            // 
-            this.descriptionTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsRole, "Description", true));
-            this.descriptionTextBox.Location = new System.Drawing.Point(125, 32);
-            this.descriptionTextBox.Name = "descriptionTextBox";
-            this.descriptionTextBox.Size = new System.Drawing.Size(100, 20);
-            this.descriptionTextBox.TabIndex = 4;
-            // 
-            // loweredRoleNameLabel
-            // 
-            loweredRoleNameLabel.AutoSize = true;
-            loweredRoleNameLabel.Location = new System.Drawing.Point(12, 61);
-            loweredRoleNameLabel.Name = "loweredRoleNameLabel";
-            loweredRoleNameLabel.Size = new System.Drawing.Size(107, 13);
-            loweredRoleNameLabel.TabIndex = 5;
-            loweredRoleNameLabel.Text = "Lowered Role Name:";
-            // 
-            // loweredRoleNameTextBox
-            // 
-            this.loweredRoleNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsRole, "LoweredRoleName", true));
-            this.loweredRoleNameTextBox.Location = new System.Drawing.Point(125, 58);
-            this.loweredRoleNameTextBox.Name = "loweredRoleNameTextBox";
-            this.loweredRoleNameTextBox.Size = new System.Drawing.Size(100, 20);
-            this.loweredRoleNameTextBox.TabIndex = 6;
-            // 
-            // roleIdLabel
-            // 
-            roleIdLabel.AutoSize = true;
-            roleIdLabel.Location = new System.Drawing.Point(12, 87);
-            roleIdLabel.Name = "roleIdLabel";
-            roleIdLabel.Size = new System.Drawing.Size(44, 13);
-            roleIdLabel.TabIndex = 7;
-            roleIdLabel.Text = "Role Id:";
-            // 
-            // roleIdTextBox
-            // 
-            this.roleIdTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsRole, "RoleId", true));
-            this.roleIdTextBox.Location = new System.Drawing.Point(125, 84);
-            this.roleIdTextBox.Name = "roleIdTextBox";
-            this.roleIdTextBox.Size = new System.Drawing.Size(100, 20);
-            this.roleIdTextBox.TabIndex = 8;
-            // 
-            // roleNameLabel
-            // 
-            roleNameLabel.AutoSize = true;
-            roleNameLabel.Location = new System.Drawing.Point(12, 113);
-            roleNameLabel.Name = "roleNameLabel";
-            roleNameLabel.Size = new System.Drawing.Size(63, 13);
-            roleNameLabel.TabIndex = 9;
-            roleNameLabel.Text = "Role Name:";
-            // 
-            // roleNameTextBox
-            // 
-            this.roleNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsRole, "RoleName", true));
-            this.roleNameTextBox.Location = new System.Drawing.Point(125, 110);
-            this.roleNameTextBox.Name = "roleNameTextBox";
-            this.roleNameTextBox.Size = new System.Drawing.Size(100, 20);
-            this.roleNameTextBox.TabIndex = 10;
-            // 
-            // btnSave
-            // 
-            this.btnSave.Location = new System.Drawing.Point(15, 141);
-            this.btnSave.Name = "btnSave";
-            this.btnSave.Size = new System.Drawing.Size(75, 23);
-            this.btnSave.TabIndex = 11;
-            this.btnSave.Text = "Save";
-            this.btnSave.UseVisualStyleBackColor = true;
-            this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
-            // 
-            // RoleDetail
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(409, 238);
-            this.Controls.Add(this.btnSave);
-            this.Controls.Add(applicationIdLabel);
-            this.Controls.Add(this.applicationIdTextBox);
-            this.Controls.Add(descriptionLabel);
-            this.Controls.Add(this.descriptionTextBox);
-            this.Controls.Add(loweredRoleNameLabel);
-            this.Controls.Add(this.loweredRoleNameTextBox);
-            this.Controls.Add(roleIdLabel);
-            this.Controls.Add(this.roleIdTextBox);
-            this.Controls.Add(roleNameLabel);
-            this.Controls.Add(this.roleNameTextBox);
-            this.Name = "RoleDetail";
-            this.Text = "RoleDetail";
-            ((System.ComponentModel.ISupportInitialize)(this.bsRole)).EndInit();
-            this.ResumeLayout(false);
-            this.PerformLayout();
-
-        }
-
-        #endregion
-
-        private System.Windows.Forms.BindingSource bsRole;
-        private System.Windows.Forms.TextBox applicationIdTextBox;
-        private System.Windows.Forms.TextBox descriptionTextBox;
-        private System.Windows.Forms.TextBox loweredRoleNameTextBox;
-        private System.Windows.Forms.TextBox roleIdTextBox;
-        private System.Windows.Forms.TextBox roleNameTextBox;
-        private System.Windows.Forms.Button btnSave;
-    }
-}
Index: anches/UserManagement/HeuristicLab.Services.Authentication.TestClient/RoleDetail.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/RoleDetail.cs	(revision 4646)
+++ 	(revision )
@@ -1,62 +1,0 @@
-﻿using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Windows.Forms;
-using HeuristicLab.Services.Authentication.DataTransfer;
-
-namespace HeuristicLab.Services.Authentication.TestClient
-{
-
-    public enum RoleDetailMode
-    {
-        Insert,
-        Update
-    }
-
-    public partial class RoleDetail : Form
-    {
-
-        private RoleDetailMode mode;
-        private AuthenticationService service;
-        private Role role;
-
-        public RoleDetail(RoleDetailMode mode, AuthenticationService service,Role role)
-        {
-            InitializeComponent();
-            
-            this.mode = mode;
-            this.service = service;
-
-            if (role == null)
-            {
-                role = new Role();
-            }
-
-            this.role = role;
-            this.bsRole.DataSource = role;
-        }
-
-
-        private void btnSave_Click(object sender, EventArgs e)
-        {
-            if (mode == RoleDetailMode.Insert)
-            {
-                if (this.service.InsertRole(role))
-                {
-                    this.Close();
-                }
-            }
-            else if (mode == RoleDetailMode.Update)
-            {
-                if(this.service.UpdateRole(role)){
-                    this.Close();
-                }
-            }
-           
-        }
-    }
-}
Index: anches/UserManagement/HeuristicLab.Services.Authentication.TestClient/RoleDetail.resx
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/RoleDetail.resx	(revision 4646)
+++ 	(revision )
@@ -1,138 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <metadata name="bsRole.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 17</value>
-  </metadata>
-  <metadata name="applicationIdLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </metadata>
-  <metadata name="descriptionLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </metadata>
-  <metadata name="loweredRoleNameLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </metadata>
-  <metadata name="roleIdLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </metadata>
-  <metadata name="roleNameLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </metadata>
-</root>
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/TestClient.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/TestClient.cs	(revision 4646)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/TestClient.cs	(revision 4647)
@@ -2,5 +2,6 @@
 
 using System.Collections.Generic;
-using System.Windows.Forms;
+
+using HeuristicLab.Services.Authentication.DataTransfer;
 
 
@@ -12,46 +13,235 @@
         {
            
-            Application.Run(new UserManagement());
-
-            //AuthenticationService auth = new AuthenticationService();
-
-            //try
-            //{
-            //    IEnumerable<User> list = new List<User>();
-            //    list = auth.GetUsers();
-            //    foreach (var item in list)
-            //    {
-            //        Console.WriteLine("Item=" + item.UserName);
-            //    }
-
-            //    Console.WriteLine("Try to delete user...");
-
-            //   // User u = new User() { UserId =  };
-            //    auth.DeleteUser(new Guid("e4abc6ae-c954-4efd-8108-e536226fd9c7"));
-
-            //}
-            //catch (Exception e)
-            //{
-            //    Console.WriteLine(e.Message);
-            //}
-            //Console.ReadLine();
-            //ServiceClient client = new ServiceClient();
-            //client.ClientCredentials.UserName.UserName = "Alice";
-            //client.ClientCredentials.UserName.Password = "YouWillNeverKnow";
-            //client.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None;
-
-            //try
-            //{
-            //    Console.WriteLine(client.GetData(23));
-            //}
-            //catch (Exception e)
-            //{
-            //    Console.WriteLine("test");
-            //    Console.WriteLine(e.Message);
-            //}
-
-            //Console.ReadLine();
-
-            //client.Close();
+
+
+            AuthenticationService auth = new AuthenticationService();
+
+            try
+            {
+
+                Console.WriteLine("Insert new application");
+                Application app1 = new Application() { ApplicationName="SPR Application", Description="SPR Application"};
+                app1 = auth.InsertApplication(app1);
+
+                if (app1 != null)
+                {
+                    Console.WriteLine("okay");
+                }
+                else
+                {
+                    Console.WriteLine("error");
+                }
+                Console.WriteLine("--------------------------");
+
+                Console.WriteLine("Insert user SPRTEST");
+                Membership membership = new Membership() { Email="aaa@bbb.com", Password="aaa", PasswordAnswer="bar", PasswordQuestion="foo?", PasswordSalt="aaa"};
+                User user1 = new User(){ UserName="SPRTEST", IsAnonymous=false, LastActivityDate=DateTime.Now, ApplicationId=app1.ApplicationId, Membership=membership};
+                auth.InsertUser(user1);
+                Console.WriteLine("--------------------------");
+
+                Console.WriteLine("Get user SPRTEST");
+                User user2 = auth.GetUser(app1.ApplicationId, "SPRTEST");
+                if (user2 != null)
+                {
+                    Console.WriteLine("id=" + user2.UserId);
+                }
+                else
+                {
+                    Console.WriteLine("not found!");
+                }
+                Console.WriteLine("--------------------------");
+
+
+                Console.WriteLine("Get user Einstein");
+                User user3 = auth.GetUser(app1.ApplicationId, "Einstein");
+                if (user3 != null)
+                {
+                    Console.WriteLine("id=" + user2.UserId);
+                }
+                else
+                {
+                    Console.WriteLine("not found!");
+                }
+                Console.WriteLine("--------------------------");
+
+
+                Console.WriteLine("Insert role Role1");
+                Role role1 = new Role() { RoleName = "Role1", Description = "first test role", ApplicationId = app1.ApplicationId };
+
+                if (auth.InsertRole(role1))
+                {
+                    Console.WriteLine("okay");
+                }
+                else
+                {
+                    Console.WriteLine("error");
+                }
+                Console.WriteLine("--------------------------");
+
+                Console.WriteLine("Get Role Role1");
+                Role role2 = auth.GetRole(app1.ApplicationId, "Role1");
+                if (role2 != null)
+                {
+                    Console.WriteLine("id=" + role2.RoleId);
+                }
+                else
+                {
+                    Console.WriteLine("not found!");
+                }
+                Console.WriteLine("--------------------------");
+                Console.WriteLine("Get Role Role2");
+                Role role3 = auth.GetRole(app1.ApplicationId, "Role2");
+                if (role3 != null)
+                {
+                    Console.WriteLine("id=" + role3.RoleId);
+                }
+                else
+                {
+                    Console.WriteLine("not found!");
+                }
+                Console.WriteLine("--------------------------");
+
+                
+                Console.WriteLine("GetRoles");
+                IEnumerable<Role> list3 = auth.GetRoles(app1.ApplicationId);
+
+                foreach (Role role in list3)
+                {
+                    Console.WriteLine(role.RoleName);
+                }
+                Console.WriteLine("--------------------------");
+                Console.WriteLine("Is User SPRTEST In Role1");
+                if (auth.IsUserInRole(role2.RoleId, user2.UserId))
+                {
+                    Console.WriteLine("true");
+                }
+                else
+                {
+                    Console.WriteLine("false");
+                }
+                Console.WriteLine("--------------------------");
+
+
+
+                Console.WriteLine("Add User SPRTEST To Role1");
+                if (auth.AddUserToRole(role2.RoleId, user2.UserId))
+                {
+                    Console.WriteLine("okay");
+                }
+                else
+                {
+                    Console.WriteLine("error");
+                }
+                Console.WriteLine("--------------------------");
+
+                Console.WriteLine("Is User SPRTEST In Role1");
+                if (auth.IsUserInRole(role2.RoleId, user2.UserId))
+                {
+                    Console.WriteLine("true");
+                }
+                else
+                {
+                    Console.WriteLine("false");
+                }
+                Console.WriteLine("--------------------------");
+
+                Console.WriteLine("Add User SPRTEST To Role2");
+                if (role3 != null && auth.AddUserToRole(role3.RoleId, user2.UserId))
+                {
+                    Console.WriteLine("okay");
+                }
+                else
+                {
+                    Console.WriteLine("error");
+                }
+                Console.WriteLine("--------------------------");
+ 
+
+                
+                IEnumerable<User> list1 = auth.GetUsers(app1.ApplicationId);
+                Console.WriteLine("Get Users");
+                foreach (var item in list1)
+                {
+                    Console.WriteLine( item.UserName);
+                }
+
+                Console.WriteLine("--------------------------");
+                User user4 = auth.GetUser(app1.ApplicationId, "SPRTEST");
+                if (user4 != null)
+                {
+                    IEnumerable<Role> roles = auth.GetRolesForUser(user4.UserId);
+                    Console.WriteLine("Get Roles for user SPRTEST");
+                    foreach (Role r in roles)
+                    {
+                        Console.WriteLine(r.RoleName);
+                    }
+                }
+                
+                Console.WriteLine("--------------------------");
+                Console.WriteLine("Remove SPRTEST From Role1");
+                if (auth.RemoveUserFromRole(role2.RoleId, user4.UserId))
+                {
+                    Console.WriteLine("okay");
+                }
+                else
+                {
+                    Console.WriteLine("error");
+                }
+
+                Console.WriteLine("--------------------------");
+                User user5 = auth.GetUser(app1.ApplicationId, "SPRTEST");
+                if (user5 != null)
+                {
+                    IEnumerable<Role> roles = auth.GetRolesForUser(user5.UserId);
+                    Console.WriteLine("Get Roles for user SPRTEST");
+                    foreach (Role r in roles)
+                    {
+                        Console.WriteLine(r.RoleName);
+                    }
+                }
+
+                Console.WriteLine("--------------------------");
+                Console.WriteLine("Delete User SPRTEST");
+                if (auth.DeleteUser(user4.UserId))
+                {
+                    Console.WriteLine("okay");
+                }
+                else
+                {
+                    Console.WriteLine("error");
+                }
+                Console.WriteLine("--------------------------");
+
+                IEnumerable<User> list2 = auth.GetUsers(app1.ApplicationId);
+                Console.WriteLine("Get Users");
+                foreach (var item in list2)
+                {
+                    Console.WriteLine(item.UserName);
+                }
+
+                Console.WriteLine("--------------------------");
+                Console.WriteLine("Update user SPRTEST");
+                User user6 = auth.GetUser(app1.ApplicationId,"SPRTEST");
+
+                if (user6 != null)
+                {
+                    user6.LoweredUserName = "new lowered name";
+                    user6.Membership.Email = "new email";
+                    auth.UpdateUser(user6);
+                }
+
+
+               
+
+            }
+            catch (Exception e)
+            {
+                Console.WriteLine(e.Message);
+            }
+           
+            // User form
+
+            System.Windows.Forms.Application.Run(new UserManagement());
+            
         }
     }
Index: anches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserDetail.Designer.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserDetail.Designer.cs	(revision 4646)
+++ 	(revision )
@@ -1,232 +1,0 @@
-﻿namespace HeuristicLab.Services.Authentication.TestClient
-{
-    partial class UserDetail
-    {
-        /// <summary>
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows Form Designer generated code
-
-        /// <summary>
-        /// Required method for Designer support - do not modify
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.components = new System.ComponentModel.Container();
-            System.Windows.Forms.Label applicationIdLabel;
-            System.Windows.Forms.Label isAnonymousLabel;
-            System.Windows.Forms.Label lastActivityDateLabel;
-            System.Windows.Forms.Label loweredUserNameLabel;
-            System.Windows.Forms.Label mobileAliasLabel;
-            System.Windows.Forms.Label userIdLabel;
-            System.Windows.Forms.Label userNameLabel;
-            this.applicationIdTextBox = new System.Windows.Forms.TextBox();
-            this.isAnonymousCheckBox = new System.Windows.Forms.CheckBox();
-            this.lastActivityDateDateTimePicker = new System.Windows.Forms.DateTimePicker();
-            this.loweredUserNameTextBox = new System.Windows.Forms.TextBox();
-            this.mobileAliasTextBox = new System.Windows.Forms.TextBox();
-            this.userIdTextBox = new System.Windows.Forms.TextBox();
-            this.userNameTextBox = new System.Windows.Forms.TextBox();
-            this.btnSave = new System.Windows.Forms.Button();
-            this.bsUser = new System.Windows.Forms.BindingSource(this.components);
-            applicationIdLabel = new System.Windows.Forms.Label();
-            isAnonymousLabel = new System.Windows.Forms.Label();
-            lastActivityDateLabel = new System.Windows.Forms.Label();
-            loweredUserNameLabel = new System.Windows.Forms.Label();
-            mobileAliasLabel = new System.Windows.Forms.Label();
-            userIdLabel = new System.Windows.Forms.Label();
-            userNameLabel = new System.Windows.Forms.Label();
-            ((System.ComponentModel.ISupportInitialize)(this.bsUser)).BeginInit();
-            this.SuspendLayout();
-            // 
-            // applicationIdLabel
-            // 
-            applicationIdLabel.AutoSize = true;
-            applicationIdLabel.Location = new System.Drawing.Point(12, 18);
-            applicationIdLabel.Name = "applicationIdLabel";
-            applicationIdLabel.Size = new System.Drawing.Size(74, 13);
-            applicationIdLabel.TabIndex = 1;
-            applicationIdLabel.Text = "Application Id:";
-            // 
-            // applicationIdTextBox
-            // 
-            this.applicationIdTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsUser, "ApplicationId", true));
-            this.applicationIdTextBox.Location = new System.Drawing.Point(125, 15);
-            this.applicationIdTextBox.Name = "applicationIdTextBox";
-            this.applicationIdTextBox.Size = new System.Drawing.Size(200, 20);
-            this.applicationIdTextBox.TabIndex = 2;
-            // 
-            // isAnonymousLabel
-            // 
-            isAnonymousLabel.AutoSize = true;
-            isAnonymousLabel.Location = new System.Drawing.Point(12, 46);
-            isAnonymousLabel.Name = "isAnonymousLabel";
-            isAnonymousLabel.Size = new System.Drawing.Size(76, 13);
-            isAnonymousLabel.TabIndex = 3;
-            isAnonymousLabel.Text = "Is Anonymous:";
-            // 
-            // isAnonymousCheckBox
-            // 
-            this.isAnonymousCheckBox.DataBindings.Add(new System.Windows.Forms.Binding("CheckState", this.bsUser, "IsAnonymous", true));
-            this.isAnonymousCheckBox.Location = new System.Drawing.Point(125, 41);
-            this.isAnonymousCheckBox.Name = "isAnonymousCheckBox";
-            this.isAnonymousCheckBox.Size = new System.Drawing.Size(200, 24);
-            this.isAnonymousCheckBox.TabIndex = 4;
-            this.isAnonymousCheckBox.UseVisualStyleBackColor = true;
-            // 
-            // lastActivityDateLabel
-            // 
-            lastActivityDateLabel.AutoSize = true;
-            lastActivityDateLabel.Location = new System.Drawing.Point(12, 75);
-            lastActivityDateLabel.Name = "lastActivityDateLabel";
-            lastActivityDateLabel.Size = new System.Drawing.Size(93, 13);
-            lastActivityDateLabel.TabIndex = 5;
-            lastActivityDateLabel.Text = "Last Activity Date:";
-            // 
-            // lastActivityDateDateTimePicker
-            // 
-            this.lastActivityDateDateTimePicker.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.bsUser, "LastActivityDate", true));
-            this.lastActivityDateDateTimePicker.Location = new System.Drawing.Point(125, 71);
-            this.lastActivityDateDateTimePicker.Name = "lastActivityDateDateTimePicker";
-            this.lastActivityDateDateTimePicker.Size = new System.Drawing.Size(200, 20);
-            this.lastActivityDateDateTimePicker.TabIndex = 6;
-            // 
-            // loweredUserNameLabel
-            // 
-            loweredUserNameLabel.AutoSize = true;
-            loweredUserNameLabel.Location = new System.Drawing.Point(12, 100);
-            loweredUserNameLabel.Name = "loweredUserNameLabel";
-            loweredUserNameLabel.Size = new System.Drawing.Size(107, 13);
-            loweredUserNameLabel.TabIndex = 7;
-            loweredUserNameLabel.Text = "Lowered User Name:";
-            // 
-            // loweredUserNameTextBox
-            // 
-            this.loweredUserNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsUser, "LoweredUserName", true));
-            this.loweredUserNameTextBox.Location = new System.Drawing.Point(125, 97);
-            this.loweredUserNameTextBox.Name = "loweredUserNameTextBox";
-            this.loweredUserNameTextBox.Size = new System.Drawing.Size(200, 20);
-            this.loweredUserNameTextBox.TabIndex = 8;
-            // 
-            // mobileAliasLabel
-            // 
-            mobileAliasLabel.AutoSize = true;
-            mobileAliasLabel.Location = new System.Drawing.Point(12, 126);
-            mobileAliasLabel.Name = "mobileAliasLabel";
-            mobileAliasLabel.Size = new System.Drawing.Size(66, 13);
-            mobileAliasLabel.TabIndex = 9;
-            mobileAliasLabel.Text = "Mobile Alias:";
-            // 
-            // mobileAliasTextBox
-            // 
-            this.mobileAliasTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsUser, "MobileAlias", true));
-            this.mobileAliasTextBox.Location = new System.Drawing.Point(125, 123);
-            this.mobileAliasTextBox.Name = "mobileAliasTextBox";
-            this.mobileAliasTextBox.Size = new System.Drawing.Size(200, 20);
-            this.mobileAliasTextBox.TabIndex = 10;
-            // 
-            // userIdLabel
-            // 
-            userIdLabel.AutoSize = true;
-            userIdLabel.Location = new System.Drawing.Point(12, 152);
-            userIdLabel.Name = "userIdLabel";
-            userIdLabel.Size = new System.Drawing.Size(44, 13);
-            userIdLabel.TabIndex = 11;
-            userIdLabel.Text = "User Id:";
-            // 
-            // userIdTextBox
-            // 
-            this.userIdTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsUser, "UserId", true));
-            this.userIdTextBox.Location = new System.Drawing.Point(125, 149);
-            this.userIdTextBox.Name = "userIdTextBox";
-            this.userIdTextBox.Size = new System.Drawing.Size(200, 20);
-            this.userIdTextBox.TabIndex = 12;
-            // 
-            // userNameLabel
-            // 
-            userNameLabel.AutoSize = true;
-            userNameLabel.Location = new System.Drawing.Point(12, 178);
-            userNameLabel.Name = "userNameLabel";
-            userNameLabel.Size = new System.Drawing.Size(63, 13);
-            userNameLabel.TabIndex = 13;
-            userNameLabel.Text = "User Name:";
-            // 
-            // userNameTextBox
-            // 
-            this.userNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsUser, "UserName", true));
-            this.userNameTextBox.Location = new System.Drawing.Point(125, 175);
-            this.userNameTextBox.Name = "userNameTextBox";
-            this.userNameTextBox.Size = new System.Drawing.Size(200, 20);
-            this.userNameTextBox.TabIndex = 14;
-            // 
-            // btnSave
-            // 
-            this.btnSave.Location = new System.Drawing.Point(11, 212);
-            this.btnSave.Name = "btnSave";
-            this.btnSave.Size = new System.Drawing.Size(75, 23);
-            this.btnSave.TabIndex = 15;
-            this.btnSave.Text = "Save";
-            this.btnSave.UseVisualStyleBackColor = true;
-            this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
-            // 
-            // bsUser
-            // 
-            this.bsUser.DataSource = typeof(HeuristicLab.Services.Authentication.DataTransfer.User);
-            // 
-            // UserDetail
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(380, 254);
-            this.Controls.Add(this.btnSave);
-            this.Controls.Add(applicationIdLabel);
-            this.Controls.Add(this.applicationIdTextBox);
-            this.Controls.Add(isAnonymousLabel);
-            this.Controls.Add(this.isAnonymousCheckBox);
-            this.Controls.Add(lastActivityDateLabel);
-            this.Controls.Add(this.lastActivityDateDateTimePicker);
-            this.Controls.Add(loweredUserNameLabel);
-            this.Controls.Add(this.loweredUserNameTextBox);
-            this.Controls.Add(mobileAliasLabel);
-            this.Controls.Add(this.mobileAliasTextBox);
-            this.Controls.Add(userIdLabel);
-            this.Controls.Add(this.userIdTextBox);
-            this.Controls.Add(userNameLabel);
-            this.Controls.Add(this.userNameTextBox);
-            this.Name = "UserDetail";
-            this.Text = "UserDetail";
-            ((System.ComponentModel.ISupportInitialize)(this.bsUser)).EndInit();
-            this.ResumeLayout(false);
-            this.PerformLayout();
-
-        }
-
-        #endregion
-
-        private System.Windows.Forms.BindingSource bsUser;
-        private System.Windows.Forms.TextBox applicationIdTextBox;
-        private System.Windows.Forms.CheckBox isAnonymousCheckBox;
-        private System.Windows.Forms.DateTimePicker lastActivityDateDateTimePicker;
-        private System.Windows.Forms.TextBox loweredUserNameTextBox;
-        private System.Windows.Forms.TextBox mobileAliasTextBox;
-        private System.Windows.Forms.TextBox userIdTextBox;
-        private System.Windows.Forms.TextBox userNameTextBox;
-        private System.Windows.Forms.Button btnSave;
-    }
-}
Index: anches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserDetail.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserDetail.cs	(revision 4646)
+++ 	(revision )
@@ -1,52 +1,0 @@
-﻿using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Windows.Forms;
-using HeuristicLab.Services.Authentication.DataTransfer;
-
-namespace HeuristicLab.Services.Authentication.TestClient
-{
-
-    public enum UserDetailMode
-    {
-        Insert,
-        Update
-    }
-
-    public partial class UserDetail : Form
-    {
-        private UserDetailMode mode;
-        private AuthenticationService service;
-        private User user;
-
-        public UserDetail(UserDetailMode mode,AuthenticationService service)
-        {
-            this.mode = mode;
-            this.service = service;
-            InitializeComponent();
-        }
-
-        public void Initialize(User user){
-            if(user != null){
-                this.user = user;
-                this.bsUser.DataSource = user;
-            }
-        }
-
-        private void btnSave_Click(object sender, EventArgs e)
-        {
-            if (mode == UserDetailMode.Insert)
-            {
-                this.service.InsertUser(user);
-            }
-            else if (mode == UserDetailMode.Update)
-            {
-                this.service.UpdateUser(user);              
-            }
-        }
-    }
-}
Index: anches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserDetail.resx
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserDetail.resx	(revision 4646)
+++ 	(revision )
@@ -1,144 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <metadata name="applicationIdLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </metadata>
-  <metadata name="bsUser.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 17</value>
-  </metadata>
-  <metadata name="isAnonymousLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </metadata>
-  <metadata name="lastActivityDateLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </metadata>
-  <metadata name="loweredUserNameLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </metadata>
-  <metadata name="mobileAliasLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </metadata>
-  <metadata name="userIdLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </metadata>
-  <metadata name="userNameLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </metadata>
-</root>
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.Designer.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.Designer.cs	(revision 4646)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.Designer.cs	(revision 4647)
@@ -30,18 +30,28 @@
         {
             this.components = new System.ComponentModel.Container();
-            this.grpUsers = new System.Windows.Forms.GroupBox();
+            System.Windows.Forms.Label isAnonymousLabel;
+            System.Windows.Forms.Label passwordLabel;
+            System.Windows.Forms.Label passwordAnswerLabel;
+            System.Windows.Forms.Label passwordQuestionLabel;
+            System.Windows.Forms.Label passwordSaltLabel;
+            System.Windows.Forms.Label emailLabel;
+            System.Windows.Forms.Label roleNameLabel;
+            this.bsUsers = new System.Windows.Forms.BindingSource(this.components);
+            this.bsRoles = new System.Windows.Forms.BindingSource(this.components);
+            this.scMain = new System.Windows.Forms.SplitContainer();
+            this.tabControl1 = new System.Windows.Forms.TabControl();
+            this.tabPage1 = new System.Windows.Forms.TabPage();
+            this.tabPage2 = new System.Windows.Forms.TabPage();
+            this.tabControl2 = new System.Windows.Forms.TabControl();
+            this.tabPage4 = new System.Windows.Forms.TabPage();
+            this.tabControl3 = new System.Windows.Forms.TabControl();
+            this.tabPage5 = new System.Windows.Forms.TabPage();
+            this.tabPage6 = new System.Windows.Forms.TabPage();
             this.dgvUsers = new System.Windows.Forms.DataGridView();
-            this.btnUserNew = new System.Windows.Forms.Button();
-            this.btnUserModify = new System.Windows.Forms.Button();
-            this.btnUserDelete = new System.Windows.Forms.Button();
-            this.grpRoles = new System.Windows.Forms.GroupBox();
             this.dgvRoles = new System.Windows.Forms.DataGridView();
-            this.btnRoleNew = new System.Windows.Forms.Button();
-            this.btnRoleModify = new System.Windows.Forms.Button();
-            this.btnRoleDelete = new System.Windows.Forms.Button();
-            this.scMain = new System.Windows.Forms.SplitContainer();
             this.panel1 = new System.Windows.Forms.Panel();
-            this.panel2 = new System.Windows.Forms.Panel();
-            this.applicationIdDataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.label1 = new System.Windows.Forms.Label();
+            this.membershipDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.applicationIdDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.userIdDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.userNameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -50,46 +60,173 @@
             this.isAnonymousDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.lastActivityDateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.bsUsers = new System.Windows.Forms.BindingSource(this.components);
-            this.bsRoles = new System.Windows.Forms.BindingSource(this.components);
-            this.applicationIdDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.RoleId = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.RoleName = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.LoweredRoleName = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.Description = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.grpUsers.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.dgvUsers)).BeginInit();
-            this.grpRoles.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.dgvRoles)).BeginInit();
+            this.tabPage3 = new System.Windows.Forms.TabPage();
+            this.isAnonymousCheckBox = new System.Windows.Forms.CheckBox();
+            this.passwordTextBox = new System.Windows.Forms.TextBox();
+            this.passwordAnswerTextBox = new System.Windows.Forms.TextBox();
+            this.passwordQuestionTextBox = new System.Windows.Forms.TextBox();
+            this.passwordSaltTextBox = new System.Windows.Forms.TextBox();
+            this.emailTextBox = new System.Windows.Forms.TextBox();
+            this.dataGridView1 = new System.Windows.Forms.DataGridView();
+            this.roleNameTextBox = new System.Windows.Forms.TextBox();
+            this.dataGridView2 = new System.Windows.Forms.DataGridView();
+            this.roleIdDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.roleNameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.loweredRoleNameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.descriptionDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            isAnonymousLabel = new System.Windows.Forms.Label();
+            passwordLabel = new System.Windows.Forms.Label();
+            passwordAnswerLabel = new System.Windows.Forms.Label();
+            passwordQuestionLabel = new System.Windows.Forms.Label();
+            passwordSaltLabel = new System.Windows.Forms.Label();
+            emailLabel = new System.Windows.Forms.Label();
+            roleNameLabel = new System.Windows.Forms.Label();
+            ((System.ComponentModel.ISupportInitialize)(this.bsUsers)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.bsRoles)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.scMain)).BeginInit();
             this.scMain.Panel1.SuspendLayout();
             this.scMain.Panel2.SuspendLayout();
             this.scMain.SuspendLayout();
+            this.tabControl1.SuspendLayout();
+            this.tabPage1.SuspendLayout();
+            this.tabPage2.SuspendLayout();
+            this.tabControl2.SuspendLayout();
+            this.tabPage4.SuspendLayout();
+            this.tabControl3.SuspendLayout();
+            this.tabPage5.SuspendLayout();
+            this.tabPage6.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.dgvUsers)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dgvRoles)).BeginInit();
             this.panel1.SuspendLayout();
-            this.panel2.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.bsUsers)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.bsRoles)).BeginInit();
+            this.tabPage3.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit();
             this.SuspendLayout();
             // 
-            // grpUsers
-            // 
-            this.grpUsers.Controls.Add(this.dgvUsers);
-            this.grpUsers.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.grpUsers.Location = new System.Drawing.Point(0, 0);
-            this.grpUsers.Name = "grpUsers";
-            this.grpUsers.Size = new System.Drawing.Size(1100, 249);
-            this.grpUsers.TabIndex = 0;
-            this.grpUsers.TabStop = false;
-            this.grpUsers.Text = "Users";
+            // bsUsers
+            // 
+            this.bsUsers.DataSource = typeof(HeuristicLab.Services.Authentication.DataTransfer.User);
+            // 
+            // bsRoles
+            // 
+            this.bsRoles.DataSource = typeof(HeuristicLab.Services.Authentication.DataTransfer.Role);
+            // 
+            // scMain
+            // 
+            this.scMain.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.scMain.Location = new System.Drawing.Point(0, 0);
+            this.scMain.Name = "scMain";
+            this.scMain.Orientation = System.Windows.Forms.Orientation.Horizontal;
+            // 
+            // scMain.Panel1
+            // 
+            this.scMain.Panel1.Controls.Add(this.panel1);
+            // 
+            // scMain.Panel2
+            // 
+            this.scMain.Panel2.Controls.Add(this.tabControl1);
+            this.scMain.Size = new System.Drawing.Size(1100, 556);
+            this.scMain.SplitterDistance = 47;
+            this.scMain.TabIndex = 9;
+            // 
+            // tabControl1
+            // 
+            this.tabControl1.Controls.Add(this.tabPage1);
+            this.tabControl1.Controls.Add(this.tabPage2);
+            this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.tabControl1.Location = new System.Drawing.Point(0, 0);
+            this.tabControl1.Name = "tabControl1";
+            this.tabControl1.SelectedIndex = 0;
+            this.tabControl1.Size = new System.Drawing.Size(1100, 505);
+            this.tabControl1.TabIndex = 0;
+            // 
+            // tabPage1
+            // 
+            this.tabPage1.AutoScroll = true;
+            this.tabPage1.Controls.Add(this.dgvUsers);
+            this.tabPage1.Controls.Add(this.tabControl2);
+            this.tabPage1.Location = new System.Drawing.Point(4, 22);
+            this.tabPage1.Name = "tabPage1";
+            this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage1.Size = new System.Drawing.Size(1092, 479);
+            this.tabPage1.TabIndex = 0;
+            this.tabPage1.Text = "User";
+            this.tabPage1.UseVisualStyleBackColor = true;
+            // 
+            // tabPage2
+            // 
+            this.tabPage2.AutoScroll = true;
+            this.tabPage2.Controls.Add(this.dgvRoles);
+            this.tabPage2.Controls.Add(this.tabControl3);
+            this.tabPage2.Location = new System.Drawing.Point(4, 22);
+            this.tabPage2.Name = "tabPage2";
+            this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage2.Size = new System.Drawing.Size(1092, 479);
+            this.tabPage2.TabIndex = 1;
+            this.tabPage2.Text = "Roles";
+            this.tabPage2.UseVisualStyleBackColor = true;
+            // 
+            // tabControl2
+            // 
+            this.tabControl2.Controls.Add(this.tabPage3);
+            this.tabControl2.Controls.Add(this.tabPage4);
+            this.tabControl2.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.tabControl2.Location = new System.Drawing.Point(3, 291);
+            this.tabControl2.Name = "tabControl2";
+            this.tabControl2.SelectedIndex = 0;
+            this.tabControl2.Size = new System.Drawing.Size(1086, 185);
+            this.tabControl2.TabIndex = 0;
+            // 
+            // tabPage4
+            // 
+            this.tabPage4.Controls.Add(this.dataGridView1);
+            this.tabPage4.Location = new System.Drawing.Point(4, 22);
+            this.tabPage4.Name = "tabPage4";
+            this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage4.Size = new System.Drawing.Size(1078, 159);
+            this.tabPage4.TabIndex = 1;
+            this.tabPage4.Text = "Roles";
+            this.tabPage4.UseVisualStyleBackColor = true;
+            // 
+            // tabControl3
+            // 
+            this.tabControl3.Controls.Add(this.tabPage5);
+            this.tabControl3.Controls.Add(this.tabPage6);
+            this.tabControl3.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.tabControl3.Location = new System.Drawing.Point(3, 291);
+            this.tabControl3.Name = "tabControl3";
+            this.tabControl3.SelectedIndex = 0;
+            this.tabControl3.Size = new System.Drawing.Size(1086, 185);
+            this.tabControl3.TabIndex = 1;
+            // 
+            // tabPage5
+            // 
+            this.tabPage5.Controls.Add(roleNameLabel);
+            this.tabPage5.Controls.Add(this.roleNameTextBox);
+            this.tabPage5.Location = new System.Drawing.Point(4, 22);
+            this.tabPage5.Name = "tabPage5";
+            this.tabPage5.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage5.Size = new System.Drawing.Size(1078, 159);
+            this.tabPage5.TabIndex = 0;
+            this.tabPage5.Text = "Detail";
+            this.tabPage5.UseVisualStyleBackColor = true;
+            // 
+            // tabPage6
+            // 
+            this.tabPage6.Controls.Add(this.dataGridView2);
+            this.tabPage6.Location = new System.Drawing.Point(4, 22);
+            this.tabPage6.Name = "tabPage6";
+            this.tabPage6.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage6.Size = new System.Drawing.Size(1078, 159);
+            this.tabPage6.TabIndex = 1;
+            this.tabPage6.Text = "Users";
+            this.tabPage6.UseVisualStyleBackColor = true;
             // 
             // dgvUsers
             // 
-            this.dgvUsers.AllowUserToAddRows = false;
-            this.dgvUsers.AllowUserToDeleteRows = false;
-            this.dgvUsers.AllowUserToResizeColumns = false;
-            this.dgvUsers.AllowUserToResizeRows = false;
             this.dgvUsers.AutoGenerateColumns = false;
             this.dgvUsers.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.dgvUsers.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
-            this.applicationIdDataGridViewTextBoxColumn1,
+            this.membershipDataGridViewTextBoxColumn,
+            this.applicationIdDataGridViewTextBoxColumn,
             this.userIdDataGridViewTextBoxColumn,
             this.userNameDataGridViewTextBoxColumn,
@@ -100,55 +237,8 @@
             this.dgvUsers.DataSource = this.bsUsers;
             this.dgvUsers.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.dgvUsers.Location = new System.Drawing.Point(3, 16);
-            this.dgvUsers.MultiSelect = false;
+            this.dgvUsers.Location = new System.Drawing.Point(3, 3);
             this.dgvUsers.Name = "dgvUsers";
-            this.dgvUsers.ReadOnly = true;
-            this.dgvUsers.ShowCellErrors = false;
-            this.dgvUsers.ShowCellToolTips = false;
-            this.dgvUsers.ShowEditingIcon = false;
-            this.dgvUsers.ShowRowErrors = false;
-            this.dgvUsers.Size = new System.Drawing.Size(1094, 230);
-            this.dgvUsers.TabIndex = 0;
-            // 
-            // btnUserNew
-            // 
-            this.btnUserNew.Location = new System.Drawing.Point(3, 3);
-            this.btnUserNew.Name = "btnUserNew";
-            this.btnUserNew.Size = new System.Drawing.Size(75, 23);
-            this.btnUserNew.TabIndex = 1;
-            this.btnUserNew.Text = "New";
-            this.btnUserNew.UseVisualStyleBackColor = true;
-            this.btnUserNew.Click += new System.EventHandler(this.btnUserNew_Click);
-            // 
-            // btnUserModify
-            // 
-            this.btnUserModify.Location = new System.Drawing.Point(84, 3);
-            this.btnUserModify.Name = "btnUserModify";
-            this.btnUserModify.Size = new System.Drawing.Size(75, 23);
-            this.btnUserModify.TabIndex = 2;
-            this.btnUserModify.Text = "Modify";
-            this.btnUserModify.UseVisualStyleBackColor = true;
-            this.btnUserModify.Click += new System.EventHandler(this.btnUserModify_Click);
-            // 
-            // btnUserDelete
-            // 
-            this.btnUserDelete.Location = new System.Drawing.Point(165, 3);
-            this.btnUserDelete.Name = "btnUserDelete";
-            this.btnUserDelete.Size = new System.Drawing.Size(75, 23);
-            this.btnUserDelete.TabIndex = 3;
-            this.btnUserDelete.Text = "Delete";
-            this.btnUserDelete.UseVisualStyleBackColor = true;
-            this.btnUserDelete.Click += new System.EventHandler(this.btnUserDelete_Click);
-            // 
-            // grpRoles
-            // 
-            this.grpRoles.Controls.Add(this.dgvRoles);
-            this.grpRoles.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.grpRoles.Location = new System.Drawing.Point(0, 0);
-            this.grpRoles.Name = "grpRoles";
-            this.grpRoles.Size = new System.Drawing.Size(1100, 243);
-            this.grpRoles.TabIndex = 5;
-            this.grpRoles.TabStop = false;
-            this.grpRoles.Text = "Roles";
+            this.dgvUsers.Size = new System.Drawing.Size(1086, 288);
+            this.dgvUsers.TabIndex = 1;
             // 
             // dgvRoles
@@ -156,100 +246,50 @@
             this.dgvRoles.AllowUserToAddRows = false;
             this.dgvRoles.AllowUserToDeleteRows = false;
-            this.dgvRoles.AllowUserToResizeColumns = false;
-            this.dgvRoles.AllowUserToResizeRows = false;
             this.dgvRoles.AutoGenerateColumns = false;
             this.dgvRoles.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.dgvRoles.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
-            this.applicationIdDataGridViewTextBoxColumn,
-            this.RoleId,
-            this.RoleName,
-            this.LoweredRoleName,
-            this.Description});
+            this.roleIdDataGridViewTextBoxColumn,
+            this.roleNameDataGridViewTextBoxColumn,
+            this.loweredRoleNameDataGridViewTextBoxColumn,
+            this.descriptionDataGridViewTextBoxColumn});
             this.dgvRoles.DataSource = this.bsRoles;
             this.dgvRoles.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.dgvRoles.Location = new System.Drawing.Point(3, 16);
+            this.dgvRoles.Location = new System.Drawing.Point(3, 3);
             this.dgvRoles.MultiSelect = false;
             this.dgvRoles.Name = "dgvRoles";
-            this.dgvRoles.ReadOnly = true;
-            this.dgvRoles.Size = new System.Drawing.Size(1094, 224);
-            this.dgvRoles.TabIndex = 1;
-            // 
-            // btnRoleNew
-            // 
-            this.btnRoleNew.Location = new System.Drawing.Point(3, 3);
-            this.btnRoleNew.Name = "btnRoleNew";
-            this.btnRoleNew.Size = new System.Drawing.Size(75, 23);
-            this.btnRoleNew.TabIndex = 6;
-            this.btnRoleNew.Text = "New";
-            this.btnRoleNew.UseVisualStyleBackColor = true;
-            this.btnRoleNew.Click += new System.EventHandler(this.btnRoleNew_Click);
-            // 
-            // btnRoleModify
-            // 
-            this.btnRoleModify.Location = new System.Drawing.Point(84, 3);
-            this.btnRoleModify.Name = "btnRoleModify";
-            this.btnRoleModify.Size = new System.Drawing.Size(75, 23);
-            this.btnRoleModify.TabIndex = 7;
-            this.btnRoleModify.Text = "Modify";
-            this.btnRoleModify.UseVisualStyleBackColor = true;
-            this.btnRoleModify.Click += new System.EventHandler(this.btnRoleModify_Click);
-            // 
-            // btnRoleDelete
-            // 
-            this.btnRoleDelete.Location = new System.Drawing.Point(165, 3);
-            this.btnRoleDelete.Name = "btnRoleDelete";
-            this.btnRoleDelete.Size = new System.Drawing.Size(75, 23);
-            this.btnRoleDelete.TabIndex = 8;
-            this.btnRoleDelete.Text = "Delete";
-            this.btnRoleDelete.UseVisualStyleBackColor = true;
-            this.btnRoleDelete.Click += new System.EventHandler(this.btnRoleDelete_Click);
-            // 
-            // scMain
-            // 
-            this.scMain.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.scMain.Location = new System.Drawing.Point(0, 0);
-            this.scMain.Name = "scMain";
-            this.scMain.Orientation = System.Windows.Forms.Orientation.Horizontal;
-            // 
-            // scMain.Panel1
-            // 
-            this.scMain.Panel1.Controls.Add(this.grpUsers);
-            this.scMain.Panel1.Controls.Add(this.panel1);
-            // 
-            // scMain.Panel2
-            // 
-            this.scMain.Panel2.Controls.Add(this.grpRoles);
-            this.scMain.Panel2.Controls.Add(this.panel2);
-            this.scMain.Size = new System.Drawing.Size(1100, 556);
-            this.scMain.SplitterDistance = 278;
-            this.scMain.TabIndex = 9;
+            this.dgvRoles.Size = new System.Drawing.Size(1086, 288);
+            this.dgvRoles.TabIndex = 2;
             // 
             // panel1
             // 
-            this.panel1.Controls.Add(this.btnUserNew);
-            this.panel1.Controls.Add(this.btnUserDelete);
-            this.panel1.Controls.Add(this.btnUserModify);
-            this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
-            this.panel1.Location = new System.Drawing.Point(0, 249);
+            this.panel1.Controls.Add(this.label1);
+            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.panel1.Location = new System.Drawing.Point(0, 0);
             this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(1100, 29);
-            this.panel1.TabIndex = 4;
-            // 
-            // panel2
-            // 
-            this.panel2.Controls.Add(this.btnRoleNew);
-            this.panel2.Controls.Add(this.btnRoleModify);
-            this.panel2.Controls.Add(this.btnRoleDelete);
-            this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
-            this.panel2.Location = new System.Drawing.Point(0, 243);
-            this.panel2.Name = "panel2";
-            this.panel2.Size = new System.Drawing.Size(1100, 31);
-            this.panel2.TabIndex = 9;
-            // 
-            // applicationIdDataGridViewTextBoxColumn1
-            // 
-            this.applicationIdDataGridViewTextBoxColumn1.DataPropertyName = "ApplicationId";
-            this.applicationIdDataGridViewTextBoxColumn1.HeaderText = "ApplicationId";
-            this.applicationIdDataGridViewTextBoxColumn1.Name = "applicationIdDataGridViewTextBoxColumn1";
+            this.panel1.Size = new System.Drawing.Size(1100, 47);
+            this.panel1.TabIndex = 0;
+            // 
+            // label1
+            // 
+            this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label1.Location = new System.Drawing.Point(0, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(1100, 47);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "Heuristic Lab User Management";
+            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // membershipDataGridViewTextBoxColumn
+            // 
+            this.membershipDataGridViewTextBoxColumn.DataPropertyName = "Membership";
+            this.membershipDataGridViewTextBoxColumn.HeaderText = "Membership";
+            this.membershipDataGridViewTextBoxColumn.Name = "membershipDataGridViewTextBoxColumn";
+            // 
+            // applicationIdDataGridViewTextBoxColumn
+            // 
+            this.applicationIdDataGridViewTextBoxColumn.DataPropertyName = "ApplicationId";
+            this.applicationIdDataGridViewTextBoxColumn.HeaderText = "ApplicationId";
+            this.applicationIdDataGridViewTextBoxColumn.Name = "applicationIdDataGridViewTextBoxColumn";
             // 
             // userIdDataGridViewTextBoxColumn
@@ -289,46 +329,197 @@
             this.lastActivityDateDataGridViewTextBoxColumn.Name = "lastActivityDateDataGridViewTextBoxColumn";
             // 
-            // bsUsers
-            // 
-            this.bsUsers.DataSource = typeof(HeuristicLab.Services.Authentication.DataTransfer.User);
-            // 
-            // bsRoles
-            // 
-            this.bsRoles.DataSource = typeof(HeuristicLab.Services.Authentication.DataTransfer.Role);
-            // 
-            // applicationIdDataGridViewTextBoxColumn
-            // 
-            this.applicationIdDataGridViewTextBoxColumn.DataPropertyName = "ApplicationId";
-            this.applicationIdDataGridViewTextBoxColumn.HeaderText = "ApplicationId";
-            this.applicationIdDataGridViewTextBoxColumn.Name = "applicationIdDataGridViewTextBoxColumn";
-            this.applicationIdDataGridViewTextBoxColumn.ReadOnly = true;
-            // 
-            // RoleId
-            // 
-            this.RoleId.DataPropertyName = "RoleId";
-            this.RoleId.HeaderText = "RoleId";
-            this.RoleId.Name = "RoleId";
-            this.RoleId.ReadOnly = true;
-            // 
-            // RoleName
-            // 
-            this.RoleName.DataPropertyName = "RoleName";
-            this.RoleName.HeaderText = "RoleName";
-            this.RoleName.Name = "RoleName";
-            this.RoleName.ReadOnly = true;
-            // 
-            // LoweredRoleName
-            // 
-            this.LoweredRoleName.DataPropertyName = "LoweredRoleName";
-            this.LoweredRoleName.HeaderText = "LoweredRoleName";
-            this.LoweredRoleName.Name = "LoweredRoleName";
-            this.LoweredRoleName.ReadOnly = true;
-            // 
-            // Description
-            // 
-            this.Description.DataPropertyName = "Description";
-            this.Description.HeaderText = "Description";
-            this.Description.Name = "Description";
-            this.Description.ReadOnly = true;
+            // tabPage3
+            // 
+            this.tabPage3.AutoScroll = true;
+            this.tabPage3.Controls.Add(emailLabel);
+            this.tabPage3.Controls.Add(this.emailTextBox);
+            this.tabPage3.Controls.Add(passwordSaltLabel);
+            this.tabPage3.Controls.Add(this.passwordSaltTextBox);
+            this.tabPage3.Controls.Add(passwordQuestionLabel);
+            this.tabPage3.Controls.Add(this.passwordQuestionTextBox);
+            this.tabPage3.Controls.Add(passwordAnswerLabel);
+            this.tabPage3.Controls.Add(this.passwordAnswerTextBox);
+            this.tabPage3.Controls.Add(passwordLabel);
+            this.tabPage3.Controls.Add(this.passwordTextBox);
+            this.tabPage3.Controls.Add(isAnonymousLabel);
+            this.tabPage3.Controls.Add(this.isAnonymousCheckBox);
+            this.tabPage3.Location = new System.Drawing.Point(4, 22);
+            this.tabPage3.Name = "tabPage3";
+            this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage3.Size = new System.Drawing.Size(1078, 159);
+            this.tabPage3.TabIndex = 0;
+            this.tabPage3.Text = "Detail";
+            this.tabPage3.UseVisualStyleBackColor = true;
+            // 
+            // isAnonymousLabel
+            // 
+            isAnonymousLabel.AutoSize = true;
+            isAnonymousLabel.Location = new System.Drawing.Point(15, 22);
+            isAnonymousLabel.Name = "isAnonymousLabel";
+            isAnonymousLabel.Size = new System.Drawing.Size(76, 13);
+            isAnonymousLabel.TabIndex = 0;
+            isAnonymousLabel.Text = "Is Anonymous:";
+            // 
+            // isAnonymousCheckBox
+            // 
+            this.isAnonymousCheckBox.DataBindings.Add(new System.Windows.Forms.Binding("CheckState", this.bsUsers, "IsAnonymous", true));
+            this.isAnonymousCheckBox.Location = new System.Drawing.Point(98, 17);
+            this.isAnonymousCheckBox.Name = "isAnonymousCheckBox";
+            this.isAnonymousCheckBox.Size = new System.Drawing.Size(104, 24);
+            this.isAnonymousCheckBox.TabIndex = 1;
+            this.isAnonymousCheckBox.Text = "checkBox1";
+            this.isAnonymousCheckBox.UseVisualStyleBackColor = true;
+            // 
+            // passwordLabel
+            // 
+            passwordLabel.AutoSize = true;
+            passwordLabel.Location = new System.Drawing.Point(15, 73);
+            passwordLabel.Name = "passwordLabel";
+            passwordLabel.Size = new System.Drawing.Size(56, 13);
+            passwordLabel.TabIndex = 2;
+            passwordLabel.Text = "Password:";
+            // 
+            // passwordTextBox
+            // 
+            this.passwordTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsUsers, "Membership.Password", true));
+            this.passwordTextBox.Location = new System.Drawing.Point(98, 70);
+            this.passwordTextBox.Name = "passwordTextBox";
+            this.passwordTextBox.Size = new System.Drawing.Size(203, 20);
+            this.passwordTextBox.TabIndex = 3;
+            // 
+            // passwordAnswerLabel
+            // 
+            passwordAnswerLabel.AutoSize = true;
+            passwordAnswerLabel.Location = new System.Drawing.Point(318, 46);
+            passwordAnswerLabel.Name = "passwordAnswerLabel";
+            passwordAnswerLabel.Size = new System.Drawing.Size(94, 13);
+            passwordAnswerLabel.TabIndex = 4;
+            passwordAnswerLabel.Text = "Password Answer:";
+            // 
+            // passwordAnswerTextBox
+            // 
+            this.passwordAnswerTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsUsers, "Membership.PasswordAnswer", true));
+            this.passwordAnswerTextBox.Location = new System.Drawing.Point(425, 43);
+            this.passwordAnswerTextBox.Name = "passwordAnswerTextBox";
+            this.passwordAnswerTextBox.Size = new System.Drawing.Size(188, 20);
+            this.passwordAnswerTextBox.TabIndex = 5;
+            // 
+            // passwordQuestionLabel
+            // 
+            passwordQuestionLabel.AutoSize = true;
+            passwordQuestionLabel.Location = new System.Drawing.Point(318, 73);
+            passwordQuestionLabel.Name = "passwordQuestionLabel";
+            passwordQuestionLabel.Size = new System.Drawing.Size(101, 13);
+            passwordQuestionLabel.TabIndex = 6;
+            passwordQuestionLabel.Text = "Password Question:";
+            // 
+            // passwordQuestionTextBox
+            // 
+            this.passwordQuestionTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsUsers, "Membership.PasswordQuestion", true));
+            this.passwordQuestionTextBox.Location = new System.Drawing.Point(425, 70);
+            this.passwordQuestionTextBox.Name = "passwordQuestionTextBox";
+            this.passwordQuestionTextBox.Size = new System.Drawing.Size(188, 20);
+            this.passwordQuestionTextBox.TabIndex = 7;
+            // 
+            // passwordSaltLabel
+            // 
+            passwordSaltLabel.AutoSize = true;
+            passwordSaltLabel.Location = new System.Drawing.Point(15, 99);
+            passwordSaltLabel.Name = "passwordSaltLabel";
+            passwordSaltLabel.Size = new System.Drawing.Size(77, 13);
+            passwordSaltLabel.TabIndex = 8;
+            passwordSaltLabel.Text = "Password Salt:";
+            // 
+            // passwordSaltTextBox
+            // 
+            this.passwordSaltTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsUsers, "Membership.PasswordSalt", true));
+            this.passwordSaltTextBox.Location = new System.Drawing.Point(99, 96);
+            this.passwordSaltTextBox.Name = "passwordSaltTextBox";
+            this.passwordSaltTextBox.Size = new System.Drawing.Size(202, 20);
+            this.passwordSaltTextBox.TabIndex = 9;
+            // 
+            // emailLabel
+            // 
+            emailLabel.AutoSize = true;
+            emailLabel.Location = new System.Drawing.Point(15, 46);
+            emailLabel.Name = "emailLabel";
+            emailLabel.Size = new System.Drawing.Size(35, 13);
+            emailLabel.TabIndex = 10;
+            emailLabel.Text = "Email:";
+            // 
+            // emailTextBox
+            // 
+            this.emailTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsUsers, "Membership.Email", true));
+            this.emailTextBox.Location = new System.Drawing.Point(98, 43);
+            this.emailTextBox.Name = "emailTextBox";
+            this.emailTextBox.Size = new System.Drawing.Size(203, 20);
+            this.emailTextBox.TabIndex = 11;
+            // 
+            // dataGridView1
+            // 
+            this.dataGridView1.AllowUserToAddRows = false;
+            this.dataGridView1.AllowUserToDeleteRows = false;
+            this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.dataGridView1.Location = new System.Drawing.Point(6, 22);
+            this.dataGridView1.Name = "dataGridView1";
+            this.dataGridView1.ReadOnly = true;
+            this.dataGridView1.Size = new System.Drawing.Size(437, 91);
+            this.dataGridView1.TabIndex = 0;
+            // 
+            // roleNameLabel
+            // 
+            roleNameLabel.AutoSize = true;
+            roleNameLabel.Location = new System.Drawing.Point(12, 22);
+            roleNameLabel.Name = "roleNameLabel";
+            roleNameLabel.Size = new System.Drawing.Size(63, 13);
+            roleNameLabel.TabIndex = 0;
+            roleNameLabel.Text = "Role Name:";
+            // 
+            // roleNameTextBox
+            // 
+            this.roleNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsRoles, "RoleName", true));
+            this.roleNameTextBox.Location = new System.Drawing.Point(81, 19);
+            this.roleNameTextBox.Name = "roleNameTextBox";
+            this.roleNameTextBox.Size = new System.Drawing.Size(191, 20);
+            this.roleNameTextBox.TabIndex = 1;
+            // 
+            // dataGridView2
+            // 
+            this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.dataGridView2.Location = new System.Drawing.Point(34, 28);
+            this.dataGridView2.Name = "dataGridView2";
+            this.dataGridView2.Size = new System.Drawing.Size(520, 108);
+            this.dataGridView2.TabIndex = 0;
+            // 
+            // roleIdDataGridViewTextBoxColumn
+            // 
+            this.roleIdDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
+            this.roleIdDataGridViewTextBoxColumn.DataPropertyName = "RoleId";
+            this.roleIdDataGridViewTextBoxColumn.HeaderText = "Id";
+            this.roleIdDataGridViewTextBoxColumn.Name = "roleIdDataGridViewTextBoxColumn";
+            this.roleIdDataGridViewTextBoxColumn.Width = 41;
+            // 
+            // roleNameDataGridViewTextBoxColumn
+            // 
+            this.roleNameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.roleNameDataGridViewTextBoxColumn.DataPropertyName = "RoleName";
+            this.roleNameDataGridViewTextBoxColumn.HeaderText = "Name";
+            this.roleNameDataGridViewTextBoxColumn.Name = "roleNameDataGridViewTextBoxColumn";
+            // 
+            // loweredRoleNameDataGridViewTextBoxColumn
+            // 
+            this.loweredRoleNameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
+            this.loweredRoleNameDataGridViewTextBoxColumn.DataPropertyName = "LoweredRoleName";
+            this.loweredRoleNameDataGridViewTextBoxColumn.HeaderText = "Lowered Name";
+            this.loweredRoleNameDataGridViewTextBoxColumn.Name = "loweredRoleNameDataGridViewTextBoxColumn";
+            this.loweredRoleNameDataGridViewTextBoxColumn.Width = 96;
+            // 
+            // descriptionDataGridViewTextBoxColumn
+            // 
+            this.descriptionDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
+            this.descriptionDataGridViewTextBoxColumn.DataPropertyName = "Description";
+            this.descriptionDataGridViewTextBoxColumn.HeaderText = "Description";
+            this.descriptionDataGridViewTextBoxColumn.Name = "descriptionDataGridViewTextBoxColumn";
+            this.descriptionDataGridViewTextBoxColumn.Width = 85;
             // 
             // UserManagement
@@ -340,16 +531,26 @@
             this.Name = "UserManagement";
             this.Text = "UserManagement";
-            this.grpUsers.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.dgvUsers)).EndInit();
-            this.grpRoles.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.dgvRoles)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.bsUsers)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.bsRoles)).EndInit();
             this.scMain.Panel1.ResumeLayout(false);
             this.scMain.Panel2.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.scMain)).EndInit();
             this.scMain.ResumeLayout(false);
+            this.tabControl1.ResumeLayout(false);
+            this.tabPage1.ResumeLayout(false);
+            this.tabPage2.ResumeLayout(false);
+            this.tabControl2.ResumeLayout(false);
+            this.tabPage4.ResumeLayout(false);
+            this.tabControl3.ResumeLayout(false);
+            this.tabPage5.ResumeLayout(false);
+            this.tabPage5.PerformLayout();
+            this.tabPage6.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.dgvUsers)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dgvRoles)).EndInit();
             this.panel1.ResumeLayout(false);
-            this.panel2.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.bsUsers)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.bsRoles)).EndInit();
+            this.tabPage3.ResumeLayout(false);
+            this.tabPage3.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit();
             this.ResumeLayout(false);
 
@@ -358,17 +559,21 @@
         #endregion
 
-        private System.Windows.Forms.GroupBox grpUsers;
-        private System.Windows.Forms.DataGridView dgvUsers;
-        private System.Windows.Forms.Button btnUserNew;
-        private System.Windows.Forms.Button btnUserModify;
-        private System.Windows.Forms.Button btnUserDelete;
-        private System.Windows.Forms.GroupBox grpRoles;
-        private System.Windows.Forms.DataGridView dgvRoles;
-        private System.Windows.Forms.Button btnRoleNew;
-        private System.Windows.Forms.Button btnRoleModify;
-        private System.Windows.Forms.Button btnRoleDelete;
         private System.Windows.Forms.BindingSource bsUsers;
         private System.Windows.Forms.BindingSource bsRoles;
-        private System.Windows.Forms.DataGridViewTextBoxColumn applicationIdDataGridViewTextBoxColumn1;
+        private System.Windows.Forms.SplitContainer scMain;
+        private System.Windows.Forms.TabControl tabControl1;
+        private System.Windows.Forms.TabPage tabPage1;
+        private System.Windows.Forms.DataGridView dgvUsers;
+        private System.Windows.Forms.TabControl tabControl2;
+        private System.Windows.Forms.TabPage tabPage4;
+        private System.Windows.Forms.TabPage tabPage2;
+        private System.Windows.Forms.DataGridView dgvRoles;
+        private System.Windows.Forms.TabControl tabControl3;
+        private System.Windows.Forms.TabPage tabPage5;
+        private System.Windows.Forms.TabPage tabPage6;
+        private System.Windows.Forms.Panel panel1;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn membershipDataGridViewTextBoxColumn;
+        private System.Windows.Forms.DataGridViewTextBoxColumn applicationIdDataGridViewTextBoxColumn;
         private System.Windows.Forms.DataGridViewTextBoxColumn userIdDataGridViewTextBoxColumn;
         private System.Windows.Forms.DataGridViewTextBoxColumn userNameDataGridViewTextBoxColumn;
@@ -377,12 +582,18 @@
         private System.Windows.Forms.DataGridViewCheckBoxColumn isAnonymousDataGridViewCheckBoxColumn;
         private System.Windows.Forms.DataGridViewTextBoxColumn lastActivityDateDataGridViewTextBoxColumn;
-        private System.Windows.Forms.SplitContainer scMain;
-        private System.Windows.Forms.Panel panel1;
-        private System.Windows.Forms.Panel panel2;
-        private System.Windows.Forms.DataGridViewTextBoxColumn applicationIdDataGridViewTextBoxColumn;
-        private System.Windows.Forms.DataGridViewTextBoxColumn RoleId;
-        private System.Windows.Forms.DataGridViewTextBoxColumn RoleName;
-        private System.Windows.Forms.DataGridViewTextBoxColumn LoweredRoleName;
-        private System.Windows.Forms.DataGridViewTextBoxColumn Description;
+        private System.Windows.Forms.TabPage tabPage3;
+        private System.Windows.Forms.TextBox emailTextBox;
+        private System.Windows.Forms.TextBox passwordSaltTextBox;
+        private System.Windows.Forms.TextBox passwordQuestionTextBox;
+        private System.Windows.Forms.TextBox passwordAnswerTextBox;
+        private System.Windows.Forms.TextBox passwordTextBox;
+        private System.Windows.Forms.CheckBox isAnonymousCheckBox;
+        private System.Windows.Forms.DataGridView dataGridView1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn roleIdDataGridViewTextBoxColumn;
+        private System.Windows.Forms.DataGridViewTextBoxColumn roleNameDataGridViewTextBoxColumn;
+        private System.Windows.Forms.DataGridViewTextBoxColumn loweredRoleNameDataGridViewTextBoxColumn;
+        private System.Windows.Forms.DataGridViewTextBoxColumn descriptionDataGridViewTextBoxColumn;
+        private System.Windows.Forms.TextBox roleNameTextBox;
+        private System.Windows.Forms.DataGridView dataGridView2;
     }
 }
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.cs	(revision 4646)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.cs	(revision 4647)
@@ -15,4 +15,5 @@
 
         AuthenticationService service;
+        Guid applicationId = new Guid("04371D20-8FD4-4607-A632-42C8D186786B");
 
         public UserManagement()
@@ -21,4 +22,6 @@
             Initialize();
         }
+
+
         private void Initialize()
         {
@@ -26,78 +29,11 @@
             if (service != null)
             {
-                this.bsRoles.DataSource = service.GetRoles();
-                this.bsUsers.DataSource = service.GetUsers();
+                this.bsRoles.DataSource = service.GetRoles(applicationId);
+                this.bsUsers.DataSource = service.GetUsers(applicationId);
 
             }
         }
 
-        private void btnUserNew_Click(object sender, EventArgs e)
-        {
-            UserDetail frmUserDetail = new UserDetail(UserDetailMode.Insert, service);
-            frmUserDetail.Show(this);
-        }
-
-
-        private void btnUserModify_Click(object sender, EventArgs e)
-        {
-
-           
-            if (dgvUsers.SelectedRows.Count == 1)
-            {
-                User user = (User)dgvUsers.SelectedRows[0].DataBoundItem; 
-                if (user != null)
-                {
-                   
-                    UserDetail frmUserDetail = new UserDetail(UserDetailMode.Update,service);
-                    frmUserDetail.Show(this);
-                    frmUserDetail.Initialize(user);
-                }
-            }
-        }
-
-        private void btnUserDelete_Click(object sender, EventArgs e)
-        {
-            if (dgvUsers.SelectedRows.Count == 1)
-            {
-                User user = (User)dgvUsers.SelectedRows[0].DataBoundItem;
-                if (user != null)
-                {
-                    service.DeleteUser(user.UserId);
-                }
-            }
-        }
-
-        private void btnRoleNew_Click(object sender, EventArgs e)
-        {
-            RoleDetail frmRoleDetail = new RoleDetail(RoleDetailMode.Insert, service,null);
-            frmRoleDetail.Show(this);
-        }          
-
-        private void btnRoleModify_Click(object sender, EventArgs e)
-        {
-            if (dgvRoles.SelectedRows.Count == 1)
-            {
-                Role role = (Role)dgvRoles.SelectedRows[0].DataBoundItem;
-                if (role != null)
-                {
-
-                    RoleDetail frmRoleDetail = new RoleDetail(RoleDetailMode.Update, service, role);
-                    frmRoleDetail.Show(this);
-                  
-                }
-            }
-        }
-
-        private void btnRoleDelete_Click(object sender, EventArgs e)
-        {
-            if (dgvRoles.SelectedRows.Count == 1)
-            {
-                Role role = (Role)dgvRoles.SelectedRows[0].DataBoundItem;
-                if (role != null)
-                {
-                    service.DeleteRole(role.RoleId);
-                }
-            }
-        }
+    
 
  
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.resx
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.resx	(revision 4646)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.resx	(revision 4647)
@@ -121,18 +121,48 @@
     <value>17, 17</value>
   </metadata>
-  <metadata name="RoleId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="RoleName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="LoweredRoleName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="Description.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <metadata name="bsRoles.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>154, 17</value>
   </metadata>
+  <metadata name="roleNameLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </metadata>
+  <metadata name="emailLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </metadata>
+  <metadata name="passwordSaltLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </metadata>
+  <metadata name="passwordQuestionLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </metadata>
+  <metadata name="passwordAnswerLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </metadata>
+  <metadata name="passwordLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </metadata>
+  <metadata name="isAnonymousLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </metadata>
+  <metadata name="isAnonymousLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </metadata>
+  <metadata name="passwordLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </metadata>
+  <metadata name="passwordAnswerLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </metadata>
+  <metadata name="passwordQuestionLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </metadata>
+  <metadata name="passwordSaltLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </metadata>
+  <metadata name="emailLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </metadata>
+  <metadata name="roleNameLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </metadata>
 </root>
Index: /branches/UserManagement/HeuristicLab.Services.Authentication/AuthenticationService.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication/AuthenticationService.cs	(revision 4646)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication/AuthenticationService.cs	(revision 4647)
@@ -6,4 +6,5 @@
 using HeuristicLab.Services.Authentication.DataAccess;
 using System.Data.Linq;
+using System.Diagnostics;
 
 namespace HeuristicLab.Services.Authentication
@@ -16,139 +17,728 @@
         public DataTransfer.User GetUser(Guid id)
         {
-
-            using (UserManagementDataContext db = new UserManagementDataContext())
-            {
-                Table<aspnet_User> UserTable = db.GetTable<aspnet_User>();
-
-                var User = from item in UserTable
-                           where item.UserId == id
-                          select item;
-               return Convert.ToDataTransfer((aspnet_User)User);
-            }
-         
+            using (UserManagementDataContext db = new UserManagementDataContext())
+            {
+                try
+                {
+                    Table<aspnet_User> UserTable = db.GetTable<aspnet_User>();
+
+                    var User = from item in UserTable
+                               where item.UserId == id
+                               select item;
+                    User user = Convert.ToDataTransfer((aspnet_User)User.Single());
+
+                    if (user == null) { return null; }
+
+                    Table<aspnet_Membership> MembershipTable = db.GetTable<aspnet_Membership>();
+
+                    var Membership = from item in MembershipTable
+                                     where item.UserId == id
+                                     select item;
+
+                    Membership membership = Convert.ToDataTransfer((aspnet_Membership)Membership.Single());
+
+                    if (membership == null) { return null; }
+                    user.Membership = membership;
+
+                    return user;
+
+
+                }
+                catch (Exception ex)
+                {
+                    Debug.WriteLine(ex.InnerException);
+                    return null;
+                }
+            }
+        }
+
+        public DataTransfer.User GetUser(Guid applicationId, string userName)
+        {
+            using (UserManagementDataContext db = new UserManagementDataContext())
+            {
+                try
+                {
+                    Table<aspnet_User> UserTable = db.GetTable<aspnet_User>();
+
+                    var User = from item in UserTable
+                               where item.UserName == userName && item.ApplicationId == applicationId
+                               select item;
+
+                    User user = Convert.ToDataTransfer((aspnet_User)User.Single());
+
+                    if (user == null) { return null; }
+
+                    Table<aspnet_Membership> MembershipTable = db.GetTable<aspnet_Membership>();
+
+                    var Membership = from item in MembershipTable
+                                     where item.UserId == user.UserId
+                                     select item;
+
+                    Membership membership = Convert.ToDataTransfer((aspnet_Membership)Membership.Single());
+
+                    if (membership == null) { return null; }
+                    user.Membership = membership;
+
+                    return user;
+
+
+
+
+                }
+                catch (Exception ex)
+                {
+                    Debug.WriteLine(ex.InnerException);
+                    return null;
+                }
+               }
+        }
+
+        public IEnumerable<DataTransfer.User> GetUsers(Guid applicationId)
+        {
+            List<DataTransfer.User> UserList = new List<DataTransfer.User>();
+            using (UserManagementDataContext db = new UserManagementDataContext())
+            {
+                try
+                {
+                    Table<aspnet_User> UserTable = db.GetTable<aspnet_User>();
+                    var Users = from item in UserTable
+                                where item.ApplicationId == applicationId
+                                select item;
+                    foreach (var eUser in Users)
+                    {
+
+                        User user = Convert.ToDataTransfer(eUser);
+
+                        if (user== null) { return null; }
+
+                        Table<aspnet_Membership> MembershipTable = db.GetTable<aspnet_Membership>();
+
+                        var Membership = from item in MembershipTable
+                                         where item.UserId == user.UserId
+                                         select item;
+
+                        Membership membership = Convert.ToDataTransfer((aspnet_Membership)Membership.Single());
+
+                        if (membership == null) { return null; }
+                        user.Membership = membership;
+
+                        UserList.Add(user);
+                    }
+                }
+                catch (Exception ex)
+                {
+                    Debug.WriteLine(ex.InnerException);
+                    return new List<User>();
+                }
+            }
+
+            return UserList;
+        }
+        public bool InsertUser(User user)
+        {
+            if (user != null)
+            {
+                using (UserManagementDataContext db = new UserManagementDataContext())
+                {
+                    try
+                    {
+
+                        Guid? userId = null;
+                        Application application = GetApplication(user.ApplicationId);
+                        if(application == null){return false;}
+                        if (user.Membership == null) { return false; }
+    
+                        int? passwordFormat = 1;
+                        int? uniqueEmail = null;
+                        int result = db.aspnet_Membership_CreateUser(application.ApplicationName, user.UserName, user.Membership.Password, user.Membership.PasswordSalt, user.Membership.Email, user.Membership.PasswordQuestion, user.Membership.PasswordAnswer, user.Membership.IsApproved, DateTime.UtcNow, DateTime.Now, uniqueEmail, passwordFormat, ref userId);
+                                                   
+                        if (result != 0)
+                        {
+                            return false;
+                        }
+
+                        if (userId != null)
+                        {
+                            return true;
+                        }
+                        else
+                        {
+                            return false;
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        Debug.WriteLine(ex.InnerException);
+                        return false;
+                    }
+                }
+           
+            }
+            return false;
+        }
+        public bool DeleteUser(Guid id)
+        {
+
+            User user = GetUser(id);
+            if (user != null)
+            {
+
+                using (UserManagementDataContext db = new UserManagementDataContext())
+                {
+                    try
+                    {
+                        Application application = GetApplication(user.ApplicationId);
+                        if (application == null)
+                        {
+                            return false;
+                        }
+
+                        int? tablesToDeleteFrom = 99;
+                        int? numTablesDeletedFrom = null;
+                        db.aspnet_Users_DeleteUser(application.ApplicationName, user.UserName, tablesToDeleteFrom, ref numTablesDeletedFrom);
+                       
+                        if (numTablesDeletedFrom != null)
+                        {
+                            return true;
+                        }
+                        else
+                        {
+                            return false;
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        Debug.WriteLine(ex.InnerException);
+                        return false;
+                    }
+                }
+            }
+            return false;
+        }
+
+        public bool UpdateUser(User user)
+        {
+           
+            if (user != null)
+            {
+
+                using (UserManagementDataContext db = new UserManagementDataContext())
+                {
+                    try
+                    {
+                        if (user.Membership == null)
+                        {
+                            return false;
+                        }
+
+                        Table<aspnet_User> UserTable = db.GetTable<aspnet_User>();
+
+                        var User = from item in UserTable
+                                   where item.UserId == user.UserId
+                                   select item;
+                       aspnet_User eUser = ((aspnet_User)User.Single());
+
+
+                       Table<aspnet_Membership> MembershipTable = db.GetTable<aspnet_Membership>();
+
+                       var Membership = from item in MembershipTable
+                                        where item.UserId == user.UserId
+                                        select item;
+
+                       aspnet_Membership eMembership = ((aspnet_Membership)Membership.Single());
+
+                        Convert.ToEntity(user, eUser);
+                        
+                        Convert.ToEntity(user.Membership, eMembership);
+                        if (eUser == null)
+                        {
+                           return false;
+                        }
+                        if (eMembership == null)
+                        {
+                            return false;
+                        }
+                        db.SubmitChanges();
+                    }
+                    catch (Exception ex)
+                    {
+                        Debug.WriteLine(ex.InnerException);
+                        return false;
+                    }
+                }
+            } return false;
+        }
+
+        #endregion
+
+
+        #region Role
+
+        public Role GetRole(Guid id)
+        {
+            using (UserManagementDataContext db = new UserManagementDataContext())
+            {
+                try
+                {
+                    Table<aspnet_Role> RoleTable = db.GetTable<aspnet_Role>();
+
+                    var Role = from item in RoleTable
+                               where item.RoleId == id
+                               select item;
+                    return Convert.ToDataTransfer((aspnet_Role)Role.Single());
+                }
+                catch (Exception ex)
+                {
+                    Debug.WriteLine(ex.InnerException);
+                    return null;
+                }
+            }
+        }
+
+        public Role GetRole(Guid applicationId, string roleName)
+        {
+            using (UserManagementDataContext db = new UserManagementDataContext())
+            {
+                try
+                {
+                    Table<aspnet_Role> RoleTable = db.GetTable<aspnet_Role>();
+
+                    var Role = from item in RoleTable
+                               where item.RoleName == roleName && item.ApplicationId == applicationId
+                               select item;
+                    return Convert.ToDataTransfer((aspnet_Role)Role.Single());
+                }
+                catch (Exception ex)
+                {
+                    Debug.WriteLine(ex.InnerException);
+                    return null;
+                }
+            }
+        }
+
+        public bool RoleExists(Guid roleId)
+        {
+            if (roleId != null)
+            {
+                using (UserManagementDataContext db = new UserManagementDataContext())
+                {
+                    try
+                    {
+                        Role role = GetRole(roleId);
+                        if (role == null)
+                        {
+                            return false;
+                        }
+                        Application application = GetApplication(role.ApplicationId);
+                        if (application == null)
+                        {
+                            return false;
+                        }
+
+                        int result = db.aspnet_Roles_RoleExists(application.ApplicationName, role.RoleName);
+                        
+                        return (result == 0);
+                    }
+                    catch (Exception ex)
+                    {
+                        Debug.Write(ex.InnerException);
+                        return false;
+                    }
+                }
+
+            } return false;
+        }
+
+        public IEnumerable<Role> GetRoles(Guid applicationId)
+        {
+            List<Role> RoleList = new List<Role>();
+
+            using (UserManagementDataContext db = new UserManagementDataContext())
+            {
+                try
+                {
+                   // db.aspnet_Roles_GetAllRoles(applicationName);
+                    Table<aspnet_Role> RoleTable = db.GetTable<aspnet_Role>();
+
+                    var Roles = from item in RoleTable
+                                where item.ApplicationId == applicationId
+                                select item;
+                    foreach (var Role in Roles)
+                    {
+                        RoleList.Add(Convert.ToDataTransfer((aspnet_Role)Role));
+                    }
+                }
+                catch (Exception ex)
+                {
+                    Debug.WriteLine(ex.InnerException);
+                    return new List<Role>();
+                }
+            }
+
+            return RoleList;
+        }
+        
+        public bool InsertRole(Role role)
+        {
+            if (role != null)
+            {
+                using (UserManagementDataContext db = new UserManagementDataContext())
+                {
+                    try
+                    {
+                        Application application = GetApplication(role.ApplicationId);
+                        if (application == null)
+                        {
+                            return false;
+                        }
+                        int result = db.aspnet_Roles_CreateRole(application.ApplicationName, role.RoleName);
+                       
+                        return (result == 0); // checken, welchen rückgabewert (in db, procedure)
+                      
+                    }
+                    catch (Exception ex)
+                    {
+                        Debug.WriteLine(ex.InnerException);
+                        return false;
+                    }
+                }
+              
+            }
+            return false;
+        }
+        public bool UpdateRole(Role role)
+        {
+
+            if (role != null)
+            {
+
+                using (UserManagementDataContext db = new UserManagementDataContext())
+                {
+                    try
+                    {
+
+                        Table<aspnet_Role> RoleTable = db.GetTable<aspnet_Role>();
+
+                        var Role = from item in RoleTable
+                                   where item.RoleId == role.RoleId
+                                   select item;
+                        aspnet_Role eRole = ((aspnet_Role)Role.Single());
+
+
+                        Convert.ToEntity(role, eRole);
+
+                        if (eRole != null)
+                        {
+                            db.SubmitChanges();
+                        }
+                        else
+                        {
+                            return false;
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        Debug.WriteLine(ex.InnerException);
+                        return false;
+                    }
+                }
+            } return false;
+        }
+
+        public bool DeleteRole(Guid id)
+        {
+            if (id != null)
+            {
+                using (UserManagementDataContext db = new UserManagementDataContext())
+                {
+                    try
+                    {
+                        Role role = GetRole(id);
+
+                        bool deleteOnlyIfRoleIsEmpty = true;
+                        if (role == null)
+                        {
+                            return false;
+                        }
+                        Application application = GetApplication(role.ApplicationId);
+                        if (application == null)
+                        {
+                            return false;
+                        }
+                        db.aspnet_Roles_DeleteRole(application.ApplicationName, role.RoleName, deleteOnlyIfRoleIsEmpty);
+
+                      
+
+                        return true;
+                    }
+                    catch (Exception ex)
+                    {
+                        Debug.WriteLine(ex.InnerException);
+                        return false;
+                    }
+                }
+              
+            }
+            return false;
+        }
+
+        public bool IsUserInRole(Guid roleId, Guid userId)
+        {
+            if (roleId != null && userId != null)
+            {
+                using (UserManagementDataContext db = new UserManagementDataContext())
+                {
+
+                    try
+                    {
+                        User user = GetUser(userId);
+                        if (user == null) { return false; }
+
+                        Application application = GetApplication(user.ApplicationId);
+                        if (application == null) { return false; }
+
+                        Role role = GetRole(roleId);
+                        if (role == null) { return false; }
+
+                        int result = db.aspnet_UsersInRoles_IsUserInRole(application.ApplicationName, user.UserName, role.RoleName);
+                       
+                        return (result == 0);
+                    }
+                    catch (Exception ex)
+                    {
+                        Debug.WriteLine(ex.InnerException);
+                        return false;
+
+                    }
+
+                }
+
+            } return false;
+        }
+
+        public bool AddUserToRole(Guid roleId, Guid userId)
+        {
+            using (UserManagementDataContext db = new UserManagementDataContext())
+            {
+                try
+                {
+                    Role role = GetRole(roleId);
+                    if (role == null)
+                    {
+                        return false;
+                    }
+                    Application application = GetApplication(role.ApplicationId);
+                    if (application == null)
+                    {
+                        return false;
+                    }
+                    User user = GetUser(userId);
+                    if (user == null)
+                    {
+                        return false;
+                    }
+
+                    db.aspnet_UsersInRoles_AddUsersToRoles(application.ApplicationName, user.UserName, role.RoleName,DateTime.Now);
+                    return true;
+                }
+                catch (Exception ex)
+                {
+                    Debug.WriteLine(ex.InnerException);
+                    return false;
+                }
+            }
+        
+        }
+        public bool RemoveUserFromRole(Guid roleId, Guid userId)
+        {
+            using (UserManagementDataContext db = new UserManagementDataContext())
+            {
+                try
+                {
+                    Role role = GetRole(roleId);
+                    if (role == null)
+                    {
+                        return false;
+                    }
+                    Application application = GetApplication(role.ApplicationId);
+                    if (application == null)
+                    {
+                        return false;
+                    }
+                    User user = GetUser(userId);
+                    if (user == null)
+                    {
+                        return false;
+                    }
+
+                   db.aspnet_UsersInRoles_RemoveUsersFromRoles(application.ApplicationName, user.UserName, role.RoleName);
+                    return true;
+                   
+                }
+                catch (Exception ex)
+                {
+                    Debug.WriteLine(ex.InnerException);
+                    return false;
+                }
+            }
+           
+        }
+        public IEnumerable<Role> GetRolesForUser(Guid userId)
+        {
+            List<Role> roles = new List<Role>();
+            using (UserManagementDataContext db = new UserManagementDataContext())
+            {
+                try
+                {
+                    User user = GetUser(userId);
+                    if (user == null)
+                    {
+                        return roles;
+                    }
+                    Application application = GetApplication(user.ApplicationId);
+                    if (application == null)
+                    {
+                        return roles;
+                    }
+                    
+
+                    ISingleResult<aspnet_UsersInRoles_GetRolesForUserResult> results = db.aspnet_UsersInRoles_GetRolesForUser(application.ApplicationName,user.UserName);
+                    foreach (aspnet_UsersInRoles_GetRolesForUserResult userInRole in results)
+                    {
+                        roles.Add(GetRole(application.ApplicationId,userInRole.RoleName));
+                    }
+                }
+                catch (Exception ex)
+                {
+                    Debug.WriteLine(ex.InnerException);
+                    return new List<Role>();
+                }
+            }
             
-        }
-        public IEnumerable<DataTransfer.User> GetUsers()
-        {
-            List<DataTransfer.User> UserList = new List<DataTransfer.User>();
-
-            using (UserManagementDataContext db = new UserManagementDataContext())
-            {
-                Table<aspnet_User> UserTable = db.GetTable<aspnet_User>();
-
-                var Users = from item in UserTable
-                           select item;
-                foreach (var User in Users)
-                {
-                    UserList.Add( Convert.ToDataTransfer((aspnet_User)User));
-                }
-            }
-
-
-            return UserList;
-        }
-        public bool InsertUser(User user)
-        {
-            // insert user
-            if (user != null)
-            {
-                using (UserManagementDataContext db = new UserManagementDataContext())
-                {
-                    try
-                    {
-                        aspnet_User userDa = Convert.ToEntity(user);
-                        db.aspnet_Users.InsertOnSubmit(userDa);
-                        db.SubmitChanges();
-                    }
-                    catch (Exception e)
-                    {
-                        return false;
-                    }
-                }
-                return true;
-            }
+            return roles;
+        }
+
+        public IEnumerable<User> GetUsersInRole(Guid roleId)
+        {
+            List<User> users = new List<User>();
+
+            using(UserManagementDataContext db = new UserManagementDataContext()){
+                try
+                {
+                    Role role = GetRole(roleId);
+
+                    if (role != null)
+                    {
+                        Application application = GetApplication(role.ApplicationId);
+
+                        if (application != null)
+                        {
+
+
+                            ISingleResult<aspnet_UsersInRoles_GetUsersInRolesResult> result = db.aspnet_UsersInRoles_GetUsersInRoles(application.ApplicationName, role.RoleName);
+                            foreach (aspnet_UsersInRoles_GetUsersInRolesResult usersInRole in result)
+                            {
+                                users.Add(GetUser(application.ApplicationId,usersInRole.UserName));
+                            }
+                        }
+                    }
+                }
+                catch (Exception ex)
+                {
+                    Debug.WriteLine(ex.InnerException);
+                    return new List<User>();
+                }
+            }
+
+            return users;
+        }
+
+        #endregion
+
+        #region Application
+
+        public Application InsertApplication(Application application)
+        {
+            if (application != null)
+            {
+                using (UserManagementDataContext db = new UserManagementDataContext())
+                {
+                    try
+                    {
+                        Guid? applicationId = null;
+                        int result = db.aspnet_Applications_CreateApplication(application.ApplicationName, ref applicationId);
+                        Console.WriteLine("result=" + result);
+                        if (applicationId != null)
+                        {
+                            application.ApplicationId = (Guid)applicationId;
+                            return application;
+                        }
+                        else
+                        {
+                            return null;
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        Debug.WriteLine(ex.InnerException);
+                        return null;
+                    }
+                }
+              
+            }
+            return null;
+        }
+
+        public bool DeleteApplication(Application application)
+        {
             return false;
         }
-        public bool DeleteUser(Guid id)
-        {
-
-            return false;
-        }
-        public bool UpdateUser(User user)
-        {
-            return false;
+
+        public Application GetApplication(Guid id)
+        {
+            using (UserManagementDataContext db = new UserManagementDataContext())
+            {
+                try
+                {
+                    Table<aspnet_Application> ApplicationTable = db.GetTable<aspnet_Application>();
+
+                    var Application = from item in ApplicationTable
+                                      where item.ApplicationId == id
+                                      select item;
+                    return Convert.ToDataTransfer((aspnet_Application)Application.Single());
+                }
+                catch (Exception ex)
+                {
+                    Debug.WriteLine(ex.InnerException);
+                    return null;
+                }
+            }
         }
 
         #endregion
 
-
-        #region Role
-
-        public Role GetRole(Guid id)
-        {
-            Role role = new Role();
-            // ...
-
-            return role;
-        }
-        public IEnumerable<Role> GetRoles()
-        {
-            List<Role> RoleList = new List<Role>();
-
-            using (UserManagementDataContext db = new UserManagementDataContext())
-            {
-                Table<aspnet_Role> RoleTable = db.GetTable<aspnet_Role>();
-
-                var Roles = from item in RoleTable
-                            select item;
-                foreach (var Role in Roles)
-                {
-                    RoleList.Add(Convert.ToDataTransfer((aspnet_Role)Role));
-                }
-            }
-
-            return RoleList;
-        }
-        public bool InsertRole(Role role)
-        {
-            if (role != null)
-            {
-                using (UserManagementDataContext db = new UserManagementDataContext())
-                {
-                    try
-                    {
-                        aspnet_Role roleDa = Convert.ToEntity(role);
-                        db.aspnet_Roles.InsertOnSubmit(roleDa);
-                        db.SubmitChanges();
-                    }
-                    catch (Exception e)
-                    {
-                        return false;
-                    }
-                }
-                return true;
-            }
-            return false;
-        }
-        public bool UpdateRole(Role role)
-        {
-            return false;
-        }
-        public bool DeleteRole(Guid id)
-        {
-            return false;
-        }
-        public bool AddRoleToUser(Guid roleId, Guid userId)
-        {
-            return false;
-        }
-        public bool RemoveRoleFromUser(Guid roleId, Guid userId)
-        {
-            return false;
-        }
-        public IEnumerable<Role> GetRolesForUser(Guid userId)
-        {
-            List<Role> roles = new List<Role>();
-            return roles;
+        #region Membership
+
+        public Membership InsertMembership(Membership membership)
+        {
+
+            if (membership != null)
+            {
+                using (UserManagementDataContext db = new UserManagementDataContext())
+                {
+                    try
+                    {
+                        Application application = GetApplication(membership.ApplicationId);
+                        if (application == null) { return null; }
+
+                    }
+                    catch (Exception ex)
+                    {
+                        Debug.WriteLine(ex.InnerException);
+                        return null;
+                    }
+                }
+            }
+            return null;
         }
 
Index: /branches/UserManagement/HeuristicLab.Services.Authentication/Convert.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication/Convert.cs	(revision 4646)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication/Convert.cs	(revision 4647)
@@ -139,4 +139,8 @@
                 UserId = source.UserId,
                 Password = source.Password,
+                PasswordAnswer = source.PasswordAnswer,
+                PasswordSalt = source.PasswordSalt,
+                PasswordQuestion = source.PasswordQuestion,
+               
                 Email = source.Email,
                 LoweredEmail = source.LoweredEmail,
@@ -149,4 +153,5 @@
                 Comment = source.Comment
 
+                
             };
         }
@@ -165,4 +170,8 @@
                 UserId = source.UserId,
                 Password = source.Password,
+                PasswordAnswer = source.PasswordAnswer,
+                PasswordSalt = source.PasswordSalt,
+                PasswordQuestion = source.PasswordQuestion,
+               
                 Email = source.Email,
                 LoweredEmail = source.LoweredEmail,
@@ -189,4 +198,8 @@
                 target.UserId = source.UserId;
                 target.Password = source.Password;
+                target.PasswordAnswer = source.PasswordAnswer;
+                target.PasswordSalt = source.PasswordSalt;
+                target.PasswordQuestion = source.PasswordQuestion;
+               
                 target.Email = source.Email;
                 target.LoweredEmail = source.LoweredEmail;
Index: /branches/UserManagement/HeuristicLab.Services.Authentication/HeuristicLab.Services.Authentication.csproj
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication/HeuristicLab.Services.Authentication.csproj	(revision 4646)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication/HeuristicLab.Services.Authentication.csproj	(revision 4647)
@@ -60,4 +60,7 @@
     </ProjectReference>
   </ItemGroup>
+  <ItemGroup>
+    <WCFMetadata Include="Service References\" />
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
Index: /branches/UserManagement/HeuristicLab.Services.Authentication/Interfaces/IAuthenticationService.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication/Interfaces/IAuthenticationService.cs	(revision 4646)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication/Interfaces/IAuthenticationService.cs	(revision 4647)
@@ -16,5 +16,8 @@
 
         [OperationContract]
-        IEnumerable<User> GetUsers();
+        User GetUser(Guid applicationId, string userName);
+
+        [OperationContract]
+        IEnumerable<User> GetUsers(Guid applicationId);
 
         [OperationContract]
@@ -27,4 +30,13 @@
         bool UpdateUser(User user);
 
+        [OperationContract]
+        bool AddUserToRole(Guid roleId, Guid userId);
+
+        [OperationContract]
+        bool RemoveUserFromRole(Guid roleId, Guid userId);
+
+        [OperationContract]
+        IEnumerable<Role> GetRolesForUser(Guid userId);
+
         #endregion
 
@@ -33,8 +45,17 @@
         [OperationContract]
         Role GetRole(Guid id);
+        
+        [OperationContract]
+        Role GetRole(Guid applicationId, string roleName);
 
         [OperationContract]
-        IEnumerable<Role> GetRoles();
+        IEnumerable<Role> GetRoles(Guid applicationId);
 
+        [OperationContract]
+        bool RoleExists(Guid roleId);
+
+        [OperationContract]
+        bool IsUserInRole(Guid roleId, Guid userId);
+        
         [OperationContract]
         bool InsertRole(Role role);
@@ -47,11 +68,24 @@
 
         [OperationContract]
-        bool AddRoleToUser(Guid roleId, Guid userId);
+        IEnumerable<User> GetUsersInRole(Guid roleId);
+       
+        #endregion
+
+        #region Application
 
         [OperationContract]
-        bool RemoveRoleFromUser(Guid roleId, Guid userId);
+        Application GetApplication(Guid id);
 
         [OperationContract]
-        IEnumerable<Role> GetRolesForUser(Guid userId);
+        Application InsertApplication(Application application);
+
+        [OperationContract]
+        bool DeleteApplication(Application application);
+        #endregion
+
+        #region Membership
+
+        [OperationContract]
+        Membership InsertMembership(Membership membership);
 
         #endregion
