diff --git a/ENI2/DetailRootControl.xaml b/ENI2/DetailRootControl.xaml index 1cad92f0..17abedfa 100644 --- a/ENI2/DetailRootControl.xaml +++ b/ENI2/DetailRootControl.xaml @@ -18,7 +18,7 @@ - + @@ -26,7 +26,11 @@ - + + + + + diff --git a/ENI2/DetailRootControl.xaml.cs b/ENI2/DetailRootControl.xaml.cs index 1498a3dc..2188c966 100644 --- a/ENI2/DetailRootControl.xaml.cs +++ b/ENI2/DetailRootControl.xaml.cs @@ -114,6 +114,7 @@ namespace ENI2 Core = aCore; InitializeComponent(); shipNameLabel.Text = aCore.Shipname; + shipEMailLabel.Text = aCore.HerbergEmailContactReportingVessel; displayIdLabel.Text = aCore.DisplayId; @@ -684,6 +685,7 @@ namespace ENI2 Message pobaMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.POBA); Message secMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.SEC); Message noanodMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.NOA_NOD); + Message mdhMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.MDH); #region CREW / PAS Count Plausibility @@ -784,6 +786,68 @@ namespace ENI2 #endregion + #region SEC / MDH last port + + { // scope to hide sec + // 5.1.22 "Generell zu Überprüfen wäre: + // Sind alle Einträge aus SEC, die innerhalb der letzten 30 Tag liegen, gem. LoCode und ETD auch in der MDH-Liste enthalten ?" + if ((secMessage.Elements[0] is SEC sec) && (mdhMessage.Elements[0] is MDH mdh)) + { + NOA_NOD noa_nod = noanodMessage.Elements[0] as NOA_NOD; + DateTime refDate = DateTime.Now; + if (this.Core.IsTransit) + { + if (noa_nod.ETAToKielCanal.HasValue) + refDate = noa_nod.ETAToKielCanal.Value.Date; + else + refDate = this.Core.ETAKielCanal.Value; + } + else + { + if (noa_nod.ETAToPortOfCall.HasValue) + refDate = noa_nod.ETAToPortOfCall.Value.Date; + else + refDate = this.Core.ETA.Value; + } + + foreach (LastTenPortFacilitiesCalled l10c in sec.LastTenPortFacilitesCalled) + { + if (!l10c.PortFacilityDateOfDeparture.HasValue) continue; + if ((refDate - l10c.PortFacilityDateOfDeparture.Value).TotalDays < 31) + { + if (!l10c.PortFacilityPortLoCode.IsNullOrEmpty() && l10c.PortFacilityDateOfDeparture.HasValue) // this valid entry needs a match in mdh + { + bool matchIsFound = false; + + foreach (PortOfCallLast30Days poc30d in mdh.PortOfCallLast30Days) + { + if (poc30d.PortOfCallLast30DaysDateOfDeparture.HasValue && !poc30d.PortOfCallLast30DaysLocode.IsNullOrEmpty()) + { + if((poc30d.PortOfCallLast30DaysDateOfDeparture.Value.Date == l10c.PortFacilityDateOfDeparture.Value.Date) && + poc30d.PortOfCallLast30DaysLocode.Equals(l10c.PortFacilityPortLoCode, StringComparison.OrdinalIgnoreCase)) + { + matchIsFound = true; + break; + } + } + } + + if (!matchIsFound) + { + string msg = string.Format("SEC / MDH last ports do not match (Locode, Date) at {0}", l10c.Identifier); + MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, msg, null, "SEC/MDH comparison", null, "SEC"); + mv.MessageGroupName = Properties.Resources.textOverview; + vViolations.Add(mv); + break; // report this only once.. + } + } + } + } + } + } + + #endregion + #endregion foreach (MessageError me in vErrors) diff --git a/ENI2/ENI2.csproj b/ENI2/ENI2.csproj index d7ff2844..c3ace0e9 100644 --- a/ENI2/ENI2.csproj +++ b/ENI2/ENI2.csproj @@ -37,7 +37,7 @@ true publish.html 0 - 6.9.6.0 + 6.9.7.0 false true true diff --git a/bsmd.database/Extensions.cs b/bsmd.database/Extensions.cs index 1cfc4e05..fe65bb6c 100644 --- a/bsmd.database/Extensions.cs +++ b/bsmd.database/Extensions.cs @@ -165,7 +165,7 @@ namespace bsmd.database int currentMax = 0; for(int i = 0; i < str.Length; i++) { - if(Char.IsWhiteSpace(str[i])) + if(Char.IsWhiteSpace(str[i]) || (str[i] == '-')) { if (currentMax > max) max = currentMax; currentMax = 0; diff --git a/bsmd.database/HAZ.cs b/bsmd.database/HAZ.cs index 932e976d..e73ce1e2 100644 --- a/bsmd.database/HAZ.cs +++ b/bsmd.database/HAZ.cs @@ -512,6 +512,11 @@ namespace bsmd.database violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "No DPG on board set!", null, this.Title, null, this.Tablename)); } + if((NoDPGOnBoardOnArrival ?? false) && this.HasPositions) + { + violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "HAZ Positions but Dangerous Goods on Board NOT set!", null, this.Title, null, this.Tablename)); + } + if (this.GetValidationBlock() == ValidationBlock.BLOCK2) { /* diff --git a/bsmd.database/Properties/AssemblyProductInfo.cs b/bsmd.database/Properties/AssemblyProductInfo.cs index 56433034..44700af9 100644 --- a/bsmd.database/Properties/AssemblyProductInfo.cs +++ b/bsmd.database/Properties/AssemblyProductInfo.cs @@ -2,6 +2,6 @@ [assembly: AssemblyCompany("schick Informatik")] [assembly: AssemblyProduct("BSMD NSW interface")] -[assembly: AssemblyInformationalVersion("6.9.6")] +[assembly: AssemblyInformationalVersion("6.9.7")] [assembly: AssemblyCopyright("Copyright © 2014-2021 schick Informatik")] [assembly: AssemblyTrademark("")] \ No newline at end of file diff --git a/bsmd.database/Properties/AssemblyProjectInfo.cs b/bsmd.database/Properties/AssemblyProjectInfo.cs index d1d2dc6c..4a6af72d 100644 --- a/bsmd.database/Properties/AssemblyProjectInfo.cs +++ b/bsmd.database/Properties/AssemblyProjectInfo.cs @@ -1,4 +1,4 @@ using System.Reflection; -[assembly: AssemblyVersion("6.9.6.*")] +[assembly: AssemblyVersion("6.9.7.*")]