Changeset 7945
- Timestamp:
- 06/01/12 12:48:54 (12 years ago)
- Location:
- branches/ClientUserManagement
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ClientUserManagement/HeuristicLab.Clients.Access/3.3/ClientInformation.cs
r7553 r7945 76 76 try { 77 77 AccessClient.CallAccessService(x => clientInfo = x.GetClient(clientId)); 78 if (clientInfo != null) 78 if (clientInfo != null) { 79 79 clientExists = true; 80 if (clientInfo.HeuristicLabVersion != ClientInformationUtils.GetHLVersion()) { 81 clientInfo.HeuristicLabVersion = ClientInformationUtils.GetHLVersion(); 82 AccessClient.CallAccessService(x => x.UpdateClient(clientInfo)); 83 } 84 } 80 85 errorOccured = false; 81 86 occuredException = null; -
branches/ClientUserManagement/HeuristicLab.Services.Access.DataAccess/3.3/AccessService.dbml
r7619 r7945 1 1 <?xml version="1.0" encoding="utf-8"?><Database Name="HeuristicLab.ClientManagement" Class="AccessServiceDataContext" xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007"> 2 <Connection Mode="AppSettings" ConnectionString="Data Source=.;Initial Catalog=HeuristicLab. ClientManagement;Integrated Security=True" SettingsObjectName="HeuristicLab.Services.Access.DataAccess.Properties.Settings" SettingsPropertyName="HeuristicLab_ClientManagementConnectionString" Provider="System.Data.SqlClient" />2 <Connection Mode="AppSettings" ConnectionString="Data Source=.;Initial Catalog=HeuristicLab.AccessService;Integrated Security=True" SettingsObjectName="HeuristicLab.Services.Access.DataAccess.Properties.Settings" SettingsPropertyName="HeuristicLab_ClientManagementConnectionString" Provider="System.Data.SqlClient" /> 3 3 <Table Name="dbo.Resource" Member="Resources"> 4 4 <Type Name="Resource" InheritanceCode="Resource" IsInheritanceDefault="true"> 5 5 <Column Name="Id" AutoSync="OnInsert" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" /> 6 6 <Column Name="Name" Type="System.String" DbType="NVarChar(MAX) NOT NULL" CanBeNull="false" /> 7 <Column Name="Description" Type="System.String" DbType="NVarChar(MAX)" CanBeNull=" false" />7 <Column Name="Description" Type="System.String" DbType="NVarChar(MAX)" CanBeNull="true" /> 8 8 <Column Name="Type" Type="System.String" DbType="NVarChar(MAX) NOT NULL" CanBeNull="false" IsDiscriminator="true" /> 9 9 <Association Name="Resource_ResourceResourceGroup" Member="ResourceResourceGroupsChilds" Storage="_ResourceResourceGroups" ThisKey="Id" OtherKey="ResourceGroupId" Type="ResourceResourceGroup" /> … … 12 12 <Association Name="Resource_ResourcePlugin" Member="ResourcePlugins" ThisKey="Id" OtherKey="ResourceId" Type="ResourcePlugin" /> 13 13 <Type Name="Client" InheritanceCode="Client"> 14 <Column Name="HeuristicLabVersion" Type="System.String" DbType="NVarChar(MAX)" CanBeNull=" false" />14 <Column Name="HeuristicLabVersion" Type="System.String" DbType="NVarChar(MAX)" CanBeNull="true" /> 15 15 <Column Name="MemorySize" Type="System.Int32" DbType="Int" CanBeNull="true" /> 16 16 <Column Name="Timestamp" Type="System.DateTime" DbType="DateTime" CanBeNull="true" /> -
branches/ClientUserManagement/HeuristicLab.Services.Access.DataAccess/3.3/AccessService.dbml.layout
r7619 r7945 47 47 </nodes> 48 48 </inheritanceConnector> 49 <inheritanceConnector edgePoints="[(5.625 : 2.07859537760417); (5.625 : 2.26); ( 5.79166666666667 : 2.26 : JumpStart); (5.98958333333333 : 2.26 : JumpEnd); (7 : 2.26); (7 : 2.5)]" fixedFrom="NotFixed" fixedTo="NotFixed" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">49 <inheritanceConnector edgePoints="[(5.625 : 2.07859537760417); (5.625 : 2.26); (7 : 2.26); (7 : 2.5)]" fixedFrom="NotFixed" fixedTo="NotFixed" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62"> 50 50 <nodes> 51 51 <classShapeMoniker Id="20c6e07e-aa12-43dc-87d6-dae5bf173da4" /> … … 179 179 </nodes> 180 180 </associationConnector> 181 <associationConnector edgePoints="[(2.5 : 2.72199625651042); ( 3.75 : 2.72199625651042)]" fixedFrom="NotFixed" fixedTo="NotFixed">181 <associationConnector edgePoints="[(2.5 : 2.72199625651042); (2.79166666666667 : 2.72199625651042 : JumpStart); (2.95833333333333 : 2.72199625651042 : JumpEnd); (3.75 : 2.72199625651042)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 182 182 <AssociationMoniker Name="/AccessServiceDataContext/OperatingSystem/OperatingSystem_Client" /> 183 183 <nodes> -
branches/ClientUserManagement/HeuristicLab.Services.Access.DataAccess/3.3/AccessService.designer.cs
r7619 r7945 3 3 // <auto-generated> 4 4 // This code was generated by a tool. 5 // Runtime Version:4.0.30319.5 305 // Runtime Version:4.0.30319.544 6 6 // 7 7 // Changes to this file may cause incorrect behavior and will be lost if … … 284 284 } 285 285 286 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Description", DbType="NVarChar(MAX)" , CanBeNull=false)]286 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Description", DbType="NVarChar(MAX)")] 287 287 public string Description 288 288 { … … 511 511 } 512 512 513 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_HeuristicLabVersion", DbType="NVarChar(MAX)" , CanBeNull=false)]513 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_HeuristicLabVersion", DbType="NVarChar(MAX)")] 514 514 public string HeuristicLabVersion 515 515 { -
branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/AccessService.cs
r7936 r7945 139 139 140 140 public void UpdateClient(DT.Client client) { 141 AddClient(client); 141 string country = string.Empty; 142 143 OperationContext opContext = OperationContext.Current; 144 145 if (opContext != null) { 146 MessageProperties properties = opContext.IncomingMessageProperties; 147 RemoteEndpointMessageProperty endpoint = properties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty; 148 string ipAdr = endpoint.Address; 149 country = GeoIPLookupService.Instance.GetCountryName(ipAdr); 150 } 151 152 using (DA.AccessServiceDataContext context = new DA.AccessServiceDataContext()) { 153 var query = from c in context.Resources.OfType<DA.Client>() 154 where c.Id == client.Id 155 select c; 156 157 if (query.Count() > 0) { 158 var entity = query.First(); 159 160 if (country != string.Empty) { 161 var countryQuery = from c in context.GetTable<DA.Country>() 162 where c.Name == country 163 select c; 164 if (countryQuery.Count() > 0) { 165 entity.CountryId = countryQuery.First().Id; 166 } 167 } 168 169 entity.Name = client.Name; 170 entity.Description = client.Description; 171 entity.HeuristicLabVersion = client.HeuristicLabVersion; 172 entity.Timestamp = DateTime.Now; 173 174 context.SubmitChanges(); 175 } 176 } 142 177 } 143 178
Note: See TracChangeset
for help on using the changeset viewer.