From 45ac8eaf0e03d87c2f9728b2b7c84922c6f6a37d Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 18 Dec 2018 13:29:22 +0200 Subject: Implemented OS activation + UWF. Added OSKey to MACHINES table and machine service. --- .../Tango.MachineService/Controllers/SynchronizationController.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs') diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs index 304ea34f2..6126594c5 100644 --- a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs +++ b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs @@ -98,6 +98,11 @@ namespace Tango.MachineService.Controllers throw new AuthenticationException("The specified serial number could not be found."); } + if (machine.OsKey == null) + { + throw new InvalidDataException("The specified machine is not associated with an OS activation key."); + } + var machine_version = db.MachineVersions.SingleOrDefault(x => x.Guid == machine.MachineVersionGuid); var latest_machine_version = db.TangoVersions.Where(x => x.MachineVersionGuid == machine_version.Guid).ToList().OrderByDescending(x => Version.Parse(x.Version)).FirstOrDefault(); @@ -128,6 +133,7 @@ namespace Tango.MachineService.Controllers response.DbAddress = Config.DB_ADDRESS; response.DbUserName = credentials.UserName; response.DbPassword = credentials.Password; + response.OSKey = machine.OsKey; } return response; -- cgit v1.3.1