diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2019-12-21 23:17:25 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2019-12-21 23:17:25 +0200 |
| commit | cd670d0404673efd095ae2baec1873b916c49c81 (patch) | |
| tree | 2b058baa663372411956ece0c6cfdae8c1382742 /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels | |
| parent | aeb55d27a8abf291913724fc1676ecbf27cb2c1a (diff) | |
| download | Tango-cd670d0404673efd095ae2baec1873b916c49c81.tar.gz Tango-cd670d0404673efd095ae2baec1873b916c49c81.zip | |
Implemented not existing deleted RML check for PPC update and error message.
Added proper notification when trying to remove used RML onMS.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs | 23 |
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) |
