diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-09 13:52:40 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-09 13:52:40 +0300 |
| commit | b2db361984b7f6833d24eb4c574ec3513d8b7633 (patch) | |
| tree | 1696a76a81582ab43cae0e01c01c3ff1c2d799e1 /Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs | |
| parent | a5f9c99d51f7e096ff612da6605ab4d4f5067009 (diff) | |
| download | Tango-b2db361984b7f6833d24eb4c574ec3513d8b7633.tar.gz Tango-b2db361984b7f6833d24eb4c574ec3513d8b7633.zip | |
Removed APPLICATION_VERSIONS & EMBEDDED_SOFTWARE_VERSIONS TABLES.
Added TANGO_VERSIONS.
Working on PPC machine setup.
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(); |
