verhindere das Versenden von WAS Meldungen mit alten WasteCodes. Führt auch bei OK in der ENI Anzeige zu einer roten Karte

This commit is contained in:
Daniel Schick 2022-06-22 09:22:39 +02:00
parent 05d378536e
commit 83db340099
3 changed files with 11 additions and 2 deletions

View File

@ -207,6 +207,9 @@ namespace bsmd.database
} }
} }
} }
public static bool find<T>(this T[] array, T target)
{
return array.Contains(target);
}
} }
} }

View File

@ -54,6 +54,8 @@ namespace bsmd.database
"101", "102", "103", "104", "105", "999", "201", "202", "203", "204", "401", "501", "502", "503", "504", "505", "506", "507", "508", "509", "510", "511", "601", "602", "991" "101", "102", "103", "104", "105", "999", "201", "202", "203", "204", "401", "501", "502", "503", "504", "505", "506", "507", "508", "509", "510", "511", "601", "602", "991"
}; };
public static int[] WasteCodesInt { get; } = { 101, 102, 103, 104, 105, 999, 201, 202, 203, 204, 401, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 601, 602, 991 };
/// <summary> /// <summary>
/// NSW 7.0 Waste descriptions /// NSW 7.0 Waste descriptions
/// </summary> /// </summary>

View File

@ -1219,9 +1219,13 @@ namespace bsmd.hisnord
{ {
for (int i = 0; i < was.Waste.Count; i++) for (int i = 0; i < was.Waste.Count; i++)
{ {
waste hn_waste = new waste();
Waste waste = was.Waste[i]; Waste waste = was.Waste[i];
if (!waste.WasteType.HasValue) continue;
if (!WAS.WasteCodesInt.find<int>(waste.WasteType.Value)) continue;
waste hn_waste = new waste();
if (waste.WasteDisposalAmount_MTQ.HasValue) if (waste.WasteDisposalAmount_MTQ.HasValue)
hn_waste.WasteDisposalAmount_MTQ = Math.Round((decimal)waste.WasteDisposalAmount_MTQ.Value, 3); hn_waste.WasteDisposalAmount_MTQ = Math.Round((decimal)waste.WasteDisposalAmount_MTQ.Value, 3);