diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2019-12-17 00:02:49 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2019-12-17 00:02:49 +0200 |
| commit | bdf56799cd6c4c42ec7a8dc36f56ddd17a5feeab (patch) | |
| tree | 00ff21d8d2ee3d81b76fa12bc92460117cc693be /Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup | |
| parent | e8ee7dfb8e166e34c7950e90d5fe9bcf31dc351b (diff) | |
| download | Tango-bdf56799cd6c4c42ec7a8dc36f56ddd17a5feeab.tar.gz Tango-bdf56799cd6c4c42ec7a8dc36f56ddd17a5feeab.zip | |
Added SOURCE to JOB.
Added IS_SYNCHRONIZED to TANGO_UPDATE.
Added OfflineUpdates to Synchronization.
Added TangoUpdates on PPC side.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs index dfa9b833b..582eec83b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs @@ -11,6 +11,8 @@ using System.Net.Http.Headers; using System.Text; using System.Threading; using System.Threading.Tasks; +using Tango.BL; +using Tango.BL.Entities; using Tango.Core; using Tango.Core.DB; using Tango.Core.ExtensionMethods; @@ -29,6 +31,7 @@ using Tango.Settings; using Tango.SharedUI.Helpers; using Tango.SQLExaminer; using Tango.Transport.Web; +using System.Data.Entity; namespace Tango.PPC.Common.MachineSetup { @@ -45,6 +48,7 @@ namespace Tango.PPC.Common.MachineSetup private PPCWebClient _client; private List<LogItemBase> _logs; private bool _isUpdating; + private DateTime _setupStartDate; #region Events @@ -164,6 +168,28 @@ namespace Tango.PPC.Common.MachineSetup } } + if (response != null) + { + try + { + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + TangoUpdate update = new TangoUpdate(); + update.ApplicationVersion = response.Version; + update.FirmwareVersion = response.FirmwareVersion; + update.MachineGuid = (await db.Machines.FirstAsync()).Guid; + update.UpdateStatus = BL.Enumerations.TangoUpdateStatuses.SetupCompleted; + update.StartDate = _setupStartDate; + update.EndDate = DateTime.UtcNow; + await db.SaveChangesAsync(); + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error saving tango setup information to database."); + } + } + _isUpdating = false; } @@ -191,6 +217,7 @@ namespace Tango.PPC.Common.MachineSetup TaskCompletionSource<MachineSetupResult> result = new TaskCompletionSource<MachineSetupResult>(); MachineSetupResponse setup_response = null; + _setupStartDate = DateTime.UtcNow; try { |
