aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2019-12-21 23:17:25 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2019-12-21 23:17:25 +0200
commitcd670d0404673efd095ae2baec1873b916c49c81 (patch)
tree2b058baa663372411956ece0c6cfdae8c1382742 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs
parentaeb55d27a8abf291913724fc1676ecbf27cb2c1a (diff)
downloadTango-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/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs10
1 files changed, 9 insertions, 1 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs
index 527159aa5..5c55892ba 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs
@@ -445,7 +445,7 @@ namespace Tango.MachineStudio.RML.ViewModels
private async void RemoveSelectedRml()
{
- if (_notification.ShowQuestion("Removing the selected RML will result in the loss of all related process parameters and default calibration data. Are you sure you want to delete the selected RML?"))
+ if (_notification.ShowQuestion("Removing the selected thread will result in the loss of all related process parameters and default calibration data. Are you sure you want to delete the selected RML?"))
{
IsFree = false;
@@ -453,6 +453,14 @@ namespace Tango.MachineStudio.RML.ViewModels
{
try
{
+ var rml_jobs = await _rmls_context.Jobs.Where(x => x.RmlGuid == SelectedRML.Guid).Include(x => x.Machine).OrderBy(x => x.Machine.SerialNumber).ToListAsync();
+
+ if (rml_jobs.Count > 0)
+ {
+ _notification.ShowError($"The following jobs must be removed or change thread type before the selected thread can be deleted:\n{String.Join("\n",rml_jobs.Select(x => $"{x.Machine.SerialNumber} => {x.Name}"))}");
+ return;
+ }
+
await SelectedRML.DeleteCascadeAsync(_rmls_context);
_actionLogManager.InsertLog(BL.Enumerations.ActionLogType.RmlDeleted, _authentication.CurrentUser, SelectedRML.Name, SelectedRML, "RML deleted from Machine Studio.");