diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-08-12 18:23:05 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-08-12 18:23:05 +0300 |
| commit | 819b2bc2094baac1ddf4e6e84cd308e96eb17d8e (patch) | |
| tree | 8b77801f6ccc5aea874583c334f3bf71ff6083d0 /Software/Visual_Studio/Web/Tango.MachineService/Controllers | |
| parent | da8c561c85c9ee296cb18796e5db95ca759d1063 (diff) | |
| parent | a4a2a94fe295f57c462eb3cd2c24c9ba512de5a6 (diff) | |
| download | Tango-819b2bc2094baac1ddf4e6e84cd308e96eb17d8e.tar.gz Tango-819b2bc2094baac1ddf4e6e84cd308e96eb17d8e.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/Web/Tango.MachineService/Controllers')
| -rw-r--r-- | Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs index aed78f1a6..c377afb97 100644 --- a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs +++ b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs @@ -80,22 +80,17 @@ namespace Tango.MachineService.Controllers String serial_number = request.SerialNumber; var machine = db.Machines.SingleOrDefault(x => x.SerialNumber == serial_number); + var machine_version = db.MachineVersions.SingleOrDefault(x => x.Guid == machine.MachineVersionGuid); if (machine == null) { OnError(HttpStatusCode.NotFound, "The specified serial number could not be found."); } - var configuration = db.Configurations.SingleOrDefault(x => x.Guid == machine.ConfigurationGuid); + var latest_machine_version = db.TangoVersions.Where(x => x.MachineVersionGuid == machine_version.Guid).ToList().OrderByDescending(x => Version.Parse(x.Version)).FirstOrDefault(); - var appVersion = db.ApplicationVersions.SingleOrDefault(x => x.Guid == configuration.ApplicationVersionGuid); - var embeddedVersion = db.EmbeddedSoftwareVersions.SingleOrDefault(x => x.Guid == configuration.EmbeddedSoftwareVersionGuid); - - response.ApplicationVersion = appVersion.Version; - response.ApplicationFtpFilePath = appVersion.FtpFilePath; - - response.EmbeddedVersion = embeddedVersion.Version; - response.EmbeddedFtpFilePath = embeddedVersion.FtpFilePath; + response.Version = latest_machine_version.Version; + response.FilePath = latest_machine_version.FtpFilePath; response.DbAddress = GetRemoteServerAddress(); response.FtpAddress = GetFtpAddress(); |
