diff options
| author | Roy <Roy.mail.net@gmail.com> | 2022-09-20 13:22:26 +0300 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2022-09-20 13:22:26 +0300 |
| commit | a2c128c1c00ac74c9c1835a8581aa8f2c4123bde (patch) | |
| tree | 82a10267e4bc4b84063dd91b4af5e246c9260605 /Software/Visual_Studio/Tango.BL | |
| parent | 2678b315131494f8018e62f11468f76a5febf374 (diff) | |
| download | Tango-a2c128c1c00ac74c9c1835a8581aa8f2c4123bde.tar.gz Tango-a2c128c1c00ac74c9c1835a8581aa8f2c4123bde.zip | |
Modified all uses of RML to include GBD and LUB.
Diffstat (limited to 'Software/Visual_Studio/Tango.BL')
4 files changed, 36 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.BL/Builders/JobBuilder.cs b/Software/Visual_Studio/Tango.BL/Builders/JobBuilder.cs index 970309a96..cc1379cad 100644 --- a/Software/Visual_Studio/Tango.BL/Builders/JobBuilder.cs +++ b/Software/Visual_Studio/Tango.BL/Builders/JobBuilder.cs @@ -64,6 +64,7 @@ namespace Tango.BL.Builders WithActiveParametersGroup(). WithCctCache(cctCache). WithCCT(). + WithGbdAndLub(). WithCAT(Entity.MachineGuid). WithSpools(). WithLiquidFactors().Build(); diff --git a/Software/Visual_Studio/Tango.BL/Builders/RmlBuilder.cs b/Software/Visual_Studio/Tango.BL/Builders/RmlBuilder.cs index 22c936f83..166c77f11 100644 --- a/Software/Visual_Studio/Tango.BL/Builders/RmlBuilder.cs +++ b/Software/Visual_Studio/Tango.BL/Builders/RmlBuilder.cs @@ -71,10 +71,18 @@ namespace Tango.BL.Builders } } - public virtual RmlBuilder WithSpools() + public virtual RmlBuilder WithGbdAndLub() { return AddQueryStep(2, (query) => { + return query.Include(x => x.Gbd).Include(x => x.Lub); + }); + } + + public virtual RmlBuilder WithSpools() + { + return AddQueryStep(3, (query) => + { return query.Include(x => x.RmlsSpools).Include(x => x.RmlsSpools.Select(y => y.SpoolType)); }); } diff --git a/Software/Visual_Studio/Tango.BL/Builders/RmlsCollectionBuilder.cs b/Software/Visual_Studio/Tango.BL/Builders/RmlsCollectionBuilder.cs index 5ea223a73..82ccaf20d 100644 --- a/Software/Visual_Studio/Tango.BL/Builders/RmlsCollectionBuilder.cs +++ b/Software/Visual_Studio/Tango.BL/Builders/RmlsCollectionBuilder.cs @@ -63,6 +63,14 @@ namespace Tango.BL.Builders }); } + public virtual RmlsCollectionBuilder WithGbdAndLub() + { + return AddQueryStep(5, (query) => + { + return query.Include(x => x.Gbd).Include(x => x.Lub); + }); + } + public virtual RmlsCollectionBuilder WithAllParametersGroup() { return AddStep(1, () => diff --git a/Software/Visual_Studio/Tango.BL/Entities/Rml.cs b/Software/Visual_Studio/Tango.BL/Entities/Rml.cs index b6f81a52f..4c9f11127 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Rml.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Rml.cs @@ -130,6 +130,8 @@ namespace Tango.BL.Entities String result = rml.ToJson(new EntitySerializationStrategy() .Include(() => rml.Cct) + .Include(() => rml.Gbd) + .Include(() => rml.Lub) .Include(() => rml.LiquidTypesRmls) .Include(() => rml.ProcessParametersTablesGroups) .Include(() => rml.RmlsSpools) @@ -159,6 +161,22 @@ namespace Tango.BL.Entities } } + if (rml.Gbd != null) + { + if (context.Gbds.Any(x => x.Guid == rml.Gbd.Guid)) + { + rml.Gbd = null; + } + } + + if (rml.Lub != null) + { + if (context.Lubs.Any(x => x.Guid == rml.Lub.Guid)) + { + rml.Lub = null; + } + } + rml.LastUpdated = DateTime.UtcNow; rml.Code = context.Rmls.Max(x => x.Code) + 1; |
