[chore:] more warnings and errors (plz/pplz)
This commit is contained in:
@@ -17,7 +17,8 @@ public class AddressCheck
|
||||
// empty,
|
||||
FullAddressTooLong,
|
||||
DoubledRefsid,
|
||||
MayBeSameAddress
|
||||
MayBeSameAddress,
|
||||
NoPLZorPPLZ
|
||||
}
|
||||
|
||||
public enum WarningTypes
|
||||
@@ -26,7 +27,9 @@ public class AddressCheck
|
||||
NoStreet,
|
||||
NoLastName,
|
||||
NoFirstName,
|
||||
NoStreetNumber
|
||||
NoStreetNumber,
|
||||
NoPLZ,
|
||||
NoPPLZ
|
||||
}
|
||||
|
||||
private readonly ProgressWindow _progress;
|
||||
@@ -53,6 +56,13 @@ public class AddressCheck
|
||||
var address_component_count = 2; // cause anrede and name are first
|
||||
|
||||
// PLZ-Prüfung
|
||||
if (person.plz == 0 || person.plz == null)
|
||||
{
|
||||
hasFaults = true;
|
||||
warnings.Add(WarningTypes.NoPLZ);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((person.plz < 10000 && string.IsNullOrWhiteSpace(person.land)) ||
|
||||
(person.plz < 10000 && person.land == "GER") ||
|
||||
(person.plz < 10000 && person.land == "DE"))
|
||||
@@ -67,8 +77,17 @@ public class AddressCheck
|
||||
hasFaults = true;
|
||||
errors.Add(ErrorTypes.PlzTooLong);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// PPLZ-Prüfung
|
||||
if (person.pplz == 0 || person.pplz == null)
|
||||
{
|
||||
hasFaults = true;
|
||||
warnings.Add(WarningTypes.NoPPLZ);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((person.pplz < 10000 && string.IsNullOrWhiteSpace(person.land)) ||
|
||||
(person.pplz < 10000 && person.land == "GER") ||
|
||||
(person.pplz < 10000 && person.land == "DE"))
|
||||
@@ -83,6 +102,13 @@ public class AddressCheck
|
||||
hasFaults = true;
|
||||
errors.Add(ErrorTypes.PPlzTooLong);
|
||||
}
|
||||
}
|
||||
|
||||
if (warnings.Contains(WarningTypes.NoPLZ) && warnings.Contains(WarningTypes.NoPPLZ))
|
||||
{
|
||||
hasFaults = true;
|
||||
errors.Add(ErrorTypes.NoPLZorPPLZ);
|
||||
}
|
||||
|
||||
// Ort-Prüfung
|
||||
if (string.IsNullOrWhiteSpace(person.ort))
|
||||
|
||||
Reference in New Issue
Block a user