From 650af0554b902837f8e146d690aca24e4f60ec29 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 31 Dec 2018 14:15:49 +0200 Subject: Removed Default configuration from machine version. Implemented custom ToJson for observables. Implemented Apply & Create prototype machine for machine version. --- .../Tango.BL/Builders/MachineBuilder.cs | 8 ++ .../Tango.BL/Entities/Configuration.cs | 38 ----- .../Tango.BL/Entities/MachineVersion.cs | 51 ++----- .../Tango.BL/EntitiesExtensions/Cat.cs | 10 ++ .../Tango.BL/EntitiesExtensions/Configuration.cs | 14 ++ .../Tango.BL/EntitiesExtensions/HardwareVersion.cs | 8 ++ .../Tango.BL/EntitiesExtensions/IdsPack.cs | 24 ++++ .../Tango.BL/EntitiesExtensions/Machine.cs | 16 +++ .../Tango.BL/EntitiesExtensions/MachineVersion.cs | 65 ++++++++- .../Tango.BL/EntitiesExtensions/Spool.cs | 9 ++ .../Visual_Studio/Tango.BL/IObservableEntity.cs | 3 +- .../Visual_Studio/Tango.BL/ObservableEntity.cs | 43 ++++++ Software/Visual_Studio/Tango.BL/Tango.BL.csproj | 1 + .../Json/IJsonSerializationController.cs | 20 +++ .../SerializationControllerContractResolver.cs | 36 +++++ .../Visual_Studio/Tango.Core/Tango.Core.csproj | 4 +- .../Tango.DAL.Remote/DB/CONFIGURATION.cs | 3 - .../Tango.DAL.Remote/DB/MACHINE_VERSIONS.cs | 3 +- .../Tango.DAL.Remote/DB/RemoteADO.edmx | 40 +----- .../Tango.DAL.Remote/DB/RemoteADO.edmx.diagram | 153 ++++++++++----------- .../Utilities/Tango.UITests/MainWindow.xaml.cs | 18 +++ 21 files changed, 367 insertions(+), 200 deletions(-) create mode 100644 Software/Visual_Studio/Tango.BL/EntitiesExtensions/IdsPack.cs create mode 100644 Software/Visual_Studio/Tango.Core/Json/IJsonSerializationController.cs create mode 100644 Software/Visual_Studio/Tango.Core/Json/SerializationControllerContractResolver.cs (limited to 'Software/Visual_Studio') diff --git a/Software/Visual_Studio/Tango.BL/Builders/MachineBuilder.cs b/Software/Visual_Studio/Tango.BL/Builders/MachineBuilder.cs index dd27d94f0..2f1ad47b5 100644 --- a/Software/Visual_Studio/Tango.BL/Builders/MachineBuilder.cs +++ b/Software/Visual_Studio/Tango.BL/Builders/MachineBuilder.cs @@ -52,5 +52,13 @@ namespace Tango.BL.Builders Context.Spools.Where(x => x.MachineGuid == Entity.Guid).Include(x => x.SpoolType).ToList(); }); } + + public virtual MachineBuilder WithCats() + { + return AddStep(5, () => + { + Context.Cats.Where(x => x.MachineGuid == Entity.Guid).Include(x => x.LiquidType).ToList(); + }); + } } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/Configuration.cs b/Software/Visual_Studio/Tango.BL/Entities/Configuration.cs index 1217701b5..2aafe59ef 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Configuration.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Configuration.cs @@ -37,8 +37,6 @@ namespace Tango.BL.Entities public event EventHandler> IdsPacksChanged; - public event EventHandler> MachineVersionsChanged; - public event EventHandler> MachinesChanged; protected String _applicationosversionguid; @@ -326,31 +324,6 @@ namespace Tango.BL.Entities } } - protected SynchronizedObservableCollection _machineversions; - - /// - /// Gets or sets the configuration machine versions. - /// - - public virtual SynchronizedObservableCollection MachineVersions - { - get - { - return _machineversions; - } - - set - { - if (_machineversions != value) - { - _machineversions = value; - - OnMachineVersionsChanged(value); - - } - } - } - protected SynchronizedObservableCollection _machines; /// @@ -430,15 +403,6 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(IdsPacks)); } - /// - /// Called when the MachineVersions has changed. - /// - protected virtual void OnMachineVersionsChanged(SynchronizedObservableCollection machineversions) - { - MachineVersionsChanged?.Invoke(this, machineversions); - RaisePropertyChanged(nameof(MachineVersions)); - } - /// /// Called when the Machines has changed. /// @@ -456,8 +420,6 @@ namespace Tango.BL.Entities IdsPacks = new SynchronizedObservableCollection(); - MachineVersions = new SynchronizedObservableCollection(); - Machines = new SynchronizedObservableCollection(); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs b/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs index 87eaa61a4..3380f9b90 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs @@ -29,7 +29,7 @@ namespace Tango.BL.Entities public event EventHandler NameChanged; - public event EventHandler DefaultConfigurationChanged; + public event EventHandler PrototypeMachineDataChanged; public event EventHandler> MachinesChanged; @@ -89,53 +89,28 @@ namespace Tango.BL.Entities } } - protected String _defaultconfigurationguid; + protected String _prototypemachinedata; /// - /// Gets or sets the machineversion default configuration guid. + /// Gets or sets the machineversion prototype machine data. /// - [Column("DEFAULT_CONFIGURATION_GUID")] - [ForeignKey("DefaultConfiguration")] + [Column("PROTOTYPE_MACHINE_DATA")] - public String DefaultConfigurationGuid + public String PrototypeMachineData { get { - return _defaultconfigurationguid; + return _prototypemachinedata; } set { - if (_defaultconfigurationguid != value) + if (_prototypemachinedata != value) { - _defaultconfigurationguid = value; - } - } - } - - protected Configuration _defaultconfiguration; - - /// - /// Gets or sets the machineversion configuration. - /// - - [XmlIgnore] - [JsonIgnore] - public virtual Configuration DefaultConfiguration - { - get - { - return _defaultconfiguration; - } - - set - { - if (_defaultconfiguration != value) - { - _defaultconfiguration = value; + _prototypemachinedata = value; - OnDefaultConfigurationChanged(value); + OnPrototypeMachineDataChanged(value); } } @@ -210,12 +185,12 @@ namespace Tango.BL.Entities } /// - /// Called when the DefaultConfiguration has changed. + /// Called when the PrototypeMachineData has changed. /// - protected virtual void OnDefaultConfigurationChanged(Configuration defaultconfiguration) + protected virtual void OnPrototypeMachineDataChanged(String prototypemachinedata) { - DefaultConfigurationChanged?.Invoke(this, defaultconfiguration); - RaisePropertyChanged(nameof(DefaultConfiguration)); + PrototypeMachineDataChanged?.Invoke(this, prototypemachinedata); + RaisePropertyChanged(nameof(PrototypeMachineData)); } /// diff --git a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Cat.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Cat.cs index 6f92de80a..3c93d098d 100644 --- a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Cat.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Cat.cs @@ -42,5 +42,15 @@ namespace Tango.BL.Entities cloned.Machine = machine; return cloned; } + + public override List GetIgnoreProperties() + { + return base.GetIgnoreProperties().Concat(new List() + { + nameof(this.LiquidType), + nameof(this.Machine), + nameof(this.Rml), + }).ToList(); + } } } diff --git a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Configuration.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Configuration.cs index 6ed1627cd..4e7ec72bd 100644 --- a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Configuration.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Configuration.cs @@ -62,5 +62,19 @@ namespace Tango.BL.Entities return cloned; } + + public override List GetIgnoreProperties() + { + return base.GetIgnoreProperties().Concat(new List() + { + nameof(this.ApplicationDisplayPanelVersion), + nameof(this.ApplicationFirmwareVersion), + nameof(this.ApplicationOsVersion), + nameof(this.EmbeddedFirmwareVersion), + nameof(this.Machines), + nameof(this.NoneEmptyIdsPacks), + nameof(this.HardwareVersion), + }).ToList(); + } } } diff --git a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/HardwareVersion.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/HardwareVersion.cs index 7a09f9f65..d3a9baf9f 100644 --- a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/HardwareVersion.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/HardwareVersion.cs @@ -32,5 +32,13 @@ namespace Tango.BL.Entities HardwareBreakSensors.ToList().ForEach(x => x.DefferedDelete(context)); base.Delete(context); } + + public override List GetIgnoreProperties() + { + return base.GetIgnoreProperties().Concat(new List() + { + nameof(this.Configurations), + }).ToList(); + } } } diff --git a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/IdsPack.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/IdsPack.cs new file mode 100644 index 000000000..eff0fee0c --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/IdsPack.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.BL.Entities +{ + public partial class IdsPack + { + public override List GetIgnoreProperties() + { + return base.GetIgnoreProperties().Concat(new List() + { + nameof(this.CartridgeType), + nameof(this.Configuration), + nameof(this.Dispenser), + nameof(this.IdsPackFormula), + nameof(this.LiquidType), + nameof(this.MidTankType), + }).ToList(); + } + } +} diff --git a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Machine.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Machine.cs index 11f86a403..6f54640f5 100644 --- a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Machine.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Machine.cs @@ -133,5 +133,21 @@ namespace Tango.BL.Entities return cloned; } + + public override List GetIgnoreProperties() + { + return base.GetIgnoreProperties().Concat(new List() + { + nameof(this.Organization), + nameof(this.DefaultRml), + nameof(this.DefaultColorSpace), + nameof(this.DefaultSpoolType), + nameof(this.Jobs), + nameof(this.MachinesEvents), + nameof(this.MachineVersion), + nameof(this.Name), + nameof(this.SerialNumber), + }).ToList(); + } } } diff --git a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/MachineVersion.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/MachineVersion.cs index aeec23b33..2b8d99652 100644 --- a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/MachineVersion.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/MachineVersion.cs @@ -1,17 +1,76 @@ using System; using System.Collections.Generic; +using System.Data.Entity; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.BL.Builders; namespace Tango.BL.Entities { public partial class MachineVersion { - public override void Delete(ObservablesContext context) + public async Task ApplyPrototypeMachine(Machine machine, ObservablesContext context) { - this.DefaultConfiguration.Delete(context); - base.Delete(context); + machine = await new MachineBuilder(context) + .Set(machine) + .WithOrganization() + .WithConfiguration() + .WithSpools() + .WithCats() + .BuildAsync(); + + PrototypeMachineData = machine.ToJson(); + } + + public async Task CreatePrototypeMachine(ObservablesContext context) + { + Machine machine = Machine.FromJson(PrototypeMachineData); + machine.OrganizationGuid = null; + machine.ConfigurationGuid = null; + machine.ConfigurationGuid = machine.Configuration.Guid; + + foreach (var cat in machine.Cats) + { + cat.LiquidType = await context.LiquidTypes.SingleOrDefaultAsync(x => x.Guid == cat.LiquidTypeGuid); + cat.MachineGuid = machine.Guid; + cat.Machine = machine; + cat.Rml = await context.Rmls.SingleOrDefaultAsync(x => x.Guid == cat.RmlGuid); + } + + machine.DefaultColorSpace = await context.ColorSpaces.SingleOrDefaultAsync(x => x.Guid == machine.Guid); + machine.ConfigurationGuid = machine.Configuration.Guid; + machine.MachineVersion = this; + machine.MachineVersionGuid = this.Guid; + machine.ProductionDate = DateTime.UtcNow; + + machine.Configuration.ApplicationDisplayPanelVersion = await context.ApplicationDisplayPanelVersions.SingleOrDefaultAsync(x => x.Guid == machine.Configuration.ApplicationDisplayPanelVersionGuid); + machine.Configuration.ApplicationFirmwareVersion = await context.ApplicationFirmwareVersions.SingleOrDefaultAsync(x => x.Guid == machine.Configuration.ApplicationFirmwareVersionGuid); + machine.Configuration.ApplicationOsVersion = await context.ApplicationOsVersions.SingleOrDefaultAsync(x => x.Guid == machine.Configuration.ApplicationOsVersionGuid); + machine.Configuration.EmbeddedFirmwareVersion = await context.EmbeddedFirmwareVersions.SingleOrDefaultAsync(x => x.Guid == machine.Configuration.EmbeddedFirmwareVersionGuid); + machine.Configuration.HardwareVersion = await context.HardwareVersions.SingleOrDefaultAsync(x => x.Guid == machine.Configuration.HardwareVersionGuid); + + foreach (var idsPack in machine.Configuration.IdsPacks) + { + idsPack.CartridgeType = await context.CartridgeTypes.SingleOrDefaultAsync(x => x.Guid == idsPack.CartridgeTypeGuid); + idsPack.CartridgeType = await context.CartridgeTypes.SingleOrDefaultAsync(x => x.Guid == idsPack.CartridgeTypeGuid); + idsPack.LiquidType = await context.LiquidTypes.SingleOrDefaultAsync(x => x.Guid == idsPack.LiquidTypeGuid); + idsPack.IdsPackFormula = await context.IdsPackFormulas.SingleOrDefaultAsync(x => x.Guid == idsPack.IdsPackFormulaGuid); + idsPack.MidTankType = await context.MidTankTypes.SingleOrDefaultAsync(x => x.Guid == idsPack.MidTankTypeGuid); + + idsPack.DispenserGuid = null; + idsPack.Configuration = machine.Configuration; + idsPack.ConfigurationGuid = machine.ConfigurationGuid; + } + + foreach (var spool in machine.Spools) + { + spool.Machine = machine; + spool.MachineGuid = machine.Guid; + spool.SpoolType = await context.SpoolTypes.SingleOrDefaultAsync(x => x.Guid == spool.SpoolTypeGuid); + } + + return machine; } } } diff --git a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Spool.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Spool.cs index d4efcdf14..f93e90d00 100644 --- a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Spool.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Spool.cs @@ -14,5 +14,14 @@ namespace Tango.BL.Entities cloned.Machine = machine; return cloned; } + + public override List GetIgnoreProperties() + { + return base.GetIgnoreProperties().Concat(new List() + { + nameof(this.Machine), + nameof(this.SpoolType), + }).ToList(); + } } } diff --git a/Software/Visual_Studio/Tango.BL/IObservableEntity.cs b/Software/Visual_Studio/Tango.BL/IObservableEntity.cs index ad112c4a1..e4ed48134 100644 --- a/Software/Visual_Studio/Tango.BL/IObservableEntity.cs +++ b/Software/Visual_Studio/Tango.BL/IObservableEntity.cs @@ -8,13 +8,14 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.Core; +using Tango.Core.Json; namespace Tango.BL { /// /// Represents an observable database entity. /// - public interface IObservableEntity : INotifyDataErrorInfo, IParameterized + public interface IObservableEntity : INotifyDataErrorInfo, IParameterized , IJsonSerializationController { /// /// Occurs after this observable has been modified and saved by this entity context or another. diff --git a/Software/Visual_Studio/Tango.BL/ObservableEntity.cs b/Software/Visual_Studio/Tango.BL/ObservableEntity.cs index 52ecbbbc5..8ec0b30d6 100644 --- a/Software/Visual_Studio/Tango.BL/ObservableEntity.cs +++ b/Software/Visual_Studio/Tango.BL/ObservableEntity.cs @@ -23,6 +23,8 @@ using System.Xml.Serialization; using Newtonsoft.Json; using Tango.Logging; using System.ComponentModel; +using Tango.Core.Json; +using Newtonsoft.Json.Converters; namespace Tango.BL { @@ -376,6 +378,47 @@ Maybe you have deleted an entity that was no yet inserted into database?", LogCa { return GetDbContextFromEntity(this); } + + public virtual List GetIgnoreProperties() + { + return new List() + { + nameof(this.HasErrors), + nameof(this.Parameters), + nameof(this.DesignMode), + nameof(this.LogManager), + nameof(this.ObjectType), + nameof(this.TemporaryManager), + nameof(this.ValidateOnPropertyChanged), + nameof(this.ValidationErrors), + nameof(this.LastUpdated), + nameof(this.ID), + nameof(this.Guid), + "_entityWrapper", + }; + } + + public static T FromJson(String json) + { + var settings = new JsonSerializerSettings() + { + ContractResolver = new SerializationControllerContractResolver(), + }; + settings.Converters.Add(new StringEnumConverter { CamelCaseText = false }); + return JsonConvert.DeserializeObject(json, settings); + } + + public String ToJson() + { + var settings = new JsonSerializerSettings() + { + ContractResolver = new SerializationControllerContractResolver(), + }; + settings.Converters.Add(new StringEnumConverter { CamelCaseText = false }); + String json = JsonConvert.SerializeObject(this, Formatting.Indented, settings); + return json; + } + #endregion #region Private Methods diff --git a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj index 72e7fe332..78ab72db1 100644 --- a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj +++ b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj @@ -114,6 +114,7 @@ + diff --git a/Software/Visual_Studio/Tango.Core/Json/IJsonSerializationController.cs b/Software/Visual_Studio/Tango.Core/Json/IJsonSerializationController.cs new file mode 100644 index 000000000..f703a8863 --- /dev/null +++ b/Software/Visual_Studio/Tango.Core/Json/IJsonSerializationController.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Core.Json +{ + /// + /// Represents an object that defines which properties should not be serialized with the Json serializer. + /// + public interface IJsonSerializationController + { + /// + /// Gets the properties to ignore. + /// + /// + List GetIgnoreProperties(); + } +} diff --git a/Software/Visual_Studio/Tango.Core/Json/SerializationControllerContractResolver.cs b/Software/Visual_Studio/Tango.Core/Json/SerializationControllerContractResolver.cs new file mode 100644 index 000000000..702d51ddf --- /dev/null +++ b/Software/Visual_Studio/Tango.Core/Json/SerializationControllerContractResolver.cs @@ -0,0 +1,36 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Core.Json +{ + public class SerializationControllerContractResolver : DefaultContractResolver + { + private List _ignoreProperties = new List(); + + protected override JsonObjectContract CreateObjectContract(Type objectType) + { + _ignoreProperties = new List(); + + if (typeof(IJsonSerializationController).IsAssignableFrom(objectType)) + { + _ignoreProperties = (Activator.CreateInstance(objectType) as IJsonSerializationController).GetIgnoreProperties(); + } + return base.CreateObjectContract(objectType); + } + + protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) + { + var props = _ignoreProperties.ToList(); + JsonProperty property = base.CreateProperty(member, memberSerialization); + property.Ignored = false; + property.ShouldSerialize = (x) => !props.Contains(property.PropertyName); + return property; + } + } +} diff --git a/Software/Visual_Studio/Tango.Core/Tango.Core.csproj b/Software/Visual_Studio/Tango.Core/Tango.Core.csproj index 8ed2c695b..5bfe3ab79 100644 --- a/Software/Visual_Studio/Tango.Core/Tango.Core.csproj +++ b/Software/Visual_Studio/Tango.Core/Tango.Core.csproj @@ -86,7 +86,9 @@ GlobalVersionInfo.cs + + @@ -193,7 +195,7 @@ - + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/CONFIGURATION.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/CONFIGURATION.cs index f27a05ae2..3fcfc908d 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/CONFIGURATION.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/CONFIGURATION.cs @@ -18,7 +18,6 @@ namespace Tango.DAL.Remote.DB public CONFIGURATION() { this.IDS_PACKS = new HashSet(); - this.MACHINE_VERSIONS = new HashSet(); this.MACHINES = new HashSet(); } @@ -39,8 +38,6 @@ namespace Tango.DAL.Remote.DB [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection IDS_PACKS { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection MACHINE_VERSIONS { get; set; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection MACHINES { get; set; } } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE_VERSIONS.cs index df1d48673..8ddd77597 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE_VERSIONS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE_VERSIONS.cs @@ -26,9 +26,8 @@ namespace Tango.DAL.Remote.DB public System.DateTime LAST_UPDATED { get; set; } public double VERSION { get; set; } public string NAME { get; set; } - public string DEFAULT_CONFIGURATION_GUID { get; set; } + public string PROTOTYPE_MACHINE_DATA { get; set; } - public virtual CONFIGURATION CONFIGURATION { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection MACHINES { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx index eecb142ee..1f5e0b4fe 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -694,7 +694,7 @@ - + @@ -1762,18 +1762,6 @@ - - - - - - - - - - - - @@ -2470,10 +2458,6 @@ - - - - @@ -2765,10 +2749,6 @@ - - - - @@ -3241,7 +3221,6 @@ - @@ -3820,8 +3799,7 @@ - - + @@ -4545,18 +4523,6 @@ - - - - - - - - - - - - @@ -6118,7 +6084,7 @@ - + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram index dc1208fee..68bdf4f21 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,82 +5,82 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -101,7 +101,6 @@ - diff --git a/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml.cs b/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml.cs index 0ff703178..673136df9 100644 --- a/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml.cs +++ b/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml.cs @@ -15,7 +15,9 @@ using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using Tango.BL; +using Tango.BL.Builders; using Tango.BL.Catalogs; +using Tango.BL.Entities; using Tango.Core; using Tango.Core.Commands; using Tango.DragAndDrop; @@ -30,9 +32,25 @@ namespace Tango.UITests { public MainWindow() { + + Start(); InitializeComponent(); } + private async void Start() + { + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + var machine = new MachineBuilder(db).Set(x => x.SerialNumber == "1111").WithConfiguration().WithOrganization().WithJobs().WithSpools().WithCats().Build(); + MachineVersion version = db.MachineVersions.First(); + await version.ApplyPrototypeMachine(machine, db); + + Machine m = await version.CreatePrototypeMachine(db); + } + } + + + public String CurrentPath { get { return (String)GetValue(CurrentPathProperty); } -- cgit v1.3.1