Trellokarte:

Validierung ETAPortOfCall / ETDFromLastPort damit nicht versehentlich "alte" Datumswerte versendet werden zum Jahreswechsel
This commit is contained in:
Daniel Schick 2020-11-08 18:36:03 +00:00
parent 3e8a156ec9
commit 5979f40642

View File

@ -250,6 +250,16 @@ namespace bsmd.database
(this.ETDFromPortOfCall < this.ETAToPortOfCall))
errors.Add(RuleEngine.CreateError(ValidationCode.E121, "ETDFromPortOfCall", this.ETDFromPortOfCall.ToString(), this.Title, null, this.Tablename));
// 8.11.20 Validierung gegen ETA /ETD in der Vergangenheit
if(this.ETAToPortOfCall < DateTime.Now)
{
violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "ETAToPortOfCall", this.ETAToPortOfCall.Value.ToString(), this.Title, null, this.Tablename));
}
if(this.ETDFromLastPort < (DateTime.Now.AddDays(-14)))
{
violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "ETDFromLastPort", this.ETDFromLastPort.Value.ToString(), this.Title, null, this.Tablename));
}
if (this.CallPurposes.IsNullOrEmpty())
{
errors.Add(RuleEngine.CreateError(ValidationCode.LIST_EMPTY, "CallPurposes", "CallPurpose", this.Title, null, this.Tablename));