aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs
diff options
context:
space:
mode:
authorShai Frieder <Shai.Frieder@twine-s.com>2019-12-19 11:48:39 +0200
committerShai Frieder <Shai.Frieder@twine-s.com>2019-12-19 11:48:39 +0200
commit8c8e40e01349bf8f2c42a7fae086ed83b9c3d37a (patch)
tree4e057467a2d25ccf0089fdf56826623fb824f034 /Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs
parent886a476b862f573be5b38036edfe9582946ebe1d (diff)
parenta61a911d1ebde107ba7bf210af7e753e692d93e2 (diff)
downloadTango-8c8e40e01349bf8f2c42a7fae086ed83b9c3d37a.tar.gz
Tango-8c8e40e01349bf8f2c42a7fae086ed83b9c3d37a.zip
merge conflict take remot
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs24
1 files changed, 24 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..29daedb4c 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
@@ -162,6 +166,25 @@ namespace Tango.PPC.Common.MachineSetup
{
LogManager.Log(xx, "Error notifying setup completed.");
}
+
+ 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 +214,7 @@ namespace Tango.PPC.Common.MachineSetup
TaskCompletionSource<MachineSetupResult> result = new TaskCompletionSource<MachineSetupResult>();
MachineSetupResponse setup_response = null;
+ _setupStartDate = DateTime.UtcNow;
try
{