aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.BL
diff options
context:
space:
mode:
authorRoy <Roy.mail.net@gmail.com>2023-02-16 18:05:43 +0200
committerRoy <Roy.mail.net@gmail.com>2023-02-16 18:05:43 +0200
commitc4f90cfc1387d1bb1a9ea7f69b1058a7b70e3d49 (patch)
treed736146636231e2bf2a39fd7a3c6045063c6d8ad /Software/Visual_Studio/Tango.BL
parent591fb3cbef11e81cbf734df5a92826ac5dbd7af8 (diff)
downloadTango-c4f90cfc1387d1bb1a9ea7f69b1058a7b70e3d49.tar.gz
Tango-c4f90cfc1387d1bb1a9ea7f69b1058a7b70e3d49.zip
Several bug fixes.
Diffstat (limited to 'Software/Visual_Studio/Tango.BL')
-rw-r--r--Software/Visual_Studio/Tango.BL/Helpers/SegmentsCsvHelper.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.BL/Helpers/SegmentsCsvHelper.cs b/Software/Visual_Studio/Tango.BL/Helpers/SegmentsCsvHelper.cs
index 704e005fe..18dde341b 100644
--- a/Software/Visual_Studio/Tango.BL/Helpers/SegmentsCsvHelper.cs
+++ b/Software/Visual_Studio/Tango.BL/Helpers/SegmentsCsvHelper.cs
@@ -161,6 +161,14 @@ namespace Tango.BL.Helpers
if (rml == null) throw new InvalidOperationException($"Thread type '{threadName}' not found.");
}
+ if (machine.SiteGuid != null)
+ {
+ if (!context.SitesRmls.Any(x => x.SiteGuid == machine.SiteGuid && x.RmlGuid == rml.Guid))
+ {
+ throw new InvalidOperationException($"Thread type '{threadName}' is not allowed for this machine's site.");
+ }
+ }
+
var idsPacks = machine.Configuration.NoneEmptyIdsPacks.ToList();
var cyanIdsPack = idsPacks.FirstOrDefault(x => x.LiquidType.Type == LiquidTypes.Cyan);
@@ -357,6 +365,14 @@ namespace Tango.BL.Helpers
throw new InvalidOperationException($"Catalog '{row.CatalogName1}' not found on line '{lineCount}'.");
}
+ if (machine.SiteGuid != null)
+ {
+ if (!context.SitesCatalogs.Any(x => x.SiteGuid == machine.SiteGuid && x.ColorCatalogGuid == catalog.Guid))
+ {
+ throw new InvalidOperationException($"Catalog '{catalog.Name}' is not assigned for this machine's site.");
+ }
+ }
+
var item = catalog.ColorCatalogsGroups.SelectMany(x => x.ColorCatalogsItems).FirstOrDefault(x => x.Name == row.CatalogItem1);
if (item == null)
{
@@ -374,6 +390,14 @@ namespace Tango.BL.Helpers
throw new InvalidOperationException($"Catalog '{row.CatalogName2}' not found on line '{lineCount}'.");
}
+ if (machine.SiteGuid != null)
+ {
+ if (!context.SitesCatalogs.Any(x => x.SiteGuid == machine.SiteGuid && x.ColorCatalogGuid == catalog2.Guid))
+ {
+ throw new InvalidOperationException($"Catalog '{catalog2.Name}' is not assigned for this machine's site.");
+ }
+ }
+
var item2 = catalog2.ColorCatalogsGroups.SelectMany(x => x.ColorCatalogsItems).FirstOrDefault(x => x.Name == row.CatalogItem2);
if (item2 == null)
{