diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-22 16:30:00 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-22 16:30:00 +0300 |
| commit | 86339c9b8e383b92e183ee443c5bfbebd05808e7 (patch) | |
| tree | 02e781b86e30d7615c657819ae8e1e98d6abfae8 /Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs | |
| parent | 072ee0c67a5c9c45be60fa3da915a493731e5b35 (diff) | |
| download | Tango-86339c9b8e383b92e183ee443c5bfbebd05808e7.tar.gz Tango-86339c9b8e383b92e183ee443c5bfbebd05808e7.zip | |
ColorLab Module seems to be working ok...
Diffstat (limited to 'Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs | 59 |
1 files changed, 26 insertions, 33 deletions
diff --git a/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs b/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs index 04967734a..8d3389d32 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Data.Entity; using System.Data.Entity.Infrastructure; using System.Data.SQLite; @@ -169,14 +170,16 @@ namespace Tango.BL /// <returns></returns> public Configuration GetConfiguration(Expression<Func<Configuration, bool>> condition) { - return Configurations.Where(condition) - .Include(x => x.IdsPacks) - .Include(x => x.IdsPacks.Select(y => y.LiquidType)) - .Include(x => x.IdsPacks.Select(y => y.DispenserType)) - .Include(x => x.IdsPacks.Select(y => y.CartridgeType)) - .Include(x => x.IdsPacks.Select(y => y.DispenserType)) - .Include(x => x.IdsPacks.Select(y => y.IdsPackFormula)) - .SingleOrDefault(condition); + var config = Configurations.SingleOrDefault(condition); + + config.IdsPacks = IdsPacks.Where(x => x.ConfigurationGuid == config.Guid) + .Include(x => x.LiquidType) + .Include(x => x.DispenserType) + .Include(x => x.CartridgeType) + .Include(x => x.DispenserType) + .Include(x => x.IdsPackFormula).OrderBy(x => x.PackIndex).ToObservableCollection(); + + return config; } public HardwareVersion GetHardwareVersion(Expression<Func<HardwareVersion, bool>> condition) @@ -192,31 +195,6 @@ namespace Tango.BL version.HardwareWinders = HardwareWinders.Where(x => x.HardwareVersionGuid == version.Guid).Include(x => x.HardwareWinderType).ToList().OrderBy(x => x.HardwareWinderType.Code).ToObservableCollection(); return version; - - //return HardwareVersions.Where(condition) - - // .Include(x => x.HardwareBlowers.OrderBy(s => s.HardwareBlowerType.Code)) - // .Include(x => x.HardwareBlowers.Select(y => y.HardwareBlowerType)) - - // .Include(x => x.HardwareBreakSensors) - // .Include(x => x.HardwareBreakSensors.Select(y => y.HardwareBreakSensorType)) - - // .Include(x => x.HardwareDancers) - // .Include(x => x.HardwareDancers.Select(y => y.HardwareDancerType)) - - // .Include(x => x.HardwareMotors) - // .Include(x => x.HardwareMotors.Select(y => y.HardwareMotorType)) - - // .Include(x => x.HardwarePidControls) - // .Include(x => x.HardwarePidControls.Select(y => y.HardwarePidControlType)) - - // .Include(x => x.HardwareSpeedSensors) - // .Include(x => x.HardwareSpeedSensors.Select(y => y.HardwareSpeedSensorType)) - - // .Include(x => x.HardwareWinders) - // .Include(x => x.HardwareWinders.Select(y => y.HardwareWinderType)) - - // .SingleOrDefault(condition); } public HardwareVersion GetHardwareVersionByMachine(String machineGuid) @@ -230,6 +208,21 @@ namespace Tango.BL return ProcessParametersTablesGroups.Where(x => x.RmlGuid == rmlGuid && x.Active).Include(x => x.ProcessParametersTables).FirstOrDefault(); } + public ObservableCollection<Cct> GetRmlCCTs(String rmlGuid) + { + return Ccts.Where(x => x.RmlGuid == rmlGuid).ToObservableCollection(); + } + + public ObservableCollection<Cat> GetRmlCATs(String rmlGuid, String machineGuid) + { + return Cats.Where(x => x.MachineGuid == machineGuid && x.RmlGuid == rmlGuid).ToObservableCollection(); + } + + public ObservableCollection<LiquidTypesRml> GetRmlLiquidTypes(String rmlGuid) + { + return LiquidTypesRmls.Where(x => x.RmlGuid == rmlGuid).ToObservableCollection(); + } + #endregion } } |
