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