diff options
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(); |
