diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-03-04 15:49:59 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-03-04 15:49:59 +0200 |
| commit | 1746d2c7f601f44c23399aa6d19661fb7ff937ec (patch) | |
| tree | 829c2a33a7b5c67696c683df5a11780fae620fae /Software | |
| parent | 56b984bf7c4785cd0bcfd45a174ea802c6d0d471 (diff) | |
| download | Tango-1746d2c7f601f44c23399aa6d19661fb7ff937ec.tar.gz Tango-1746d2c7f601f44c23399aa6d19661fb7ff937ec.zip | |
Fixed several issues with PPC.
Diffstat (limited to 'Software')
47 files changed, 540 insertions, 15 deletions
diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf Binary files differindex d6f6f7df9..bf105aae6 100644 --- a/Software/DB/PPC/Tango.mdf +++ b/Software/DB/PPC/Tango.mdf diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf Binary files differindex 0d66b5a3b..ed4e961b2 100644 --- a/Software/DB/PPC/Tango_log.ldf +++ b/Software/DB/PPC/Tango_log.ldf diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf Binary files differindex 694158acd..f4d06e542 100644 --- a/Software/DB/Tango.mdf +++ b/Software/DB/Tango.mdf diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf Binary files differindex 76c9a74d3..290770451 100644 --- a/Software/DB/Tango_log.ldf +++ b/Software/DB/Tango_log.ldf diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs index a2927660f..30f444a6f 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs @@ -357,7 +357,7 @@ namespace Tango.PPC.Jobs.ViewModels vm.SelectedColorSpace = space.IsUserSpace() ? space : ColorSpaces.Twine; } - if (machine.SupportedJobTypes.Count != 1 && machine.SupportedColorSpaces.Count != 1) + if (machine.SupportedJobTypes.Count != 1 || machine.SupportedColorSpaces.Count != 1) { vm = await NotificationProvider.ShowDialog<JobCreationViewVM>(vm); if (!vm.DialogResult) return; diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs index 7896367ec..246b86469 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs @@ -119,7 +119,7 @@ namespace Tango.PPC.MachineSettings.ViewModels { Machine.SupportedJobTypes = SelectedJobTypes.SynchedSource.ToList(); Machine.SupportedColorSpaces = SelectedColorSpaces.SynchedSource.ToList(); - Machine.ShallowCopyTo(MachineProvider.Machine); + Machine.MapPrimitivesWithStringsNoNullsTo(MachineProvider.Machine); Settings.EnableHotSpot = EnableHotSpot; Settings.HotSpotPassword = HotSpotPassword; @@ -149,8 +149,8 @@ namespace Tango.PPC.MachineSettings.ViewModels { base.OnNavigatedTo(); - Machine = new Machine(); - MachineProvider.Machine.ShallowCopyTo(Machine); + Machine = MachineProvider.Machine.ShallowClone(); + RaisePropertyChanged(nameof(Machine)); _enableHotSpot = HotSpotProvider.IsEnabled; diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml index d1de12664..8ba06eb43 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml @@ -119,8 +119,8 @@ </ItemsControl.ItemTemplate> </ItemsControl> - <TextBlock VerticalAlignment="Bottom">Default Media</TextBlock> - <touch:TouchComboBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" ItemsSource="{Binding Adapter.Rmls}" SelectedItem="{Binding Machine.DefaultRml}" DisplayMemberPath="Name"></touch:TouchComboBox> + <TextBlock VerticalAlignment="Bottom">Default Thread Type</TextBlock> + <touch:TouchComboBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" ItemsSource="{Binding Adapter.Rmls}" SelectedItem="{Binding Machine.DefaultRml}" DisplayMemberPath="Name" ValuePath="Guid"></touch:TouchComboBox> <!--<TextBlock VerticalAlignment="Bottom">Default Spool</TextBlock> <touch:TouchComboBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" ItemsSource="{Binding Adapter.SpoolTypes}" SelectedItem="{Binding Machine.DefaultSpoolType}" DisplayMemberPath="Name"></touch:TouchComboBox>--> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs index 95912e1ea..9a7e29bb7 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs @@ -32,6 +32,7 @@ namespace Tango.PPC.Common.Connection { private bool _isInitialized; private Thread _connection_thread; + private ObservablesContext _context; private Machine _machine; /// <summary> @@ -165,7 +166,7 @@ namespace Tango.PPC.Common.Connection /// <summary> /// Initializes this machine provider start machine port scanning and connection. /// </summary> - public void Init(Machine machine) + public void Init(Machine machine, ObservablesContext context) { if (!_isInitialized) { @@ -175,6 +176,7 @@ namespace Tango.PPC.Common.Connection LogManager.Log("Retrieving first machine database entry..."); + _context = context; Machine = machine; if (Machine != null) @@ -209,7 +211,8 @@ namespace Tango.PPC.Common.Connection /// <returns></returns> public async Task SaveMachine() { - await Machine.GetDbContext().SaveChangesAsync(); + await _context.SaveChangesAsync(); + Machine = await new MachineBuilder(_context).SetFirst().WithSettings().BuildAsync(); TangoMessenger.Default.Send(new MachineSettingsSavedMessage() { Machine = Machine }); } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/IMachineProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/IMachineProvider.cs index 43a6c290e..10180b9cc 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/IMachineProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/IMachineProvider.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.BL; using Tango.BL.Entities; using Tango.Integration.ExternalBridge; using Tango.Integration.Operation; @@ -27,7 +28,7 @@ namespace Tango.PPC.Common.Connection /// <summary> /// Initializes this machine provider start machine port scanning and connection. /// </summary> - void Init(Machine machine); + void Init(Machine machine, ObservablesContext context); /// <summary> /// Saves the machine settings. diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs index f7711318f..788d2b178 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs @@ -46,6 +46,7 @@ namespace Tango.PPC.UI.PPCApplication private IPPCModuleLoader _moduleLoader; private INotificationProvider _notificationProvider; private WatchDogServer _watchdogServer; + private ObservablesContext _machineContext; /// <summary> /// Occurs when a system restart is required. @@ -203,7 +204,8 @@ namespace Tango.PPC.UI.PPCApplication LogManager.Log("Initializing ObservablesStaticCollections..."); ObservablesStaticCollections.Instance.Initialize(); LogManager.Log("Loading machine from database..."); - _machine = new MachineBuilder(ObservablesContext.CreateDefault()).SetFirst().WithOrganization().WithConfiguration().WithSpools().Build(); + _machineContext = ObservablesContext.CreateDefault(); + _machine = new MachineBuilder(_machineContext).SetFirst().WithSettings().WithOrganization().WithConfiguration().WithSpools().WithCats().Build(); } initialized = true; @@ -301,7 +303,7 @@ namespace Tango.PPC.UI.PPCApplication LogManager.Log("Finalizing application initialization..."); LogManager.Log("Initializing Machine Provider..."); - _machineProvider.Init(_machine); + _machineProvider.Init(_machine, _machineContext); LogManager.Log("Applications initialization completed!"); diff --git a/Software/Visual_Studio/Tango.BL/Builders/MachineBuilder.cs b/Software/Visual_Studio/Tango.BL/Builders/MachineBuilder.cs index 2f1ad47b5..832fdb2ca 100644 --- a/Software/Visual_Studio/Tango.BL/Builders/MachineBuilder.cs +++ b/Software/Visual_Studio/Tango.BL/Builders/MachineBuilder.cs @@ -15,6 +15,14 @@ namespace Tango.BL.Builders } + public virtual MachineBuilder WithSettings() + { + return AddQueryStep(1, (query) => + { + return query.Include(x => x.DefaultColorSpace).Include(x => x.DefaultRml).Include(x => x.DefaultSpoolType); + }); + } + public virtual MachineBuilder WithOrganization() { return AddStep(1, () => diff --git a/Software/Visual_Studio/Tango.BL/Entities/BrushStopBase.cs b/Software/Visual_Studio/Tango.BL/Entities/BrushStopBase.cs index 69658bab6..a6dcad6a9 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/BrushStopBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/BrushStopBase.cs @@ -110,6 +110,7 @@ namespace Tango.BL.Entities if (_segmentguid != value) { _segmentguid = value; + } } } @@ -135,6 +136,7 @@ namespace Tango.BL.Entities if (_colorspaceguid != value) { _colorspaceguid = value; + } } } @@ -943,6 +945,7 @@ namespace Tango.BL.Entities if (_colorcatalogguid != value) { _colorcatalogguid = value; + } } } @@ -968,6 +971,11 @@ namespace Tango.BL.Entities { _colorcatalog = value; + if (ColorCatalog != null) + { + ColorCatalogGuid = ColorCatalog.Guid; + } + OnColorCatalogChanged(value); } @@ -995,6 +1003,11 @@ namespace Tango.BL.Entities { _colorspace = value; + if (ColorSpace != null) + { + ColorSpaceGuid = ColorSpace.Guid; + } + OnColorSpaceChanged(value); } @@ -1022,6 +1035,11 @@ namespace Tango.BL.Entities { _segment = value; + if (Segment != null) + { + SegmentGuid = Segment.Guid; + } + OnSegmentChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/CatBase.cs b/Software/Visual_Studio/Tango.BL/Entities/CatBase.cs index 3ea654919..3805844b5 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/CatBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/CatBase.cs @@ -83,6 +83,7 @@ namespace Tango.BL.Entities if (_machineguid != value) { _machineguid = value; + } } } @@ -108,6 +109,7 @@ namespace Tango.BL.Entities if (_rmlguid != value) { _rmlguid = value; + } } } @@ -133,6 +135,7 @@ namespace Tango.BL.Entities if (_liquidtypeguid != value) { _liquidtypeguid = value; + } } } @@ -185,6 +188,11 @@ namespace Tango.BL.Entities { _liquidtype = value; + if (LiquidType != null) + { + LiquidTypeGuid = LiquidType.Guid; + } + OnLiquidTypeChanged(value); } @@ -212,6 +220,11 @@ namespace Tango.BL.Entities { _machine = value; + if (Machine != null) + { + MachineGuid = Machine.Guid; + } + OnMachineChanged(value); } @@ -239,6 +252,11 @@ namespace Tango.BL.Entities { _rml = value; + if (Rml != null) + { + RmlGuid = Rml.Guid; + } + OnRmlChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/CctBase.cs b/Software/Visual_Studio/Tango.BL/Entities/CctBase.cs index 11319a38a..2eacd5057 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/CctBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/CctBase.cs @@ -251,6 +251,7 @@ namespace Tango.BL.Entities if (_rmlguid != value) { _rmlguid = value; + } } } @@ -276,6 +277,11 @@ namespace Tango.BL.Entities { _rml = value; + if (Rml != null) + { + RmlGuid = Rml.Guid; + } + OnRmlChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogBase.cs index 6438c6332..362b812aa 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogBase.cs @@ -80,6 +80,7 @@ namespace Tango.BL.Entities if (_rmlguid != value) { _rmlguid = value; + } } } @@ -105,6 +106,7 @@ namespace Tango.BL.Entities if (_colorspaceguid != value) { _colorspaceguid = value; + } } } @@ -533,6 +535,11 @@ namespace Tango.BL.Entities { _colorspace = value; + if (ColorSpace != null) + { + ColorSpaceGuid = ColorSpace.Guid; + } + OnColorSpaceChanged(value); } @@ -560,6 +567,11 @@ namespace Tango.BL.Entities { _rml = value; + if (Rml != null) + { + RmlGuid = Rml.Guid; + } + OnRmlChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/ConfigurationBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ConfigurationBase.cs index f2adc67e7..c8c9471f7 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ConfigurationBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ConfigurationBase.cs @@ -60,6 +60,7 @@ namespace Tango.BL.Entities if (_applicationosversionguid != value) { _applicationosversionguid = value; + } } } @@ -85,6 +86,7 @@ namespace Tango.BL.Entities if (_applicationfirmwareversionguid != value) { _applicationfirmwareversionguid = value; + } } } @@ -110,6 +112,7 @@ namespace Tango.BL.Entities if (_applicationdisplaypanelversionguid != value) { _applicationdisplaypanelversionguid = value; + } } } @@ -135,6 +138,7 @@ namespace Tango.BL.Entities if (_embeddedfirmwareversionguid != value) { _embeddedfirmwareversionguid = value; + } } } @@ -160,6 +164,7 @@ namespace Tango.BL.Entities if (_hardwareversionguid != value) { _hardwareversionguid = value; + } } } @@ -185,6 +190,11 @@ namespace Tango.BL.Entities { _applicationdisplaypanelversion = value; + if (ApplicationDisplayPanelVersion != null) + { + ApplicationDisplayPanelVersionGuid = ApplicationDisplayPanelVersion.Guid; + } + OnApplicationDisplayPanelVersionChanged(value); } @@ -212,6 +222,11 @@ namespace Tango.BL.Entities { _applicationfirmwareversion = value; + if (ApplicationFirmwareVersion != null) + { + ApplicationFirmwareVersionGuid = ApplicationFirmwareVersion.Guid; + } + OnApplicationFirmwareVersionChanged(value); } @@ -239,6 +254,11 @@ namespace Tango.BL.Entities { _applicationosversion = value; + if (ApplicationOsVersion != null) + { + ApplicationOsVersionGuid = ApplicationOsVersion.Guid; + } + OnApplicationOsVersionChanged(value); } @@ -266,6 +286,11 @@ namespace Tango.BL.Entities { _embeddedfirmwareversion = value; + if (EmbeddedFirmwareVersion != null) + { + EmbeddedFirmwareVersionGuid = EmbeddedFirmwareVersion.Guid; + } + OnEmbeddedFirmwareVersionChanged(value); } @@ -293,6 +318,11 @@ namespace Tango.BL.Entities { _hardwareversion = value; + if (HardwareVersion != null) + { + HardwareVersionGuid = HardwareVersion.Guid; + } + OnHardwareVersionChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/CustomerBase.cs b/Software/Visual_Studio/Tango.BL/Entities/CustomerBase.cs index 89a8e8cf7..4c802446b 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/CustomerBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/CustomerBase.cs @@ -52,6 +52,7 @@ namespace Tango.BL.Entities if (_organizationguid != value) { _organizationguid = value; + } } } @@ -104,6 +105,11 @@ namespace Tango.BL.Entities { _organization = value; + if (Organization != null) + { + OrganizationGuid = Organization.Guid; + } + OnOrganizationChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/DispenserBase.cs b/Software/Visual_Studio/Tango.BL/Entities/DispenserBase.cs index 591ae2155..986ecd683 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/DispenserBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/DispenserBase.cs @@ -91,6 +91,7 @@ namespace Tango.BL.Entities if (_dispensertypeguid != value) { _dispensertypeguid = value; + } } } @@ -278,6 +279,11 @@ namespace Tango.BL.Entities { _dispensertype = value; + if (DispenserType != null) + { + DispenserTypeGuid = DispenserType.Guid; + } + OnDispenserTypeChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerBase.cs index 62925b51f..457de376e 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerBase.cs @@ -58,6 +58,7 @@ namespace Tango.BL.Entities if (_hardwareblowertypeguid != value) { _hardwareblowertypeguid = value; + } } } @@ -83,6 +84,7 @@ namespace Tango.BL.Entities if (_hardwareversionguid != value) { _hardwareversionguid = value; + } } } @@ -216,6 +218,11 @@ namespace Tango.BL.Entities { _hardwareblowertype = value; + if (HardwareBlowerType != null) + { + HardwareBlowerTypeGuid = HardwareBlowerType.Guid; + } + OnHardwareBlowerTypeChanged(value); } @@ -243,6 +250,11 @@ namespace Tango.BL.Entities { _hardwareversion = value; + if (HardwareVersion != null) + { + HardwareVersionGuid = HardwareVersion.Guid; + } + OnHardwareVersionChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorBase.cs index 799f0f783..2ea472ddb 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorBase.cs @@ -56,6 +56,7 @@ namespace Tango.BL.Entities if (_hardwarebreaksensortypeguid != value) { _hardwarebreaksensortypeguid = value; + } } } @@ -81,6 +82,7 @@ namespace Tango.BL.Entities if (_hardwareversionguid != value) { _hardwareversionguid = value; + } } } @@ -187,6 +189,11 @@ namespace Tango.BL.Entities { _hardwarebreaksensortype = value; + if (HardwareBreakSensorType != null) + { + HardwareBreakSensorTypeGuid = HardwareBreakSensorType.Guid; + } + OnHardwareBreakSensorTypeChanged(value); } @@ -214,6 +221,11 @@ namespace Tango.BL.Entities { _hardwareversion = value; + if (HardwareVersion != null) + { + HardwareVersionGuid = HardwareVersion.Guid; + } + OnHardwareVersionChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerBase.cs index 2ff924d88..50e94ed33 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerBase.cs @@ -72,6 +72,7 @@ namespace Tango.BL.Entities if (_hardwaredancertypeguid != value) { _hardwaredancertypeguid = value; + } } } @@ -97,6 +98,7 @@ namespace Tango.BL.Entities if (_hardwareversionguid != value) { _hardwareversionguid = value; + } } } @@ -419,6 +421,11 @@ namespace Tango.BL.Entities { _hardwaredancertype = value; + if (HardwareDancerType != null) + { + HardwareDancerTypeGuid = HardwareDancerType.Guid; + } + OnHardwareDancerTypeChanged(value); } @@ -446,6 +453,11 @@ namespace Tango.BL.Entities { _hardwareversion = value; + if (HardwareVersion != null) + { + HardwareVersionGuid = HardwareVersion.Guid; + } + OnHardwareVersionChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorBase.cs index 495951553..5929037df 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorBase.cs @@ -105,6 +105,7 @@ namespace Tango.BL.Entities if (_hardwaremotortypeguid != value) { _hardwaremotortypeguid = value; + } } } @@ -130,6 +131,7 @@ namespace Tango.BL.Entities if (_hardwareversionguid != value) { _hardwareversionguid = value; + } } } @@ -830,6 +832,11 @@ namespace Tango.BL.Entities { _hardwaremotortype = value; + if (HardwareMotorType != null) + { + HardwareMotorTypeGuid = HardwareMotorType.Guid; + } + OnHardwareMotorTypeChanged(value); } @@ -857,6 +864,11 @@ namespace Tango.BL.Entities { _hardwareversion = value; + if (HardwareVersion != null) + { + HardwareVersionGuid = HardwareVersion.Guid; + } + OnHardwareVersionChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlBase.cs index 0dbeb4c43..14b6b746c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlBase.cs @@ -90,6 +90,7 @@ namespace Tango.BL.Entities if (_hardwarepidcontroltypeguid != value) { _hardwarepidcontroltypeguid = value; + } } } @@ -115,6 +116,7 @@ namespace Tango.BL.Entities if (_hardwareversionguid != value) { _hardwareversionguid = value; + } } } @@ -680,6 +682,11 @@ namespace Tango.BL.Entities { _hardwarepidcontroltype = value; + if (HardwarePidControlType != null) + { + HardwarePidControlTypeGuid = HardwarePidControlType.Guid; + } + OnHardwarePidControlTypeChanged(value); } @@ -707,6 +714,11 @@ namespace Tango.BL.Entities { _hardwareversion = value; + if (HardwareVersion != null) + { + HardwareVersionGuid = HardwareVersion.Guid; + } + OnHardwareVersionChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorBase.cs index 36a74c15b..4399c8557 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorBase.cs @@ -56,6 +56,7 @@ namespace Tango.BL.Entities if (_hardwarespeedsensortypeguid != value) { _hardwarespeedsensortypeguid = value; + } } } @@ -81,6 +82,7 @@ namespace Tango.BL.Entities if (_hardwareversionguid != value) { _hardwareversionguid = value; + } } } @@ -187,6 +189,11 @@ namespace Tango.BL.Entities { _hardwarespeedsensortype = value; + if (HardwareSpeedSensorType != null) + { + HardwareSpeedSensorTypeGuid = HardwareSpeedSensorType.Guid; + } + OnHardwareSpeedSensorTypeChanged(value); } @@ -214,6 +221,11 @@ namespace Tango.BL.Entities { _hardwareversion = value; + if (HardwareVersion != null) + { + HardwareVersionGuid = HardwareVersion.Guid; + } + OnHardwareVersionChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderBase.cs index e0ec1edeb..2213e8956 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderBase.cs @@ -54,6 +54,7 @@ namespace Tango.BL.Entities if (_hardwarewindertypeguid != value) { _hardwarewindertypeguid = value; + } } } @@ -79,6 +80,7 @@ namespace Tango.BL.Entities if (_hardwareversionguid != value) { _hardwareversionguid = value; + } } } @@ -158,6 +160,11 @@ namespace Tango.BL.Entities { _hardwareversion = value; + if (HardwareVersion != null) + { + HardwareVersionGuid = HardwareVersion.Guid; + } + OnHardwareVersionChanged(value); } @@ -185,6 +192,11 @@ namespace Tango.BL.Entities { _hardwarewindertype = value; + if (HardwareWinderType != null) + { + HardwareWinderTypeGuid = HardwareWinderType.Guid; + } + OnHardwareWinderTypeChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/IdsPackBase.cs b/Software/Visual_Studio/Tango.BL/Entities/IdsPackBase.cs index 451dafbc9..6c2ac7cba 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/IdsPackBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/IdsPackBase.cs @@ -62,6 +62,7 @@ namespace Tango.BL.Entities if (_configurationguid != value) { _configurationguid = value; + } } } @@ -87,6 +88,7 @@ namespace Tango.BL.Entities if (_dispenserguid != value) { _dispenserguid = value; + } } } @@ -112,6 +114,7 @@ namespace Tango.BL.Entities if (_liquidtypeguid != value) { _liquidtypeguid = value; + } } } @@ -137,6 +140,7 @@ namespace Tango.BL.Entities if (_cartridgetypeguid != value) { _cartridgetypeguid = value; + } } } @@ -162,6 +166,7 @@ namespace Tango.BL.Entities if (_midtanktypeguid != value) { _midtanktypeguid = value; + } } } @@ -187,6 +192,7 @@ namespace Tango.BL.Entities if (_idspackformulaguid != value) { _idspackformulaguid = value; + } } } @@ -266,6 +272,11 @@ namespace Tango.BL.Entities { _cartridgetype = value; + if (CartridgeType != null) + { + CartridgeTypeGuid = CartridgeType.Guid; + } + OnCartridgeTypeChanged(value); } @@ -293,6 +304,11 @@ namespace Tango.BL.Entities { _configuration = value; + if (Configuration != null) + { + ConfigurationGuid = Configuration.Guid; + } + OnConfigurationChanged(value); } @@ -320,6 +336,11 @@ namespace Tango.BL.Entities { _dispenser = value; + if (Dispenser != null) + { + DispenserGuid = Dispenser.Guid; + } + OnDispenserChanged(value); } @@ -347,6 +368,11 @@ namespace Tango.BL.Entities { _idspackformula = value; + if (IdsPackFormula != null) + { + IdsPackFormulaGuid = IdsPackFormula.Guid; + } + OnIdsPackFormulaChanged(value); } @@ -374,6 +400,11 @@ namespace Tango.BL.Entities { _liquidtype = value; + if (LiquidType != null) + { + LiquidTypeGuid = LiquidType.Guid; + } + OnLiquidTypeChanged(value); } @@ -401,6 +432,11 @@ namespace Tango.BL.Entities { _midtanktype = value; + if (MidTankType != null) + { + MidTankTypeGuid = MidTankType.Guid; + } + OnMidTankTypeChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs b/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs index 55c06beff..363349a4a 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs @@ -173,6 +173,7 @@ namespace Tango.BL.Entities if (_machineguid != value) { _machineguid = value; + } } } @@ -198,6 +199,7 @@ namespace Tango.BL.Entities if (_userguid != value) { _userguid = value; + } } } @@ -223,6 +225,7 @@ namespace Tango.BL.Entities if (_rmlguid != value) { _rmlguid = value; + } } } @@ -248,6 +251,7 @@ namespace Tango.BL.Entities if (_windingmethodguid != value) { _windingmethodguid = value; + } } } @@ -273,6 +277,7 @@ namespace Tango.BL.Entities if (_spooltypeguid != value) { _spooltypeguid = value; + } } } @@ -625,6 +630,7 @@ namespace Tango.BL.Entities if (_colorspaceguid != value) { _colorspaceguid = value; + } } } @@ -705,6 +711,7 @@ namespace Tango.BL.Entities if (_customerguid != value) { _customerguid = value; + } } } @@ -980,6 +987,11 @@ namespace Tango.BL.Entities { _colorspace = value; + if (ColorSpace != null) + { + ColorSpaceGuid = ColorSpace.Guid; + } + OnColorSpaceChanged(value); } @@ -1007,6 +1019,11 @@ namespace Tango.BL.Entities { _customer = value; + if (Customer != null) + { + CustomerGuid = Customer.Guid; + } + OnCustomerChanged(value); } @@ -1059,6 +1076,11 @@ namespace Tango.BL.Entities { _machine = value; + if (Machine != null) + { + MachineGuid = Machine.Guid; + } + OnMachineChanged(value); } @@ -1086,6 +1108,11 @@ namespace Tango.BL.Entities { _rml = value; + if (Rml != null) + { + RmlGuid = Rml.Guid; + } + OnRmlChanged(value); } @@ -1113,6 +1140,11 @@ namespace Tango.BL.Entities { _spooltype = value; + if (SpoolType != null) + { + SpoolTypeGuid = SpoolType.Guid; + } + OnSpoolTypeChanged(value); } @@ -1140,6 +1172,11 @@ namespace Tango.BL.Entities { _user = value; + if (User != null) + { + UserGuid = User.Guid; + } + OnUserChanged(value); } @@ -1167,6 +1204,11 @@ namespace Tango.BL.Entities { _windingmethod = value; + if (WindingMethod != null) + { + WindingMethodGuid = WindingMethod.Guid; + } + OnWindingMethodChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs b/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs index 2cb5025a8..ca534fff1 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs @@ -63,6 +63,7 @@ namespace Tango.BL.Entities if (_jobguid != value) { _jobguid = value; + } } } @@ -225,6 +226,11 @@ namespace Tango.BL.Entities { _job = value; + if (Job != null) + { + JobGuid = Job.Guid; + } + OnJobChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/LiquidTypesRmlBase.cs b/Software/Visual_Studio/Tango.BL/Entities/LiquidTypesRmlBase.cs index cc5f702e4..30ea371d7 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/LiquidTypesRmlBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/LiquidTypesRmlBase.cs @@ -54,6 +54,7 @@ namespace Tango.BL.Entities if (_liquidtypeguid != value) { _liquidtypeguid = value; + } } } @@ -79,6 +80,7 @@ namespace Tango.BL.Entities if (_rmlguid != value) { _rmlguid = value; + } } } @@ -158,6 +160,11 @@ namespace Tango.BL.Entities { _liquidtype = value; + if (LiquidType != null) + { + LiquidTypeGuid = LiquidType.Guid; + } + OnLiquidTypeChanged(value); } @@ -185,6 +192,11 @@ namespace Tango.BL.Entities { _rml = value; + if (Rml != null) + { + RmlGuid = Rml.Guid; + } + OnRmlChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/MachineBase.cs b/Software/Visual_Studio/Tango.BL/Entities/MachineBase.cs index 892f535d5..d4a915a66 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MachineBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MachineBase.cs @@ -177,6 +177,7 @@ namespace Tango.BL.Entities if (_organizationguid != value) { _organizationguid = value; + } } } @@ -202,6 +203,7 @@ namespace Tango.BL.Entities if (_machineversionguid != value) { _machineversionguid = value; + } } } @@ -227,6 +229,7 @@ namespace Tango.BL.Entities if (_configurationguid != value) { _configurationguid = value; + } } } @@ -252,6 +255,7 @@ namespace Tango.BL.Entities if (_defaultrmlguid != value) { _defaultrmlguid = value; + } } } @@ -276,6 +280,7 @@ namespace Tango.BL.Entities if (_loadedrmlguid != value) { _loadedrmlguid = value; + } } } @@ -355,6 +360,7 @@ namespace Tango.BL.Entities if (_defaultcolorspaceguid != value) { _defaultcolorspaceguid = value; + } } } @@ -407,6 +413,7 @@ namespace Tango.BL.Entities if (_defaultspooltypeguid != value) { _defaultspooltypeguid = value; + } } } @@ -700,6 +707,11 @@ namespace Tango.BL.Entities { _defaultcolorspace = value; + if (DefaultColorSpace != null) + { + DefaultColorSpaceGuid = DefaultColorSpace.Guid; + } + OnDefaultColorSpaceChanged(value); } @@ -727,6 +739,11 @@ namespace Tango.BL.Entities { _configuration = value; + if (Configuration != null) + { + ConfigurationGuid = Configuration.Guid; + } + OnConfigurationChanged(value); } @@ -779,6 +796,11 @@ namespace Tango.BL.Entities { _machineversion = value; + if (MachineVersion != null) + { + MachineVersionGuid = MachineVersion.Guid; + } + OnMachineVersionChanged(value); } @@ -831,6 +853,11 @@ namespace Tango.BL.Entities { _organization = value; + if (Organization != null) + { + OrganizationGuid = Organization.Guid; + } + OnOrganizationChanged(value); } @@ -858,6 +885,11 @@ namespace Tango.BL.Entities { _defaultrml = value; + if (DefaultRml != null) + { + DefaultRmlGuid = DefaultRml.Guid; + } + OnDefaultRmlChanged(value); } @@ -885,6 +917,11 @@ namespace Tango.BL.Entities { _defaultspooltype = value; + if (DefaultSpoolType != null) + { + DefaultSpoolTypeGuid = DefaultSpoolType.Guid; + } + OnDefaultSpoolTypeChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/MachineStudioVersionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/MachineStudioVersionBase.cs index edbddb240..29d916bc6 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MachineStudioVersionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MachineStudioVersionBase.cs @@ -164,6 +164,7 @@ namespace Tango.BL.Entities if (_userguid != value) { _userguid = value; + } } } @@ -189,6 +190,11 @@ namespace Tango.BL.Entities { _user = value; + if (User != null) + { + UserGuid = User.Guid; + } + OnUserChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/MachinesEventBase.cs b/Software/Visual_Studio/Tango.BL/Entities/MachinesEventBase.cs index ac300b9b9..3940cc919 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MachinesEventBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MachinesEventBase.cs @@ -85,6 +85,7 @@ namespace Tango.BL.Entities if (_machineguid != value) { _machineguid = value; + } } } @@ -110,6 +111,7 @@ namespace Tango.BL.Entities if (_eventtypeguid != value) { _eventtypeguid = value; + } } } @@ -135,6 +137,7 @@ namespace Tango.BL.Entities if (_userguid != value) { _userguid = value; + } } } @@ -214,6 +217,11 @@ namespace Tango.BL.Entities { _eventtype = value; + if (EventType != null) + { + EventTypeGuid = EventType.Guid; + } + OnEventTypeChanged(value); } @@ -241,6 +249,11 @@ namespace Tango.BL.Entities { _machine = value; + if (Machine != null) + { + MachineGuid = Machine.Guid; + } + OnMachineChanged(value); } @@ -268,6 +281,11 @@ namespace Tango.BL.Entities { _user = value; + if (User != null) + { + UserGuid = User.Guid; + } + OnUserChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/OrganizationBase.cs b/Software/Visual_Studio/Tango.BL/Entities/OrganizationBase.cs index 1d2fea8d0..37d44e100 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/OrganizationBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/OrganizationBase.cs @@ -85,6 +85,7 @@ namespace Tango.BL.Entities if (_contactguid != value) { _contactguid = value; + } } } @@ -110,6 +111,7 @@ namespace Tango.BL.Entities if (_addressguid != value) { _addressguid = value; + } } } @@ -135,6 +137,11 @@ namespace Tango.BL.Entities { _address = value; + if (Address != null) + { + AddressGuid = Address.Guid; + } + OnAddressChanged(value); } @@ -162,6 +169,11 @@ namespace Tango.BL.Entities { _contact = value; + if (Contact != null) + { + ContactGuid = Contact.Guid; + } + OnContactChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTableBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTableBase.cs index 09c79064d..94ae5b20a 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTableBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTableBase.cs @@ -630,6 +630,7 @@ namespace Tango.BL.Entities if (_processparameterstablesgroupguid != value) { _processparameterstablesgroupguid = value; + } } } @@ -682,6 +683,11 @@ namespace Tango.BL.Entities { _processparameterstablesgroup = value; + if (ProcessParametersTablesGroup != null) + { + ProcessParametersTablesGroupGuid = ProcessParametersTablesGroup.Guid; + } + OnProcessParametersTablesGroupChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTablesGroupBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTablesGroupBase.cs index 586d4bcc7..09edc7012 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTablesGroupBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTablesGroupBase.cs @@ -56,6 +56,7 @@ namespace Tango.BL.Entities if (_rmlguid != value) { _rmlguid = value; + } } } @@ -187,6 +188,11 @@ namespace Tango.BL.Entities { _rml = value; + if (Rml != null) + { + RmlGuid = Rml.Guid; + } + OnRmlChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs b/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs index 97fee9558..91862b7c7 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs @@ -270,6 +270,7 @@ namespace Tango.BL.Entities if (_mediamaterialguid != value) { _mediamaterialguid = value; + } } } @@ -295,6 +296,7 @@ namespace Tango.BL.Entities if (_mediapurposeguid != value) { _mediapurposeguid = value; + } } } @@ -320,6 +322,7 @@ namespace Tango.BL.Entities if (_mediaconditionguid != value) { _mediaconditionguid = value; + } } } @@ -345,6 +348,7 @@ namespace Tango.BL.Entities if (_linearmassdensityunitguid != value) { _linearmassdensityunitguid = value; + } } } @@ -370,6 +374,7 @@ namespace Tango.BL.Entities if (_fibershapeguid != value) { _fibershapeguid = value; + } } } @@ -395,6 +400,7 @@ namespace Tango.BL.Entities if (_fibersynthguid != value) { _fibersynthguid = value; + } } } @@ -819,6 +825,11 @@ namespace Tango.BL.Entities { _fibershape = value; + if (FiberShape != null) + { + FiberShapeGuid = FiberShape.Guid; + } + OnFiberShapeChanged(value); } @@ -846,6 +857,11 @@ namespace Tango.BL.Entities { _fibersynth = value; + if (FiberSynth != null) + { + FiberSynthGuid = FiberSynth.Guid; + } + OnFiberSynthChanged(value); } @@ -898,6 +914,11 @@ namespace Tango.BL.Entities { _linearmassdensityunit = value; + if (LinearMassDensityUnit != null) + { + LinearMassDensityUnitGuid = LinearMassDensityUnit.Guid; + } + OnLinearMassDensityUnitChanged(value); } @@ -975,6 +996,11 @@ namespace Tango.BL.Entities { _mediacondition = value; + if (MediaCondition != null) + { + MediaConditionGuid = MediaCondition.Guid; + } + OnMediaConditionChanged(value); } @@ -1002,6 +1028,11 @@ namespace Tango.BL.Entities { _mediamaterial = value; + if (MediaMaterial != null) + { + MediaMaterialGuid = MediaMaterial.Guid; + } + OnMediaMaterialChanged(value); } @@ -1029,6 +1060,11 @@ namespace Tango.BL.Entities { _mediapurpose = value; + if (MediaPurpose != null) + { + MediaPurposeGuid = MediaPurpose.Guid; + } + OnMediaPurposeChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/RolesPermissionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/RolesPermissionBase.cs index 5c6c605a2..aa46ba8ce 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/RolesPermissionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/RolesPermissionBase.cs @@ -50,6 +50,7 @@ namespace Tango.BL.Entities if (_roleguid != value) { _roleguid = value; + } } } @@ -75,6 +76,7 @@ namespace Tango.BL.Entities if (_permissionguid != value) { _permissionguid = value; + } } } @@ -100,6 +102,11 @@ namespace Tango.BL.Entities { _permission = value; + if (Permission != null) + { + PermissionGuid = Permission.Guid; + } + OnPermissionChanged(value); } @@ -127,6 +134,11 @@ namespace Tango.BL.Entities { _role = value; + if (Role != null) + { + RoleGuid = Role.Guid; + } + OnRoleChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/SegmentBase.cs b/Software/Visual_Studio/Tango.BL/Entities/SegmentBase.cs index d6d16a580..07c7a09e0 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/SegmentBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/SegmentBase.cs @@ -83,6 +83,7 @@ namespace Tango.BL.Entities if (_jobguid != value) { _jobguid = value; + } } } @@ -187,6 +188,11 @@ namespace Tango.BL.Entities { _job = value; + if (Job != null) + { + JobGuid = Job.Guid; + } + OnJobChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/SpoolBase.cs b/Software/Visual_Studio/Tango.BL/Entities/SpoolBase.cs index 1f9eae25f..fd10b4f90 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/SpoolBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/SpoolBase.cs @@ -58,6 +58,7 @@ namespace Tango.BL.Entities if (_spooltypeguid != value) { _spooltypeguid = value; + } } } @@ -83,6 +84,7 @@ namespace Tango.BL.Entities if (_machineguid != value) { _machineguid = value; + } } } @@ -216,6 +218,11 @@ namespace Tango.BL.Entities { _machine = value; + if (Machine != null) + { + MachineGuid = Machine.Guid; + } + OnMachineChanged(value); } @@ -243,6 +250,11 @@ namespace Tango.BL.Entities { _spooltype = value; + if (SpoolType != null) + { + SpoolTypeGuid = SpoolType.Guid; + } + OnSpoolTypeChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/TangoVersionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/TangoVersionBase.cs index 7f198017e..581bd85d7 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/TangoVersionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/TangoVersionBase.cs @@ -166,6 +166,7 @@ namespace Tango.BL.Entities if (_userguid != value) { _userguid = value; + } } } @@ -191,6 +192,7 @@ namespace Tango.BL.Entities if (_machineversionguid != value) { _machineversionguid = value; + } } } @@ -216,6 +218,11 @@ namespace Tango.BL.Entities { _machineversion = value; + if (MachineVersion != null) + { + MachineVersionGuid = MachineVersion.Guid; + } + OnMachineVersionChanged(value); } @@ -243,6 +250,11 @@ namespace Tango.BL.Entities { _user = value; + if (User != null) + { + UserGuid = User.Guid; + } + OnUserChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/UserBase.cs b/Software/Visual_Studio/Tango.BL/Entities/UserBase.cs index 3872dbeee..641041560 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/UserBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/UserBase.cs @@ -151,6 +151,7 @@ namespace Tango.BL.Entities if (_organizationguid != value) { _organizationguid = value; + } } } @@ -176,6 +177,7 @@ namespace Tango.BL.Entities if (_contactguid != value) { _contactguid = value; + } } } @@ -201,6 +203,7 @@ namespace Tango.BL.Entities if (_addressguid != value) { _addressguid = value; + } } } @@ -253,6 +256,11 @@ namespace Tango.BL.Entities { _address = value; + if (Address != null) + { + AddressGuid = Address.Guid; + } + OnAddressChanged(value); } @@ -280,6 +288,11 @@ namespace Tango.BL.Entities { _contact = value; + if (Contact != null) + { + ContactGuid = Contact.Guid; + } + OnContactChanged(value); } @@ -382,6 +395,11 @@ namespace Tango.BL.Entities { _organization = value; + if (Organization != null) + { + OrganizationGuid = Organization.Guid; + } + OnOrganizationChanged(value); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/UsersRoleBase.cs b/Software/Visual_Studio/Tango.BL/Entities/UsersRoleBase.cs index b852916e0..eac6f79d3 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/UsersRoleBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/UsersRoleBase.cs @@ -50,6 +50,7 @@ namespace Tango.BL.Entities if (_userguid != value) { _userguid = value; + } } } @@ -75,6 +76,7 @@ namespace Tango.BL.Entities if (_roleguid != value) { _roleguid = value; + } } } @@ -100,6 +102,11 @@ namespace Tango.BL.Entities { _role = value; + if (Role != null) + { + RoleGuid = Role.Guid; + } + OnRoleChanged(value); } @@ -127,6 +134,11 @@ namespace Tango.BL.Entities { _user = value; + if (User != null) + { + UserGuid = User.Guid; + } + OnUserChanged(value); } diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml index 698a79b34..b5d47edab 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml +++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml @@ -74,12 +74,23 @@ namespace Tango.BL.Entities if (_@(prop.Name.ToLower()) != value) { _@(prop.Name.ToLower()) = value; + + @if (prop.Complex) + { + <div> + if (@(prop.Name) != null) + { + @(prop.Name)Guid = @(prop.Name).Guid; + } + </div> + } + @if (!prop.Name.EndsWith("Guid")) { <div> On@(prop.Name)Changed(value); </div> - } + } } } } diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/StringExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/StringExtensions.cs index 7a03b8ae4..78bb693f6 100644 --- a/Software/Visual_Studio/Tango.Core/ExtensionMethods/StringExtensions.cs +++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/StringExtensions.cs @@ -238,7 +238,7 @@ public static class StringExtensions { if (!String.IsNullOrWhiteSpace(str)) { - return str.Split(splitChar).Select(x => (T)Convert.ChangeType(int.Parse(x),typeof(T))).ToList(); + return str.Split(splitChar).Select(x => (T)(object)int.Parse(x)).ToList(); } else { diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchComboBox.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchComboBox.cs index 438d22272..7a7c23b91 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchComboBox.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchComboBox.cs @@ -96,6 +96,16 @@ namespace Tango.Touch.Controls public static readonly DependencyProperty DisplayMemberPathProperty = DependencyProperty.Register("DisplayMemberPath", typeof(String), typeof(TouchComboBox), new PropertyMetadata(null)); + public String ValuePath + { + get { return (String)GetValue(ValuePathProperty); } + set { SetValue(ValuePathProperty, value); } + } + public static readonly DependencyProperty ValuePathProperty = + DependencyProperty.Register("ValuePath", typeof(String), typeof(TouchComboBox), new PropertyMetadata(null)); + + + public TouchComboBox() { this.RegisterForPreviewMouseOrTouchDown(OnMouseDown); diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.cs index a64a70e4e..57afcb943 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.cs @@ -138,6 +138,17 @@ namespace Tango.Touch.Controls DependencyProperty.Register("ScrollBarVisibility", typeof(Visibility), typeof(TouchListBox), new PropertyMetadata(Visibility.Visible)); + + public String ValuePath + { + get { return (String)GetValue(ValuePathProperty); } + set { SetValue(ValuePathProperty, value); } + } + public static readonly DependencyProperty ValuePathProperty = + DependencyProperty.Register("ValuePath", typeof(String), typeof(TouchListBox), new PropertyMetadata(null)); + + + public TouchListBox() { _awaitingSelectionItems = new List<TouchListBoxItem>(); @@ -315,7 +326,17 @@ namespace Tango.Touch.Controls { var items = GetItems(); items.ForEach(x => x.IsSelected = false); - var item = items.FirstOrDefault(x => x.DataContext.Equals(SelectedItem)); + + TouchListBoxItem item = null; + + if (String.IsNullOrWhiteSpace(ValuePath) || SelectedItem == null) + { + item = items.FirstOrDefault(x => x.DataContext.Equals(SelectedItem)); + } + else + { + item = items.FirstOrDefault(x => x.DataContext.GetPropertyValueByPath(ValuePath).Equals(SelectedItem.GetPropertyValueByPath(ValuePath))); + } if (item != null) { diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml index c9d6bd466..aadc2b3e6 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml @@ -74,7 +74,7 @@ <Border DockPanel.Dock="Top" BorderBrush="{StaticResource TangoDividerBrush}" BorderThickness="0 0 0 1" Padding="10 10 10 15"> <TextBlock DockPanel.Dock="Top" Text="{Binding Title}" FontSize="{StaticResource TangoTitleFontSize}"></TextBlock> </Border> - <local:TouchListBox x:Name="PART_ComboBoxList" Margin="0 10 0 0" Width="{Binding MinPopupWidth}" Height="{Binding MinPopupHeight}" ItemSelectedCommand="{Binding RelativeSource={RelativeSource AncestorType=local:TouchPanel},Path=ComboBoxPickedCommand}" ItemsSource="{Binding ItemsSource}" SelectedItem="{Binding SelectedItem,Mode=TwoWay}" SelectionMode="None" ItemTemplate="{Binding ItemTemplate}" VerticalAlignment="Top"> + <local:TouchListBox x:Name="PART_ComboBoxList" Margin="0 10 0 0" Width="{Binding MinPopupWidth}" Height="{Binding MinPopupHeight}" ItemSelectedCommand="{Binding RelativeSource={RelativeSource AncestorType=local:TouchPanel},Path=ComboBoxPickedCommand}" ItemsSource="{Binding ItemsSource}" SelectedItem="{Binding SelectedItem,Mode=TwoWay}" SelectionMode="None" ItemTemplate="{Binding ItemTemplate}" ValuePath="{Binding ValuePath}" VerticalAlignment="Top"> </local:TouchListBox> </DockPanel> |
