ein bunter Strauß an Korrekturen

This commit is contained in:
Daniel Schick 2023-01-10 18:06:38 +01:00
parent c761c8a304
commit 00bc43790d
6 changed files with 51 additions and 2 deletions

View File

@ -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.8.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>

View File

@ -479,6 +479,30 @@ namespace bsmd.database
errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, "IMOClass", null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
}
if(!this.Bay.IsNullOrEmpty())
{
const string pattern = @"^[0-9]{3}$";
Regex regex = new Regex(pattern);
if (!regex.IsMatch(this.Bay))
errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, "Bay", null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
}
if(!this.Row.IsNullOrEmpty())
{
const string pattern = @"^[0-9]{2}$";
Regex regex = new Regex(pattern);
if (!regex.IsMatch(this.Row))
errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, "Row", null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
}
if(!this.Tier.IsNullOrEmpty())
{
const string pattern = @"^[0-9]{2}$";
Regex regex = new Regex(pattern);
if (!regex.IsMatch(this.Tier))
errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, "Tier", null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
}
}
#endregion

View File

@ -258,6 +258,16 @@ namespace bsmd.database
#endregion
#region Validation
public override void Validate(List<MessageError> errors, List<MessageViolation> violations)
{
if (this.TowageOnArrivalDraught_DMT.HasValue && ((this.TowageOnArrivalDraught_DMT.Value < 10) || (this.TowageOnArrivalDraught_DMT.Value > 200)))
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Check draught on arrival", null, this.Title, this.Identifier, this.Tablename));
}
#endregion
}
}

View File

@ -241,6 +241,16 @@ namespace bsmd.database
#endregion
#region Validation
public override void Validate(List<MessageError> errors, List<MessageViolation> violations)
{
if (this.TowageOnDepartureDraught_DMT.HasValue && ((this.TowageOnDepartureDraught_DMT.Value < 10) || (this.TowageOnDepartureDraught_DMT.Value > 200)))
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Check draught on departure", null, this.Title, this.Identifier, this.Tablename));
}
#endregion
}
}

View File

@ -25,7 +25,7 @@ namespace bsmd.database
[ShowReport]
[MaxLength(70)]
[ENI2Validation]
[Validation(ValidationCode.STRING_MAXLEN, 70)]
[Validation(ValidationCode.NOT_NULL_MAX_LEN, 70)]
public string TreatmentFacilityProviderName { get; set; }
public string Identifier { get; set; }

View File

@ -347,6 +347,11 @@ namespace bsmd.database
wasteReceived.Validate(errors, violations);
}
if(TreatmentFacilityProviderText.IsNullOrEmpty())
{
errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, "TreatmentFacilityProviderName empty", null, this.Title, this.IdentificationNumber, this.Tablename));
}
bool entryMissing = false;
string missingType = "";