- Timestamp:
- 09/23/11 20:13:55 (13 years ago)
- Location:
- branches/ClientUserManagement
- Files:
-
- 7 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ClientUserManagement
- Property svn:ignore
-
old new 1 1 *.suo 2 *.testsettings 3 HeuristicLab.Services.Access.vsmdi
-
- Property svn:ignore
-
branches/ClientUserManagement/HeuristicLab.Services.Access/3.3
- Property svn:ignore
-
old new 2 2 bin 3 3 obj 4 HeuristicLab.Services.Access-3.3.csproj.user
-
- Property svn:ignore
-
branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/AccessService.cs
r6815 r6825 24 24 namespace HeuristicLab.Services.Access { 25 25 [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] 26 public class AccessService : IAccessService { 27 #region IAccessService Members 26 public class AccessService { 28 27 29 public bool ClientExists(System.Guid id) {30 throw new System.NotImplementedException();31 }32 33 public DataTransfer.Client GetClient(System.Guid id) {34 throw new System.NotImplementedException();35 }36 37 public System.Collections.Generic.IEnumerable<DataTransfer.Client> GetClients() {38 throw new System.NotImplementedException();39 }40 41 public System.Guid AddClient(DataTransfer.Client client) {42 throw new System.NotImplementedException();43 }44 45 public void UpdateClient(DataTransfer.Client client) {46 throw new System.NotImplementedException();47 }48 49 public void DeleteClient(DataTransfer.Client client) {50 throw new System.NotImplementedException();51 }52 53 public DataTransfer.ClientLog GetLastClientLog(System.Guid clientId) {54 throw new System.NotImplementedException();55 }56 57 public System.Collections.Generic.IEnumerable<DataTransfer.ClientLog> GetClientLogs(System.Guid clientId) {58 throw new System.NotImplementedException();59 }60 61 public System.Collections.Generic.IEnumerable<DataTransfer.ClientLog> GetClientLogsSince(System.DateTime startDate) {62 throw new System.NotImplementedException();63 }64 65 public void AddClientLogEntry(DataTransfer.ClientLog log) {66 throw new System.NotImplementedException();67 }68 69 public void DeleteClientLogEntry(DataTransfer.ClientLog log) {70 throw new System.NotImplementedException();71 }72 73 public System.Collections.Generic.IEnumerable<DataTransfer.ClientGroup> GetClientGroups() {74 throw new System.NotImplementedException();75 }76 77 public System.Guid AddClientGroup(DataTransfer.ClientGroup group) {78 throw new System.NotImplementedException();79 }80 81 public void UpdateClientGroup(DataTransfer.ClientGroup group) {82 throw new System.NotImplementedException();83 }84 85 public void DeleteClientGroup(DataTransfer.ClientGroup group) {86 throw new System.NotImplementedException();87 }88 89 public void Login() {90 throw new System.NotImplementedException();91 }92 93 public System.Collections.Generic.IEnumerable<DataTransfer.User> GetUsers() {94 throw new System.NotImplementedException();95 }96 97 public DataTransfer.User AddUser(DataTransfer.User user) {98 throw new System.NotImplementedException();99 }100 101 public void DeleteUser(DataTransfer.User user) {102 throw new System.NotImplementedException();103 }104 105 public void UpdateUser(DataTransfer.User user) {106 throw new System.NotImplementedException();107 }108 109 public void AddUserToRole(DataTransfer.Role role, DataTransfer.User user) {110 throw new System.NotImplementedException();111 }112 113 public void RemoveUserFromRole(DataTransfer.Role role, DataTransfer.User user) {114 throw new System.NotImplementedException();115 }116 117 public void ResetPassword(DataTransfer.User user, string password) {118 throw new System.NotImplementedException();119 }120 121 public System.Collections.Generic.IEnumerable<DataTransfer.Role> GetRoles() {122 throw new System.NotImplementedException();123 }124 125 public DataTransfer.Role AddRole(DataTransfer.Role role) {126 throw new System.NotImplementedException();127 }128 129 public void UpdateRole(DataTransfer.Role role) {130 throw new System.NotImplementedException();131 }132 133 public void DeleteRole(DataTransfer.Role role) {134 throw new System.NotImplementedException();135 }136 137 public System.Collections.Generic.IEnumerable<DataTransfer.Role> GetUserRoles(DataTransfer.User user) {138 throw new System.NotImplementedException();139 }140 141 public System.Collections.Generic.IEnumerable<DataTransfer.UserGroup> GetUserGroups() {142 throw new System.NotImplementedException();143 }144 145 public DataTransfer.UserGroup AddUserGroup(DataTransfer.UserGroup group) {146 throw new System.NotImplementedException();147 }148 149 public void UpdateUserGroup(DataTransfer.UserGroup group) {150 throw new System.NotImplementedException();151 }152 153 public void DeleteUserGroup(DataTransfer.UserGroup group) {154 throw new System.NotImplementedException();155 }156 157 #endregion158 28 } 159 29 } -
branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/Convert.cs
r6820 r6825 20 20 #endregion 21 21 22 using System; 23 using System.Linq; 22 24 using DA = HeuristicLab.Services.Access.DataAccess; 23 25 using DT = HeuristicLab.Services.Access.DataTransfer; 26 24 27 25 28 namespace HeuristicLab.Services.ClientManagement { … … 31 34 Id = source.Id, 32 35 Description = source.Description, 33 Name = source.Name, 34 Type = source.Type 36 Name = source.Name 35 37 }; 36 38 } … … 40 42 Id = source.Id, 41 43 Description = source.Description, 42 Name = source.Name, 43 Type = source.Type 44 }; 45 } 46 #endregion 47 48 #region Group 49 public static DT.ClientGroup ToDto(DA.Group source) { 44 Name = source.Name 45 }; 46 } 47 #endregion 48 49 #region ClientGroup 50 public static DT.ClientGroup ToDto(DA.ClientGroup source) { 50 51 return new DT.ClientGroup() { 51 52 Id = source.Id, 52 53 Description = source.Description, 53 Name = source.Name, 54 Type = source.Type 55 }; 56 } 57 58 public static DA.Group ToEntity(DT.ClientGroup source) { 59 return new DA.Group() { 60 Id = source.Id, 61 Description = source.Description, 62 Name = source.Name, 63 Type = source.Type 54 Name = source.Name 55 }; 56 } 57 58 public static DA.ClientGroup ToEntity(DT.ClientGroup source) { 59 return new DA.ClientGroup() { 60 Id = source.Id, 61 Description = source.Description, 62 Name = source.Name, 63 64 }; 65 } 66 #endregion 67 68 #region Country 69 public static DT.Country ToDto(DA.Country source) { 70 return new DT.Country() { 71 Id = source.Id, 72 Name = source.Name 73 }; 74 } 75 76 public static DA.Country ToEntity(DT.Country source) { 77 return new DA.Country() { 78 Id = source.Id, 79 Name = source.Name, 80 81 }; 82 } 83 #endregion 84 85 #region OperatingSystem 86 public static DT.OperatingSystem ToDto(DA.OperatingSystem source) { 87 return new DT.OperatingSystem() { 88 Id = source.Id, 89 Name = source.Name 90 }; 91 } 92 93 public static DA.OperatingSystem ToEntity(DT.OperatingSystem source) { 94 return new DA.OperatingSystem() { 95 Id = source.Id, 96 Name = source.Name, 97 98 }; 99 } 100 #endregion 101 102 #region ClientType 103 public static DT.ClientType ToDto(DA.ClientType source) { 104 return new DT.ClientType() { 105 Id = source.Id, 106 Name = source.Name 107 }; 108 } 109 110 public static DA.ClientType ToEntity(DT.ClientType source) { 111 return new DA.ClientType() { 112 Id = source.Id, 113 Name = source.Name, 114 115 }; 116 } 117 #endregion 118 119 #region ClientConfiguration 120 public static DT.ClientConfiguration ToDto(DA.ClientConfiguration source) { 121 return new DT.ClientConfiguration() { 122 Id = source.Id, 123 Hash = source.Hash, 124 Description = source.Description 125 }; 126 } 127 128 public static DA.ClientConfiguration ToEntity(DT.ClientConfiguration source) { 129 return new DA.ClientConfiguration() { 130 Id = source.Id, 131 Hash = source.Hash, 132 Description = source.Description 133 }; 134 } 135 #endregion 136 137 #region Plugin 138 public static DT.Plugin ToDto(DA.Plugin source) { 139 return new DT.Plugin() { 140 Id = source.Id, 141 Name = source.Name, 142 StrongName = source.StrongName, 143 Version = source.Version 144 }; 145 } 146 147 public static DA.Plugin ToEntity(DT.Plugin source) { 148 return new DA.Plugin() { 149 Id = source.Id, 150 Name = source.Name, 151 StrongName = source.StrongName, 152 Version = source.Version 64 153 }; 65 154 } … … 72 161 Description = source.Description, 73 162 Name = source.Name, 74 Type = source.Type, 75 Country = source.Country, 163 ClientConfiguration = ToDto(source.ClientConfiguration), 76 164 HeuristicLabVersion = source.HeuristicLabVersion, 77 IPAddress = source.IPAddress, 78 MemorySize = source.MemorySize, 79 NumberOfCores = source.NumberOfCores, 80 OperatingSystem = source.OperatingSystem, 165 Country = ToDto(source.Country), 166 OperatingSystem = ToDto(source.OperatingSystem), 167 MemorySize = source.MemorySize.GetValueOrDefault(), 168 Timestamp = source.Timestamp.GetValueOrDefault(), 169 NumberOfCores = source.NumberOfCores.GetValueOrDefault(), 81 170 ProcessorType = source.ProcessorType, 82 ClientType = source.ClientType171 ClientType = ToDto(source.ClientType) 83 172 }; 84 173 } … … 89 178 Description = source.Description, 90 179 Name = source.Name, 91 Type = source.Type, 92 Country = source.Country, 180 ClientConfiguration = ToEntity(source.ClientConfiguration), 93 181 HeuristicLabVersion = source.HeuristicLabVersion, 94 IPAddress = source.IPAddress, 182 Country = ToEntity(source.Country), 183 OperatingSystem = ToEntity(source.OperatingSystem), 95 184 MemorySize = source.MemorySize, 185 Timestamp = source.Timestamp, 96 186 NumberOfCores = source.NumberOfCores, 97 OperatingSystem = source.OperatingSystem,98 187 ProcessorType = source.ProcessorType, 99 ClientType = source.ClientType188 ClientType = ToEntity(source.ClientType) 100 189 }; 101 190 } … … 107 196 Timestamp = source.Timestamp, 108 197 ResourceId = source.ResourceId, 109 Exception = source.Exception,110 198 Message = source.Message 111 199 }; … … 116 204 Timestamp = source.Timestamp, 117 205 ResourceId = source.ResourceId, 206 Message = source.Message 207 }; 208 } 209 #endregion 210 211 #region ClientError 212 public static DT.ClientError ToDto(DA.ClientError source) { 213 return new DT.ClientError() { 214 Id = source.Id, 215 Timestamp = source.Timestamp, 118 216 Exception = source.Exception, 119 Message = source.Message 120 }; 217 UserComment = source.UserComment, 218 ConfigDump = source.ConfigDump, 219 ClientId = source.ClientId.GetValueOrDefault(), 220 UserId = source.UserId.GetValueOrDefault() 221 }; 222 } 223 224 public static DA.ClientError ToEntity(DT.ClientError source) { 225 return new DA.ClientError() { 226 Id = source.Id, 227 Timestamp = source.Timestamp, 228 Exception = source.Exception, 229 UserComment = source.UserComment, 230 ConfigDump = source.ConfigDump, 231 ClientId = source.ClientId, 232 UserId = source.UserId 233 }; 234 } 235 #endregion 236 237 #region UserGroup 238 public static DT.UserGroup ToDto(DA.UserGroup source) { 239 return new DT.UserGroup() { 240 Id = source.Id, 241 Name = source.Name 242 }; 243 } 244 245 public static DA.UserGroup ToEntity(DT.UserGroup source) { 246 return new DA.UserGroup() { 247 Id = source.Id, 248 Name = source.Name 249 }; 250 } 251 #endregion 252 253 #region User 254 public static DT.User ToDto(DA.User source, DA.aspnet_User aspUserSource, DA.aspnet_Membership aspMembershipSource) { 255 return new DT.User() { 256 Id = source.Id, 257 FullName = source.FullName, 258 Comment = aspMembershipSource.Comment, 259 CreationDate = aspMembershipSource.CreateDate, 260 Email = aspMembershipSource.Email, 261 IsApproved = aspMembershipSource.IsApproved, 262 LastActivityDate = aspUserSource.LastActivityDate, 263 LastLoginDate = aspMembershipSource.LastLoginDate, 264 LastPasswordChangedDate = aspMembershipSource.LastPasswordChangedDate, 265 UserName = aspUserSource.UserName 266 }; 267 } 268 269 public static void ToEntity(DT.User source, out DA.User accessUser, out DA.aspnet_User aspUser, out DA.aspnet_Membership aspMembership, out bool userExistsInASP) { 270 userExistsInASP = false; 271 accessUser = new DA.User(); 272 aspUser = new DA.aspnet_User(); 273 aspMembership = new DA.aspnet_Membership(); 274 275 if (source.Id != Guid.Empty) { 276 using (DA.ASPNETAuthenticationDataContext context = new DA.ASPNETAuthenticationDataContext()) { 277 var userCol = context.aspnet_Users.Where(s => s.UserId == source.Id); 278 var membershipCol = context.aspnet_Memberships.Where(s => s.UserId == source.Id); 279 if (userCol.Count() > 0 && membershipCol.Count() > 0) { 280 aspUser = userCol.First(); 281 aspMembership = membershipCol.First(); 282 userExistsInASP = true; 283 } 284 } 285 } 286 287 accessUser.Id = source.Id; 288 accessUser.FullName = source.FullName; 289 290 aspUser.UserId = source.Id; 291 aspUser.LastActivityDate = source.LastActivityDate; 292 aspUser.UserName = source.UserName; 293 294 aspMembership.UserId = source.Id; 295 aspMembership.Comment = source.Comment; 296 aspMembership.CreateDate = source.CreationDate; 297 aspMembership.Email = source.Email; 298 aspMembership.IsApproved = source.IsApproved; 299 aspMembership.LastLoginDate = source.LastLoginDate; 300 aspMembership.LastPasswordChangedDate = source.LastPasswordChangedDate; 121 301 } 122 302 #endregion -
branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/DataTransfer/Client.cs
r6820 r6825 20 20 #endregion 21 21 22 using System; 22 23 using System.Runtime.Serialization; 23 24 … … 26 27 public class Client : Resource { 27 28 [DataMember] 28 public string ProcessorType{ get; set; }29 public ClientConfiguration ClientConfiguration { get; set; } 29 30 [DataMember] 30 public int? NumberOfCores { get; set; } 31 [DataMember] 32 public int? MemorySize { get; set; } 33 [DataMember] 34 public string OperatingSystem { get; set; } 35 [DataMember] 36 public string IPAddress { get; set; } 31 public ClientType ClientType { get; set; } 37 32 [DataMember] 38 33 public string HeuristicLabVersion { get; set; } 39 34 [DataMember] 40 public stringCountry { get; set; }35 public Country Country { get; set; } 41 36 [DataMember] 42 public string ClientType { get; set; } 37 public HeuristicLab.Services.Access.DataTransfer.OperatingSystem OperatingSystem { get; set; } 38 [DataMember] 39 public int MemorySize { get; set; } 40 [DataMember] 41 public DateTime Timestamp { get; set; } 42 [DataMember] 43 public int NumberOfCores { get; set; } 44 [DataMember] 45 public string ProcessorType { get; set; } 43 46 } 44 47 } -
branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/DataTransfer/ClientLog.cs
r6815 r6825 31 31 [DataMember] 32 32 public string Message { get; set; } 33 [DataMember]34 public string Exception { get; set; }35 33 } 36 34 } -
branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/DataTransfer/Resource.cs
r6815 r6825 21 21 22 22 using System; 23 using System.Collections.Generic;24 23 using System.Runtime.Serialization; 25 24 … … 33 32 [DataMember] 34 33 public string Description { get; set; } 35 [DataMember]36 public string Type { get; set; }37 [DataMember]38 public IEnumerable<ClientGroup> ParentGroups { get; set; }39 34 } 40 35 } -
branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/DataTransfer/User.cs
r6820 r6825 26 26 namespace HeuristicLab.Services.Access.DataTransfer { 27 27 [DataContract] 28 public class User : AccessItem{28 public class User : UserGroupBase { 29 29 [DataMember] 30 30 public string UserName { get; set; } -
branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/DataTransfer/UserGroup.cs
r6820 r6825 20 20 #endregion 21 21 22 using System;23 22 using System.Runtime.Serialization; 24 23 25 24 namespace HeuristicLab.Services.Access.DataTransfer { 26 25 [DataContract] 27 public class UserGroup : AccessItem{26 public class UserGroup : UserGroupBase { 28 27 [DataMember] 29 28 public string Name { get; set; } 30 [DataMember]31 public Guid ParentUserGroup { get; set; }32 29 } 33 30 } -
branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/HeuristicLab.Services.Access-3.3.csproj
r6821 r6825 45 45 <Reference Include="System.Core" /> 46 46 <Reference Include="System.Data" /> 47 <Reference Include="System.Data.Linq" /> 47 48 <Reference Include="System.Runtime.Serialization" /> 48 49 <Reference Include="System.ServiceModel" /> … … 53 54 <Compile Include="Convert.cs" /> 54 55 <Compile Include="DataTransfer\Client.cs" /> 56 <Compile Include="DataTransfer\ClientConfiguration.cs" /> 57 <Compile Include="DataTransfer\ClientError.cs" /> 55 58 <Compile Include="DataTransfer\ClientLog.cs" /> 56 59 <Compile Include="DataTransfer\AccessItem.cs" /> 57 60 <Compile Include="DataTransfer\ClientGroup.cs" /> 61 <Compile Include="DataTransfer\ClientType.cs" /> 62 <Compile Include="DataTransfer\Country.cs" /> 63 <Compile Include="DataTransfer\OperatingSystem.cs" /> 64 <Compile Include="DataTransfer\Plugin.cs" /> 58 65 <Compile Include="DataTransfer\Resource.cs" /> 59 66 <Compile Include="DataTransfer\Role.cs" /> 60 67 <Compile Include="DataTransfer\User.cs" /> 61 68 <Compile Include="DataTransfer\UserGroup.cs" /> 69 <Compile Include="DataTransfer\UserGroupBase.cs" /> 62 70 <Compile Include="IAccessService.cs" /> 63 71 <Compile Include="Properties\AssemblyInfo.cs" /> -
branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/IAccessService.cs
r6815 r6825 72 72 73 73 [OperationContract] 74 IEnumerable<ClientGroup> GetParentGroups(Guid id); 75 76 [OperationContract] 74 77 Guid AddClientGroup(ClientGroup group); 75 78
Note: See TracChangeset
for help on using the changeset viewer.