aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs
index 49b2aef89..0af977614 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs
@@ -1,10 +1,12 @@
using System;
using System.Collections.Generic;
+using System.Data.Entity;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Tango.BL;
using Tango.Core.Commands;
using Tango.Core.Helpers;
using Tango.Explorer;
@@ -156,6 +158,27 @@ namespace Tango.PPC.UI.ViewModels
}
var response = await MachineUpdateManager.CheckForUpdate(MachineProvider.Machine.SerialNumber);
+
+ try
+ {
+ if (response.UsedNotExistingRmlsGuids.Count > 0)
+ {
+ using (ObservablesContext db = ObservablesContext.CreateDefault())
+ {
+ var arr = response.UsedNotExistingRmlsGuids.ToArray();
+ var jobs = await db.Jobs.Where(x => arr.Contains(x.RmlGuid)).ToListAsync();
+ FailedError = $"The following jobs must be removed or change thread type before the system can be updated:\n{String.Join("\n", jobs.Select(x => x.Name))}";
+ _isChecking = false;
+ await NavigateTo(MachineUpdateView.UpdateFailedView);
+ return;
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, "Error on used RML check procedure.");
+ }
+
_checkUpdateResponse = response;
if (response.IsUpdateAvailable)