fixed validation even with some missing strings in the database
This commit is contained in:
parent
c97b9a72f5
commit
9ffbd23cb7
@ -36,7 +36,7 @@
|
||||
<MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion>
|
||||
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
|
||||
<WebPage>publish.html</WebPage>
|
||||
<ApplicationRevision>2</ApplicationRevision>
|
||||
<ApplicationRevision>3</ApplicationRevision>
|
||||
<ApplicationVersion>7.11.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
||||
|
||||
@ -543,6 +543,7 @@ namespace bsmd.database
|
||||
foreach(IGCPosition igc in this.IGCPositions)
|
||||
{
|
||||
RuleEngine.ValidateProperties(igc, errors, violations);
|
||||
igc.Validate(errors, violations);
|
||||
}
|
||||
|
||||
foreach(IMSBCPosition imsbc in this.IMSBCPositions)
|
||||
|
||||
@ -203,11 +203,10 @@ namespace bsmd.database
|
||||
{
|
||||
|
||||
if (!this.UNNumber.IsNullOrEmpty() && !unNumberRegex.IsMatch(this.UNNumber))
|
||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "UNNumber", this.UNNumber, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
|
||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "UNNumber", null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
|
||||
|
||||
if (!this.IMOClass.IsNullOrEmpty() && !imoClassRegex.IsMatch(this.IMOClass))
|
||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "IMOClass", this.IMOClass, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
|
||||
|
||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "IMOClass", null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@ -238,19 +238,23 @@ namespace bsmd.database
|
||||
{
|
||||
if(!MHB ?? false)
|
||||
{
|
||||
if(this.UNNumber.IsNullOrEmpty() || !unNumberRegex.IsMatch(this.UNNumber))
|
||||
if(this.UNNumber.IsNullOrEmpty())
|
||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.V803, "UNNumber", this.UNNumber, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
|
||||
|
||||
if (this.IMOClass.IsNullOrEmpty() || !imoClassRegex.IsMatch(this.IMOClass))
|
||||
if (this.IMOClass.IsNullOrEmpty())
|
||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.V803, "IMOClass", this.IMOClass, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
|
||||
}
|
||||
|
||||
if(!this.UNNumber.IsNullOrEmpty() && !unNumberRegex.IsMatch(this.UNNumber))
|
||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "UNNumber", null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
|
||||
|
||||
if(!this.IMOClass.IsNullOrEmpty() && !imoClassRegex.IsMatch(this.IMOClass))
|
||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "IMOClass", null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
|
||||
|
||||
if (!this.IMOHazardClass.HasValue)
|
||||
{
|
||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.V810, "Hazards", null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Loading…
Reference in New Issue
Block a user