diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-01-16 18:23:59 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-01-16 18:23:59 +0200 |
| commit | 9695aef4cf1ac2d85d6905e73c4f4aa079cc7c1d (patch) | |
| tree | 828425426e81df727cd2e7787af8bd2c075374bf /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels | |
| parent | 1ca3d89bba12432446930e2f458264c72a01c672 (diff) | |
| download | Tango-9695aef4cf1ac2d85d6905e73c4f4aa079cc7c1d.tar.gz Tango-9695aef4cf1ac2d85d6905e73c4f4aa079cc7c1d.zip | |
Removed Dispensers & Cartridges!
Only Dispenser Type & CartridgeType now.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs index d87527fa7..96b66c204 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs @@ -20,6 +20,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels { private bool _isSaving; private INotificationProvider _notification; + #region Properties @@ -190,7 +191,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels collections.Add(Adapter.EmbeddedFirmwareVersionsViewSource); collections.Add(Adapter.ApplicationOsVersionsViewSource); collections.Add(Adapter.ApplicationVersionsViewSource); - collections.Add(Adapter.DispensersViewSource); + collections.Add(Adapter.DispenserTypesViewSource); collections.Add(Adapter.CartridgeTypesViewSource); collections.Add(Adapter.LiquidTypesViewSource); collections.Add(Adapter.MidTankTypesViewSource); @@ -316,12 +317,12 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels /// <summary> /// Drops the dispenser. /// </summary> - /// <param name="dispenser">The dispenser.</param> + /// <param name="dispenserType">The dispenser.</param> /// <param name="idsPack">The ids pack.</param> - public void DropDispenser(Dispenser dispenser, IdsPack idsPack) + public void DropDispenserType(DispenserType dispenserType, IdsPack idsPack) { - idsPack.Dispenser = dispenser; - idsPack.DispenserGuid = dispenser.Guid; + idsPack.DispenserTypes = dispenserType; + idsPack.DispenserTypeGuid = dispenserType.Guid; } /// <summary> @@ -455,9 +456,9 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels { errors.Add(String.Format("Cartridge type is required on IDS pack '{0}'.", pack.Name)); } - if (pack.Dispenser == null) + if (pack.DispenserTypes == null) { - errors.Add(String.Format("Dispenser is required on IDS pack '{0}'.", pack.Name)); + errors.Add(String.Format("Dispenser type is required on IDS pack '{0}'.", pack.Name)); } if (pack.LiquidTypes == null) { @@ -467,15 +468,6 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels { errors.Add(String.Format("Mid Tank type is required on IDS pack '{0}'.", pack.Name)); } - - var taken_ids = Adapter.Machines.Where(x => x.SerialNumber.ToLower() != Machine.SerialNumber).SelectMany(x => x.MachinesConfigurations).Select(x => x.Configuration).SelectMany(x => x.IdsPacks).ToList().FirstOrDefault(x => x.Dispenser.SerialNumber.ToLower() == pack.Dispenser.SerialNumber.ToLower()); - if (taken_ids != null && taken_ids.Configuration.MachinesConfigurations.Count > 0) - { - if (!_notification.ShowQuestion(String.Format("The Dispenser '{1}' on IDS pack '{0}' is already taken by another machine ('{2}', '{3}'). Are you sure you want to assign it to this machine?", pack.Name, pack.Dispenser.SerialNumber, taken_ids.Configuration.MachinesConfigurations.First().Machine.Name, taken_ids.Configuration.MachinesConfigurations.First().Machine.SerialNumber))) - { - return; - } - } } if (errors.Count > 0) |
