From d8872b5ec261abcc30d125a01574c1491f957627 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Fri, 23 Nov 2018 09:38:33 +0000 Subject: [PATCH] =?UTF-8?q?Version=205.1.2=20Zwischenstand=20(weitere=20Va?= =?UTF-8?q?lidierungen=20gem=C3=A4=C3=9F=20Trello-Karten)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs | 53 +++++++++++++++++- ...aritimeHealthDeclarationDetailControl.xaml | 2 + ...timeHealthDeclarationDetailControl.xaml.cs | 2 +- .../SecurityDetailControl.xaml | 8 ++- .../SecurityDetailControl.xaml.cs | 4 +- ENI-2/ENI2/ENI2/ENI2.csproj | 4 +- Stundensheet.xlsx | Bin 39345 -> 39441 bytes nsw/Source/bsmd.database/POBA.cs | 7 ++- nsw/Source/bsmd.database/POBD.cs | 7 ++- .../Properties/AssemblyProductInfo.cs | 2 +- .../Properties/AssemblyProjectInfo.cs | 2 +- 11 files changed, 77 insertions(+), 14 deletions(-) diff --git a/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs index 8cf2dbe7..44ae9619 100644 --- a/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs +++ b/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs @@ -404,6 +404,13 @@ namespace ENI2 DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(currentControl.Core); } + if(message.MessageNotificationClass == Message.NotificationClass.STAT) + { + DetailBaseControl currentControl = this.detailView.Children[0] as DetailBaseControl; + currentControl.Core.IsSmallShip = ((STAT)message.Elements[0]).GrossTonnage < 500; + DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(currentControl.Core); + } + } } @@ -614,7 +621,11 @@ namespace ENI2 Message crewMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.CREW); Message pasMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.PAS); 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); + + #region CREW / PAS Count Plausibility + if (pobaMessage.Elements.Count == 1) { POBA poba = pobaMessage.Elements[0] as POBA; @@ -632,11 +643,49 @@ namespace ENI2 mv.MessageGroupName = Properties.Resources.textOverview; vViolations.Add(mv); } - } #endregion + #region Kiel Canal Timing Plausibility + + if(!this.Core.IsTransit && (secMessage?.Elements.Count > 0) && (noanodMessage?.Elements.Count > 0)) + { + SEC sec = secMessage.Elements[0] as SEC; + NOA_NOD noa_nod = noanodMessage.Elements[0] as NOA_NOD; + + if (sec.KielCanalPassagePlanned ?? false) + { + // Überprüfung, ob die eingehende NOK-Durchfahrt auch wirklich innerhalb der eingehenden Reise liegt (bei VISIT) + bool isValidIncoming = (noa_nod.ETDFromLastPort < sec.KielCanalPassagePlannedIncomming) && + (sec.KielCanalPassagePlannedIncomming < noa_nod.ETAToPortOfCall); + if (!sec.KielCanalPassagePlannedIncomming.HasValue) isValidIncoming = true; + + if(!isValidIncoming) + { + MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Kiel Canal incoming implausible (ETD / ETA ports)!", null, "Kiel Canal timing", null, "SEC"); + mv.MessageGroupName = Properties.Resources.textOverview; + vViolations.Add(mv); + } + + + bool isValidOutgoing = (noa_nod.ETDFromPortOfCall < sec.KielCanalPassagePlannedOutgoing) && + ((noa_nod.NextPort == "ZZUKN") || (sec.KielCanalPassagePlannedOutgoing < noa_nod.ETAToNextPort)); + if (!sec.KielCanalPassagePlannedOutgoing.HasValue) isValidOutgoing = true; + + if(!isValidOutgoing) + { + MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Kiel Canal outgoing implausible (ETD / ETA ports)!", null, "Kiel Canal timing", null, "SEC"); + mv.MessageGroupName = Properties.Resources.textOverview; + vViolations.Add(mv); + } + } + } + + #endregion + + #endregion + foreach (MessageError me in vErrors) { this.highlightService.HighlightError(me, this.GetContainerForMessageGroupName(me.MessageGroupName)); diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml b/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml index 5ab50c05..b2a4e573 100644 --- a/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml +++ b/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml @@ -99,6 +99,8 @@