merged release/eni_7.6

This commit is contained in:
Daniel Schick 2022-11-03 10:35:44 +01:00
commit b5d449b885
17 changed files with 64 additions and 42 deletions

View File

@ -649,7 +649,7 @@ namespace ENI2
{ {
aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED; aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED;
aMessage.ChangedBy = ""; aMessage.ChangedBy = "";
aMessage.StatusInfo = string.Format("Validation error: NOA_NOD must be sent before ATA"); aMessage.StatusInfo = string.Format("Validation error 142: NOA_NOD must be sent before ATA");
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage); DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage);
} }
} }
@ -660,7 +660,7 @@ namespace ENI2
{ {
aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED; aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED;
aMessage.ChangedBy = ""; aMessage.ChangedBy = "";
aMessage.StatusInfo = string.Format("Validation error: NOA_NOD must be sent before ATD"); aMessage.StatusInfo = string.Format("Validation error 142: NOA_NOD must be sent before ATD");
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage); DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage);
} }
@ -668,7 +668,7 @@ namespace ENI2
{ {
aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED; aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED;
aMessage.ChangedBy = ""; aMessage.ChangedBy = "";
aMessage.StatusInfo = string.Format("Validation error: ATA must be sent before ATD"); aMessage.StatusInfo = string.Format("Validation error 143: ATA must be sent before ATD");
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage); DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage);
} }
} }

View File

@ -47,7 +47,7 @@
<xctk:DateTimePicker Grid.Column="3" Grid.Row="0" Value="{Binding ETDFromPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETDFromPortOfCall" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" Minimum="1899.12.31 00:00" Maximum="2100.12.31 00:00" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/> <xctk:DateTimePicker Grid.Column="3" Grid.Row="0" Value="{Binding ETDFromPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETDFromPortOfCall" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" Minimum="1899.12.31 00:00" Maximum="2100.12.31 00:00" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/>
<xctk:DateTimePicker Grid.Column="1" Grid.Row="1" Value="{Binding ETAToKielCanal, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETAToKielCanal" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" Minimum="1899.12.31 00:00" Maximum="2100.12.31 00:00" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/> <xctk:DateTimePicker Grid.Column="1" Grid.Row="1" Value="{Binding ETAToKielCanal, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETAToKielCanal" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" Minimum="1899.12.31 00:00" Maximum="2100.12.31 00:00" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/>
<xctk:DateTimePicker Grid.Column="3" Grid.Row="1" Value="{Binding ETDFromKielCanal, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETDFromKielCanal" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" Minimum="1899.12.31 00:00" Maximum="2100.12.31 00:00" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/> <xctk:DateTimePicker Grid.Column="3" Grid.Row="1" Value="{Binding ETDFromKielCanal, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETDFromKielCanal" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" Minimum="1899.12.31 00:00" Maximum="2100.12.31 00:00" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/>
<enictrl:LocodeControl Grid.Column="1" Grid.Row="2" Width="Auto" x:Name="locodeControl_LastPort" LocodeValue="{Binding LastPort, Mode=TwoWay}"/> <enictrl:LocodeControl Grid.Column="1" Grid.Row="2" Width="Auto" x:Name="locodeControl_LastPort" LocodeValue="{Binding LastPort, Mode=TwoWay}" LocodeSource="SSN" />
<xctk:DateTimePicker Grid.Column="3" Grid.Row="2" Value="{Binding ETDFromLastPort, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETDFromLastPort" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" Minimum="1899.12.31 00:00" Maximum="2100.12.31 00:00" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/> <xctk:DateTimePicker Grid.Column="3" Grid.Row="2" Value="{Binding ETDFromLastPort, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETDFromLastPort" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" Minimum="1899.12.31 00:00" Maximum="2100.12.31 00:00" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/>
<enictrl:LocodeControl Grid.Column="1" Grid.Row="3" Width="Auto" x:Name="locodeControl_NextPort" LocodeValue="{Binding NextPort, Mode=TwoWay}" LocodeSource="SSN" /> <enictrl:LocodeControl Grid.Column="1" Grid.Row="3" Width="Auto" x:Name="locodeControl_NextPort" LocodeValue="{Binding NextPort, Mode=TwoWay}" LocodeSource="SSN" />
<xctk:DateTimePicker Grid.Column="3" Grid.Row="3" Value="{Binding ETAToNextPort, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETAToNextPort" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" Minimum="1899.12.31 00:00" Maximum="2100.12.31 00:00" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/> <xctk:DateTimePicker Grid.Column="3" Grid.Row="3" Value="{Binding ETAToNextPort, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETAToNextPort" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" Minimum="1899.12.31 00:00" Maximum="2100.12.31 00:00" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/>

View File

@ -36,8 +36,8 @@
<MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion> <MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish> <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage> <WebPage>publish.html</WebPage>
<ApplicationRevision>12</ApplicationRevision> <ApplicationRevision>4</ApplicationRevision>
<ApplicationVersion>7.5.0.%2a</ApplicationVersion> <ApplicationVersion>7.6.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut> <CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted> <PublishWizardCompleted>true</PublishWizardCompleted>
@ -84,7 +84,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup /> <PropertyGroup />
<PropertyGroup> <PropertyGroup>
<ManifestCertificateThumbprint>F2C2D0164244EC89955EF50201EE24C2A300FF0B</ManifestCertificateThumbprint> <ManifestCertificateThumbprint>62DE8527C377957850DB503DA52FF66F664BD459</ManifestCertificateThumbprint>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<SignManifests>true</SignManifests> <SignManifests>true</SignManifests>

View File

@ -31,13 +31,13 @@ namespace ENI2.EditControls
this.textBoxLastName.Text = this.CREW.CrewMemberLastName; this.textBoxLastName.Text = this.CREW.CrewMemberLastName;
this.textBoxFirstName.Text = this.CREW.CrewMemberFirstName; this.textBoxFirstName.Text = this.CREW.CrewMemberFirstName;
this.comboBoxGender.ItemsSource = GlobalStructures.GenderDict; this.comboBoxGender.ItemsSource = GlobalStructures.GenderDict;
this.comboBoxGender.SelectedValue = (this.CREW.CrewMemberGender == null) ? null : this.CREW.CrewMemberGender.ToString(); this.comboBoxGender.SelectedValue = this.CREW.CrewMemberGender?.ToString();
this.textBoxPlaceOfBirth.Text = this.CREW.CrewMemberPlaceOfBirth; this.textBoxPlaceOfBirth.Text = this.CREW.CrewMemberPlaceOfBirth;
this.comboBoxNationality.ItemsSource = bsmd.database.CREW.NationalityDict; this.comboBoxNationality.ItemsSource = bsmd.database.CREW.NationalityDict;
this.comboBoxNationality.SelectedValue = this.CREW.CrewMemberNationality; this.comboBoxNationality.SelectedValue = this.CREW.CrewMemberNationality;
this.datePickerDateOfBirth.SelectedDate = this.CREW.CrewMemberDateOfBirth; this.datePickerDateOfBirth.SelectedDate = this.CREW.CrewMemberDateOfBirth;
this.comboBoxIdDocType.ItemsSource = GlobalStructures.IDDocTypeDict; this.comboBoxIdDocType.ItemsSource = GlobalStructures.IDDocTypeDict;
this.comboBoxIdDocType.SelectedValue = (this.CREW.CrewMemberIdentityDocumentType == null) ? null : this.CREW.CrewMemberIdentityDocumentType.ToString(); this.comboBoxIdDocType.SelectedValue = this.CREW.CrewMemberIdentityDocumentType?.ToString();
this.textBoxIdDocNumber.Text = this.CREW.CrewMemberIdentityDocumentId; this.textBoxIdDocNumber.Text = this.CREW.CrewMemberIdentityDocumentId;
this.textBoxVisaNumber.Text = this.CREW.CrewMemberVisaNumber; this.textBoxVisaNumber.Text = this.CREW.CrewMemberVisaNumber;
this.comboBoxIssuingState.ItemsSource = bsmd.database.CREW.NationalityDict; this.comboBoxIssuingState.ItemsSource = bsmd.database.CREW.NationalityDict;

View File

@ -30,13 +30,13 @@ namespace ENI2.EditControls
this.textBoxLastName.Text = this.PAS.PassengerLastName; this.textBoxLastName.Text = this.PAS.PassengerLastName;
this.textBoxFirstName.Text = this.PAS.PassengerFirstName; this.textBoxFirstName.Text = this.PAS.PassengerFirstName;
this.comboBoxGender.ItemsSource = GlobalStructures.GenderDict; this.comboBoxGender.ItemsSource = GlobalStructures.GenderDict;
this.comboBoxGender.SelectedValue = this.PAS.PassengerGender ?? -1; this.comboBoxGender.SelectedValue = this.PAS.PassengerGender?.ToString();
this.textBoxPlaceOfBirth.Text = this.PAS.PassengerPlaceOfBirth; this.textBoxPlaceOfBirth.Text = this.PAS.PassengerPlaceOfBirth;
this.comboBoxNationality.ItemsSource = bsmd.database.CREW.NationalityDict; this.comboBoxNationality.ItemsSource = bsmd.database.CREW.NationalityDict;
this.comboBoxNationality.SelectedValue = this.PAS.PassengerNationality; this.comboBoxNationality.SelectedValue = this.PAS.PassengerNationality;
this.datePickerDateOfBirth.SelectedDate = this.PAS.PassengerDateOfBirth; this.datePickerDateOfBirth.SelectedDate = this.PAS.PassengerDateOfBirth;
this.comboBoxIdDocType.ItemsSource = GlobalStructures.IDDocTypeDict; this.comboBoxIdDocType.ItemsSource = GlobalStructures.IDDocTypeDict;
this.comboBoxIdDocType.SelectedValue = this.PAS.PassengerIdentityDocumentType ?? null; this.comboBoxIdDocType.SelectedValue = this.PAS.PassengerIdentityDocumentType?.ToString();
this.textBoxIdDocNumber.Text = this.PAS.PassengerIdentityDocumentId; this.textBoxIdDocNumber.Text = this.PAS.PassengerIdentityDocumentId;
this.textBoxVisaNumber.Text = this.PAS.PassengerVisaNumber; this.textBoxVisaNumber.Text = this.PAS.PassengerVisaNumber;
this.locodePortOfEmbarkation.LocodeValue = this.PAS.PassengerPortOfEmbarkation; this.locodePortOfEmbarkation.LocodeValue = this.PAS.PassengerPortOfEmbarkation;

View File

@ -41,7 +41,7 @@
<xctk:DoubleUpDown Grid.Row="2" Grid.Column="1" Name="doubleUpDownAmountDisposed" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/> <xctk:DoubleUpDown Grid.Row="2" Grid.Column="1" Name="doubleUpDownAmountDisposed" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/>
<xctk:DoubleUpDown Grid.Row="3" Grid.Column="1" Name="doubleUpDownMaxCapacity" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/> <xctk:DoubleUpDown Grid.Row="3" Grid.Column="1" Name="doubleUpDownMaxCapacity" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/>
<xctk:DoubleUpDown Grid.Row="4" Grid.Column="1" Name="doubleUpDownAmountRetained" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/> <xctk:DoubleUpDown Grid.Row="4" Grid.Column="1" Name="doubleUpDownAmountRetained" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/>
<enictrl:LocodeControl Grid.Row="5" Grid.Column="1" x:Name="locodePortOfDeliveryRemainingWaste" /> <enictrl:LocodeControl Grid.Row="5" Grid.Column="1" x:Name="locodePortOfDeliveryRemainingWaste" LocodeSource="SSN" />
<xctk:DoubleUpDown Grid.Row="6" Grid.Column="1" Name="doubleUpDownAmountGeneratedTilNextPort" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/> <xctk:DoubleUpDown Grid.Row="6" Grid.Column="1" Name="doubleUpDownAmountGeneratedTilNextPort" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/>
<Label Content="{x:Static p:Resources.textCubicMeters}" Grid.Row = "2" Grid.Column="2" /> <Label Content="{x:Static p:Resources.textCubicMeters}" Grid.Row = "2" Grid.Column="2" />

View File

@ -114,6 +114,22 @@ namespace ENI2.Excel
return val; return val;
} }
internal string ReadSSNLocode(string lookup)
{
string val = this.ReadText(lookup);
if (!val.IsNullOrEmpty())
{
val = val.ToUpper();
string portName = LocodeDB.SSNPortNameFromLocode(val);
if (portName.IsNullOrEmpty())
{
_log.WarnFormat("unknown Locode {0}", val);
val = "";
}
}
return val;
}
internal int? ReadCargoLACode(string lookup) internal int? ReadCargoLACode(string lookup)
{ {
string val = ReadText(lookup); string val = ReadText(lookup);

View File

@ -1077,7 +1077,7 @@ namespace ENI2.Excel
if (lastPort != null) if (lastPort != null)
{ {
if (LocodeDB.PortNameFromLocode(lastPort) != null) if (LocodeDB.SSNPortNameFromLocode(lastPort) != null)
{ {
noa_nod.LastPort = lastPort; noa_nod.LastPort = lastPort;
} }
@ -1152,8 +1152,8 @@ namespace ENI2.Excel
ScanMessage(was, reader); ScanMessage(was, reader);
was.LastWasteDisposalPort = reader.ReadLoCode("WAS.LastWasteDisposalPort"); was.LastWasteDisposalPort = reader.ReadSSNLocode("WAS.LastWasteDisposalPort");
was.NextWasteDisposalPort = reader.ReadLoCode("WAS.NextWasteDisposalPort"); was.NextWasteDisposalPort = reader.ReadSSNLocode("WAS.NextWasteDisposalPort");
was.ConfirmationOfCorrectness = true; // wir haben immer Recht (NSW7.0) was.ConfirmationOfCorrectness = true; // wir haben immer Recht (NSW7.0)
was.ConfirmationOfSufficiency = true; was.ConfirmationOfSufficiency = true;
@ -1243,7 +1243,7 @@ namespace ENI2.Excel
waste.WasteCapacity_MTQ = reader.ReadNumberDefaultZero(wasteCapacity); waste.WasteCapacity_MTQ = reader.ReadNumberDefaultZero(wasteCapacity);
waste.WasteAmountRetained_MTQ = reader.ReadNumberDefaultZero(wasteRetained); waste.WasteAmountRetained_MTQ = reader.ReadNumberDefaultZero(wasteRetained);
waste.WasteDisposalPort = reader.ReadLoCode(wastePort); // aka RemainingWasteDisposalPort waste.WasteDisposalPort = reader.ReadSSNLocode(wastePort); // aka RemainingWasteDisposalPort
if (waste.WasteDisposalPort.IsNullOrEmpty()) if (waste.WasteDisposalPort.IsNullOrEmpty())
{ {
@ -2112,6 +2112,9 @@ namespace ENI2.Excel
crew.CrewMemberIdentityDocumentExpiryDate = new DateTime(2100, 12, 31); crew.CrewMemberIdentityDocumentExpiryDate = new DateTime(2100, 12, 31);
crew.Effects = reader.ReadCellAsText("2. PORT", string.Format("C{0}", i + 142)); crew.Effects = reader.ReadCellAsText("2. PORT", string.Format("C{0}", i + 142));
if (crew.Effects.Length > 256)
crew.Effects = crew.Effects.Substring(0, 256);
Util.UIHelper.SetBusyState(); // dialog might reset busy state Util.UIHelper.SetBusyState(); // dialog might reset busy state
} }
@ -2543,13 +2546,13 @@ namespace ENI2.Excel
{ {
result = "XX"; result = "XX";
} }
else if(CREW.NationalityDict.ContainsKey(nationality.ToUpper())) else if(CREW.NationalityDict.ContainsKey(nationality.ToUpper())) // is it already a key
{ {
result = nationality.ToUpper(); result = nationality.ToUpper();
} }
else if(CREW.NationalityDict.ContainsKey(nationality.ToUpper())) else if(CREW.NationalityDict.ContainsValue(nationality.ToUpper()))
{ {
result = CREW.NationalityDict[nationality.ToUpper()]; result = CREW.NationalityDict.FirstOrDefault(x => x.Value.Substring(3).Equals(nationality, StringComparison.OrdinalIgnoreCase)).Key;
} }
else if(_countryImportDict.ContainsKey(nationality)) else if(_countryImportDict.ContainsKey(nationality))
{ {

View File

@ -134,18 +134,18 @@ namespace ENI2.Util
{ {
result = true; result = true;
} }
else if (o is string) else if (o is string str)
{ {
if (((string)o).Contains(cmb.Text, StringComparison.OrdinalIgnoreCase)) result = true; if (str.Contains(cmb.Text, StringComparison.OrdinalIgnoreCase)) result = true;
} }
else if (o is System.Collections.Generic.KeyValuePair<string, string>) else if (o is System.Collections.Generic.KeyValuePair<string, string> kvsPair)
{ {
if (((System.Collections.Generic.KeyValuePair<string, string>)o).Value.StartsWith(cmb.Text, StringComparison.OrdinalIgnoreCase)) if (kvsPair.Value.StartsWith(cmb.Text, StringComparison.OrdinalIgnoreCase))
result = true; result = true;
} }
else if (o is System.Collections.Generic.KeyValuePair<int, string>) else if (o is System.Collections.Generic.KeyValuePair<int, string> kviPair)
{ {
if (((System.Collections.Generic.KeyValuePair<int, string>)o).Value.StartsWith(cmb.Text, StringComparison.OrdinalIgnoreCase)) if (kviPair.Value.StartsWith(cmb.Text, StringComparison.OrdinalIgnoreCase))
result = true; result = true;
} }
return result; return result;

View File

@ -452,9 +452,9 @@ namespace bsmd.database
if (!(this.GeneralCargoIBC ?? false) && this.ContainerNumber.IsNullOrEmpty() && this.VehicleLicenseNumber.IsNullOrEmpty()) if (!(this.GeneralCargoIBC ?? false) && this.ContainerNumber.IsNullOrEmpty() && this.VehicleLicenseNumber.IsNullOrEmpty())
violations.Add(RuleEngine.CreateViolation(ValidationCode.V808, null, null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD": "HAZA")); violations.Add(RuleEngine.CreateViolation(ValidationCode.V808, null, null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD": "HAZA"));
if((this.NetQuantity_KGM > 100000) || if((this.NetQuantity_KGM >= 1000000000) ||
(this.GrossQuantity_KGM > 100000) || (this.GrossQuantity_KGM >= 1000000000) ||
(this.Volume_MTQ > 100)) (this.Volume_MTQ >= 1000000000))
violations.Add(RuleEngine.CreateViolation(ValidationCode.V809, null, null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA")); violations.Add(RuleEngine.CreateViolation(ValidationCode.V809, null, null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));

View File

@ -59,7 +59,7 @@ namespace bsmd.database
public DateTime? ETDFromKielCanal { get; set; } public DateTime? ETDFromKielCanal { get; set; }
[ShowReport] [ShowReport]
[Validation(ValidationCode.NOT_NULL)] [Validation(ValidationCode.LOCODE_SSN)]
[MaxLength(5)] [MaxLength(5)]
[ENI2Validation] [ENI2Validation]
[DataMember] [DataMember]
@ -267,6 +267,11 @@ namespace bsmd.database
{ {
violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "Check ETAToPortOfCall: might be implausible", this.ETAToPortOfCall.Value.ToLocalTime().ToString(), this.Title, null, this.Tablename)); violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "Check ETAToPortOfCall: might be implausible", this.ETAToPortOfCall.Value.ToLocalTime().ToString(), this.Title, null, this.Tablename));
} }
// NSW 7.1 ETDFromLastPort Pflichtfeld, wenn LastPort != ZZUKN
if(!this.LastPort.IsNullOrEmpty() && !this.LastPort.Equals("ZZUKN") && !this.ETDFromLastPort.HasValue)
{
errors.Add(RuleEngine.CreateError(ValidationCode.E125, "ETDFromLastPort must be provided for a given last port", "", this.Title, null, this.Tablename));
}
if((this.ETDFromLastPort < DateTime.Now.AddDays(-14)) || (this.ETDFromLastPort.HasValue && this.ETDFromLastPort.Value.ToLocalTime().IsTimeEmpty())) if((this.ETDFromLastPort < DateTime.Now.AddDays(-14)) || (this.ETDFromLastPort.HasValue && this.ETDFromLastPort.Value.ToLocalTime().IsTimeEmpty()))
{ {
violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "Check ETDFromLastPort: might be implausible", this.ETDFromLastPort.Value.ToLocalTime().ToString(), this.Title, null, this.Tablename)); violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "Check ETDFromLastPort: might be implausible", this.ETDFromLastPort.Value.ToLocalTime().ToString(), this.Title, null, this.Tablename));
@ -307,9 +312,6 @@ namespace bsmd.database
violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "Check ETAToKielCanal: might be implausible", this.ETAToKielCanal.Value.ToLocalTime().ToString(), this.Title, null, this.Tablename)); violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "Check ETAToKielCanal: might be implausible", this.ETAToKielCanal.Value.ToLocalTime().ToString(), this.Title, null, this.Tablename));
} }
if((this.LastPort?.Equals("ZZUKN") == false) && !this.ETDFromLastPort.HasValue)
errors.Add(RuleEngine.CreateError(ValidationCode.NOT_NULL, "ETDFromLastPort missing", null, this.Title, null, this.Tablename));
if((this.LastPort?.Equals("ZZUKN") == true) && this.ETDFromLastPort.HasValue) if((this.LastPort?.Equals("ZZUKN") == true) && this.ETDFromLastPort.HasValue)
errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE_ZZUKN, "ETDFromLastPort cannot be set if ZZUKN", null, this.Title, null, this.Tablename)); errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE_ZZUKN, "ETDFromLastPort cannot be set if ZZUKN", null, this.Title, null, this.Tablename));

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("7.5.0")] [assembly: AssemblyInformationalVersion("7.6.0")]
[assembly: AssemblyCopyright("Copyright © 2014-2022 schick Informatik")] [assembly: AssemblyCopyright("Copyright © 2014-2022 schick Informatik")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]

View File

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

View File

@ -58,6 +58,7 @@ namespace bsmd.database
E123 = 123, E123 = 123,
E124 = 124, E124 = 124,
E125 = 125, E125 = 125,
E222 = 222,
V201 = 201, V201 = 201,
V202, V202,
V203, V203,
@ -82,7 +83,7 @@ namespace bsmd.database
V782 = 782, V782 = 782,
V783 = 783, V783 = 783,
V784 = 784, V784 = 784,
V786 = 786, V786 = 786, // not used any more (7.1)
V801 = 801, V801 = 801,
V802 = 802, V802 = 802,
V803 = 803, V803 = 803,

View File

@ -108,7 +108,7 @@ namespace bsmd.database
[ShowReport] [ShowReport]
[MaxLength(5)] [MaxLength(5)]
[ENI2Validation] [ENI2Validation]
[Validation(ValidationCode.LOCODE)] [Validation(ValidationCode.LOCODE_SSN)]
public string WasteDisposalPort { get; set; } public string WasteDisposalPort { get; set; }
[ShowReport] [ShowReport]