diff options
| author | Avi Levkovich <avi@twine-s.com> | 2018-08-12 10:35:40 +0300 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2018-08-12 10:35:40 +0300 |
| commit | c10fb2bcae7143bc09aefaaf4c9b02e8ba1155b8 (patch) | |
| tree | d3ef0566fa0aaa1853fed1e7a71b40dc557f699c /Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs | |
| parent | ccec0abb96ce3cfc7c0d75a78e371cef90e2b968 (diff) | |
| parent | bbbc155a96729050b9aa7d966055726df46696af (diff) | |
| download | Tango-c10fb2bcae7143bc09aefaaf4c9b02e8ba1155b8.tar.gz Tango-c10fb2bcae7143bc09aefaaf4c9b02e8ba1155b8.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs')
| -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(); |
