diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2020-03-16 23:59:42 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2020-03-16 23:59:42 +0200 |
| commit | 3d09f9c2aef7ab4ca2c66a35c8c25a39bc748d1b (patch) | |
| tree | 5350946461539f9d54d63f28f7bca8ded2cf5898 /Software/Visual_Studio/Utilities/Tango.JobRunsGenerator/Program.cs | |
| parent | 3549567e8db23411a84e006229f3382d912209fb (diff) | |
| download | Tango-3d09f9c2aef7ab4ca2c66a35c8c25a39bc748d1b.tar.gz Tango-3d09f9c2aef7ab4ca2c66a35c8c25a39bc748d1b.zip | |
Implemented job runs individual liquid quantities.
Added to job runs fixer.
Diffstat (limited to 'Software/Visual_Studio/Utilities/Tango.JobRunsGenerator/Program.cs')
| -rw-r--r-- | Software/Visual_Studio/Utilities/Tango.JobRunsGenerator/Program.cs | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Utilities/Tango.JobRunsGenerator/Program.cs b/Software/Visual_Studio/Utilities/Tango.JobRunsGenerator/Program.cs index 0f53e1504..b8031fdaf 100644 --- a/Software/Visual_Studio/Utilities/Tango.JobRunsGenerator/Program.cs +++ b/Software/Visual_Studio/Utilities/Tango.JobRunsGenerator/Program.cs @@ -19,7 +19,7 @@ namespace Tango.JobRunsGenerator static void Main(string[] args) { DataSource dataSource = new DataSource(); - dataSource.Catalog = "Tango_TEST"; + dataSource.Catalog = "Tango_DEV"; dataSource.Address = "twine.database.windows.net"; dataSource.IntegratedSecurity = false; dataSource.UserName = "Roy"; @@ -78,6 +78,44 @@ namespace Tango.JobRunsGenerator if (run.ActualStartDate == null) run.ActualStartDate = run.StartDate; run.IsGradient = job.Segments.Any(x => x.BrushStops.Count > 1); + //Set new liquid quantities. + if (run.CyanQuantity == 0 && + run.MagentaQuantity == 0 && + run.YellowQuantity == 0 && + run.BlackQuantity == 0 && + run.TransparentQuantity == 0 && + run.LubricantQuantity == 0 && + run.CleanerQuantity == 0) + { + //Cyan + var cyan = run.LiquidQuantities.FirstOrDefault(x => x.LiquidType == BL.Enumerations.LiquidTypes.Cyan); + run.CyanQuantity = cyan != null ? cyan.Quantity : 0; + + //Magenta + var magenta = run.LiquidQuantities.FirstOrDefault(x => x.LiquidType == BL.Enumerations.LiquidTypes.Magenta); + run.MagentaQuantity = magenta != null ? magenta.Quantity : 0; + + //Yellow + var yellow = run.LiquidQuantities.FirstOrDefault(x => x.LiquidType == BL.Enumerations.LiquidTypes.Yellow); + run.YellowQuantity = yellow != null ? yellow.Quantity : 0; + + //Black + var black = run.LiquidQuantities.FirstOrDefault(x => x.LiquidType == BL.Enumerations.LiquidTypes.Black); + run.BlackQuantity = black != null ? black.Quantity : 0; + + //TI + var ti = run.LiquidQuantities.FirstOrDefault(x => x.LiquidType == BL.Enumerations.LiquidTypes.TransparentInk); + run.TransparentQuantity = ti != null ? ti.Quantity : 0; + + //Lubricant + var lubricant = run.LiquidQuantities.FirstOrDefault(x => x.LiquidType == BL.Enumerations.LiquidTypes.Lubricant); + run.LubricantQuantity = lubricant != null ? lubricant.Quantity : 0; + + //Lubricant + var cleaner = run.LiquidQuantities.FirstOrDefault(x => x.LiquidType == BL.Enumerations.LiquidTypes.Cleaner); + run.CleanerQuantity = cleaner != null ? cleaner.Quantity : 0; + } + saveIndex++; if (saveIndex > 100) |
