Diverse kleinere Änderungen und Erweiterungen, vor allem bzgl. der Validierung

This commit is contained in:
Daniel Schick 2022-01-05 15:14:21 +01:00
parent 64d8a6dbe3
commit e728d2060c
7 changed files with 79 additions and 6 deletions

View File

@ -18,7 +18,7 @@
<ColumnDefinition Width="220" /> <ColumnDefinition Width="220" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<xctk:AutoSelectTextBox x:Name="shipNameLabel" Grid.Row="0" Grid.Column="0" VerticalContentAlignment="Center" FontWeight="Bold" IsReadOnly="True" BorderThickness="0" AutoSelectBehavior="OnFocus" /> <xctk:AutoSelectTextBox x:Name="shipNameLabel" Grid.Row="0" Grid.Column="0" VerticalContentAlignment="Center" FontWeight="Bold" IsReadOnly="True" BorderThickness="0" AutoSelectBehavior="OnFocus" />
<Grid Grid.Row="0" Grid.Column="1"> <Grid Grid.Row="0" Grid.Column="1">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@ -26,7 +26,11 @@
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<xctk:AutoSelectTextBox x:Name="displayIdLabel" Width="Auto" VerticalContentAlignment="Center" FontWeight="Bold" IsReadOnly="True" BorderThickness="0" AutoSelectBehavior="OnFocus" /> <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0" >
<xctk:AutoSelectTextBox x:Name="displayIdLabel" Width="Auto" VerticalContentAlignment="Center" FontWeight="Bold" IsReadOnly="True" BorderThickness="0" AutoSelectBehavior="OnFocus" />
<Label Margin="10,0,0,0" Content="Ship e-mail:" VerticalContentAlignment="Center" />
<xctk:AutoSelectTextBox Width="400" x:Name="shipEMailLabel" VerticalContentAlignment="Center" FontWeight="Normal" IsReadOnly="True" BorderThickness="0" AutoSelectBehavior="OnFocus" />
</StackPanel>
<Button Name="buttonSave" Grid.Column="1" Grid.Row="0" Margin="2" Click="buttonSave_Click" BorderThickness="0" Background="Transparent" Visibility="Hidden"> <Button Name="buttonSave" Grid.Column="1" Grid.Row="0" Margin="2" Click="buttonSave_Click" BorderThickness="0" Background="Transparent" Visibility="Hidden">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Image Source="./Resources/floppy_disk_edit.png" Margin="0,0,5,0" Height="24" /> <Image Source="./Resources/floppy_disk_edit.png" Margin="0,0,5,0" Height="24" />

View File

@ -114,6 +114,7 @@ namespace ENI2
Core = aCore; Core = aCore;
InitializeComponent(); InitializeComponent();
shipNameLabel.Text = aCore.Shipname; shipNameLabel.Text = aCore.Shipname;
shipEMailLabel.Text = aCore.HerbergEmailContactReportingVessel;
displayIdLabel.Text = aCore.DisplayId; displayIdLabel.Text = aCore.DisplayId;
@ -684,6 +685,7 @@ namespace ENI2
Message pobaMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.POBA); Message pobaMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.POBA);
Message secMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.SEC); Message secMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.SEC);
Message noanodMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.NOA_NOD); 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 #region CREW / PAS Count Plausibility
@ -784,6 +786,68 @@ namespace ENI2
#endregion #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 #endregion
foreach (MessageError me in vErrors) foreach (MessageError me in vErrors)

View File

@ -37,7 +37,7 @@
<CreateWebPageOnPublish>true</CreateWebPageOnPublish> <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage> <WebPage>publish.html</WebPage>
<ApplicationRevision>0</ApplicationRevision> <ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>6.9.6.0</ApplicationVersion> <ApplicationVersion>6.9.7.0</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut> <CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted> <PublishWizardCompleted>true</PublishWizardCompleted>

View File

@ -165,7 +165,7 @@ namespace bsmd.database
int currentMax = 0; int currentMax = 0;
for(int i = 0; i < str.Length; i++) 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; if (currentMax > max) max = currentMax;
currentMax = 0; currentMax = 0;

View File

@ -512,6 +512,11 @@ namespace bsmd.database
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "No DPG on board set!", null, this.Title, null, this.Tablename)); 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) if (this.GetValidationBlock() == ValidationBlock.BLOCK2)
{ {
/* /*

View File

@ -2,6 +2,6 @@
[assembly: AssemblyCompany("schick Informatik")] [assembly: AssemblyCompany("schick Informatik")]
[assembly: AssemblyProduct("BSMD NSW interface")] [assembly: AssemblyProduct("BSMD NSW interface")]
[assembly: AssemblyInformationalVersion("6.9.6")] [assembly: AssemblyInformationalVersion("6.9.7")]
[assembly: AssemblyCopyright("Copyright © 2014-2021 schick Informatik")] [assembly: AssemblyCopyright("Copyright © 2014-2021 schick Informatik")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]

View File

@ -1,4 +1,4 @@
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("6.9.6.*")] [assembly: AssemblyVersion("6.9.7.*")]