bis 7.0.0.6 : eine ganze Reihe weiterer Korrekturen

This commit is contained in:
Daniel Schick 2022-03-09 08:26:18 +01:00
parent 15b21bb156
commit 0dbc688f8d
15 changed files with 166 additions and 186 deletions

View File

@ -361,11 +361,11 @@ namespace ENI2
if (oldMessage.MessageNotificationClass == Message.NotificationClass.ATD) continue; if (oldMessage.MessageNotificationClass == Message.NotificationClass.ATD) continue;
if (oldMessage.MessageNotificationClass == Message.NotificationClass.NOA_NOD) continue; if (oldMessage.MessageNotificationClass == Message.NotificationClass.NOA_NOD) continue;
bool isAndienKlasse = ((oldMessage.MessageNotificationClass == Message.NotificationClass.AGNT) || bool isAndienKlasse = (oldMessage.MessageNotificationClass == Message.NotificationClass.AGNT) ||
(oldMessage.MessageNotificationClass == Message.NotificationClass.STAT) || (oldMessage.MessageNotificationClass == Message.NotificationClass.STAT) ||
(oldMessage.MessageNotificationClass == Message.NotificationClass.INFO) || (oldMessage.MessageNotificationClass == Message.NotificationClass.INFO) ||
(oldMessage.MessageNotificationClass == Message.NotificationClass.HAZA) || (oldMessage.MessageNotificationClass == Message.NotificationClass.HAZA) ||
(oldMessage.MessageNotificationClass == Message.NotificationClass.HAZD)); (oldMessage.MessageNotificationClass == Message.NotificationClass.HAZD);
if (!cdd.CopyAll && !isAndienKlasse) continue; if (!cdd.CopyAll && !isAndienKlasse) continue;
@ -679,7 +679,7 @@ namespace ENI2
me.MessageGroupName = messageGroup; me.MessageGroupName = messageGroup;
foreach (MessageViolation mv in violations) foreach (MessageViolation mv in violations)
mv.MessageGroupName = messageGroup; mv.MessageGroupName = messageGroup;
} }
vErrors.AddRange(errors); vErrors.AddRange(errors);
vViolations.AddRange(violations); vViolations.AddRange(violations);
@ -1046,7 +1046,7 @@ namespace ENI2
this._errorListDialog.Closed += (o, e) => this._errorListDialog = null; this._errorListDialog.Closed += (o, e) => this._errorListDialog = null;
this._errorListDialog.Loaded += (o, e) => this._errorListDialog.RefreshVisible = true; this._errorListDialog.Loaded += (o, e) => this._errorListDialog.RefreshVisible = true;
this._errorListDialog.ErrorSelected += _errorListDialog_ErrorSelected; this._errorListDialog.ErrorSelected += _errorListDialog_ErrorSelected;
this._errorListDialog.RefreshClicked += _errorListDialog_RefreshClicked; this._errorListDialog.RefreshClicked += _errorListDialog_RefreshClicked;
this._errorListDialog.Show(); this._errorListDialog.Show();
} }
this._errorListDialog.Errors = vErrors; this._errorListDialog.Errors = vErrors;
@ -1060,7 +1060,7 @@ namespace ENI2
this._violationListDialog.Closed += (o, e) => this._violationListDialog = null; this._violationListDialog.Closed += (o, e) => this._violationListDialog = null;
this._violationListDialog.Loaded += (o, e) => this._violationListDialog.RefreshVisible = true; this._violationListDialog.Loaded += (o, e) => this._violationListDialog.RefreshVisible = true;
this._violationListDialog.ViolationSelected += _errorListDialog_ErrorSelected; this._violationListDialog.ViolationSelected += _errorListDialog_ErrorSelected;
this._violationListDialog.RefreshClicked += _errorListDialog_RefreshClicked; this._violationListDialog.RefreshClicked += _errorListDialog_RefreshClicked;
this._violationListDialog.Show(); this._violationListDialog.Show();
} }
_violationListDialog.Violations = vViolations; _violationListDialog.Violations = vViolations;
@ -1157,7 +1157,7 @@ namespace ENI2
return Properties.Resources.textDepartureNotification; return Properties.Resources.textDepartureNotification;
case Message.NotificationClass.MDH: case Message.NotificationClass.MDH:
return Properties.Resources.textMDH; return Properties.Resources.textMDH;
case Message.NotificationClass.NOA_NOD: case Message.NotificationClass.NOA_NOD:
case Message.NotificationClass.AGNT: case Message.NotificationClass.AGNT:
return Properties.Resources.textPortCall; return Properties.Resources.textPortCall;
case Message.NotificationClass.NAME: case Message.NotificationClass.NAME:
@ -1175,6 +1175,7 @@ namespace ENI2
case Message.NotificationClass.TOWD: case Message.NotificationClass.TOWD:
return Properties.Resources.textTowage; return Properties.Resources.textTowage;
case Message.NotificationClass.WAS: case Message.NotificationClass.WAS:
case Message.NotificationClass.WAS_RCPT:
return Properties.Resources.textWaste; return Properties.Resources.textWaste;
} }
return null; return null;

View File

@ -60,9 +60,9 @@
<Button Name="buttonImportExcelCrew" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Width="120" HorizontalAlignment="Left" VerticalAlignment="Center" Background="Transparent" Click="buttonImportExcelCrew_Click" /> <Button Name="buttonImportExcelCrew" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Width="120" HorizontalAlignment="Left" VerticalAlignment="Center" Background="Transparent" Click="buttonImportExcelCrew_Click" />
<TextBlock Margin="20, 0, 0, 0" Name="textBlockNumCrewEntries" FontWeight="Bold" Text="{Binding Elements.Count}" VerticalAlignment="Center"/> <TextBlock Margin="20, 0, 0, 0" Name="textBlockNumCrewEntries" FontWeight="Bold" Text="{Binding Elements.Count}" VerticalAlignment="Center"/>
<Label Name="labelCrewEntryCount" Content="{x:Static p:Resources.textEntries}" /> <Label Name="labelCrewEntryCount" Content="{x:Static p:Resources.textEntries}" />
<CheckBox Name="checkBoxCrewNotificationSchengen" IsThreeState="True" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationSchengen_Click"/> <CheckBox Name="checkBoxCrewNotificationSchengen" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationSchengen_Click"/>
<Label Name="labelCrewNotificationSchengen" Content="{x:Static p:Resources.textNotificationSchengen}" /> <Label Name="labelCrewNotificationSchengen" Content="{x:Static p:Resources.textNotificationSchengen}" />
<CheckBox Name="checkBoxCrewNotificationPAX" IsThreeState="True" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationPAX_Click"/> <CheckBox Name="checkBoxCrewNotificationPAX" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationPAX_Click"/>
<Label Name="labelCrewNotificationPAX" Content="{x:Static p:Resources.textNotificationPAX}" /> <Label Name="labelCrewNotificationPAX" Content="{x:Static p:Resources.textNotificationPAX}" />
<TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="CREWA" VerticalAlignment="Center" /> <TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="CREWA" VerticalAlignment="Center" />
</StackPanel> </StackPanel>
@ -100,9 +100,9 @@
<Button Name="buttonImportExcelCrewDeparture" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Width="120" HorizontalAlignment="Left" VerticalAlignment="Center" Background="Transparent" Click="buttonImportExcelCrewDeparture_Click" /> <Button Name="buttonImportExcelCrewDeparture" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Width="120" HorizontalAlignment="Left" VerticalAlignment="Center" Background="Transparent" Click="buttonImportExcelCrewDeparture_Click" />
<TextBlock Margin="20, 0, 0, 0" Name="textBlockNumCrewEntriesDeparture" FontWeight="Bold" Text="{Binding Elements.Count}" VerticalAlignment="Center"/> <TextBlock Margin="20, 0, 0, 0" Name="textBlockNumCrewEntriesDeparture" FontWeight="Bold" Text="{Binding Elements.Count}" VerticalAlignment="Center"/>
<Label Name="labelCrewEntryCountDeparture" Content="{x:Static p:Resources.textEntries}" /> <Label Name="labelCrewEntryCountDeparture" Content="{x:Static p:Resources.textEntries}" />
<CheckBox Name="checkBoxCrewNotificationSchengenDeparture" IsThreeState="True" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationSchengenDeparture_Click"/> <CheckBox Name="checkBoxCrewNotificationSchengenDeparture" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationSchengenDeparture_Click"/>
<Label Name="labelCrewNotificationSchengenDeparture" Content="{x:Static p:Resources.textNotificationSchengen}" /> <Label Name="labelCrewNotificationSchengenDeparture" Content="{x:Static p:Resources.textNotificationSchengen}" />
<CheckBox Name="checkBoxCrewNotificationPAXDeparture" IsThreeState="True" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationPAXDeparture_Click"/> <CheckBox Name="checkBoxCrewNotificationPAXDeparture" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationPAXDeparture_Click"/>
<Label Name="labelCrewNotificationPAXDeparture" Content="{x:Static p:Resources.textNotificationPAX}" /> <Label Name="labelCrewNotificationPAXDeparture" Content="{x:Static p:Resources.textNotificationPAX}" />
<TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="CREWD" VerticalAlignment="Center" /> <TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="CREWD" VerticalAlignment="Center" />
</StackPanel> </StackPanel>
@ -139,9 +139,9 @@
<Button Name="buttonImportExcelPassenger" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Width="120" HorizontalAlignment="Left" VerticalAlignment="Center" Background="Transparent" Click="buttonImportExcelPassenger_Click" /> <Button Name="buttonImportExcelPassenger" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Width="120" HorizontalAlignment="Left" VerticalAlignment="Center" Background="Transparent" Click="buttonImportExcelPassenger_Click" />
<TextBlock Margin="20, 0, 0, 0" Name="textBlockNumPasEntries" FontWeight="Bold" Text="{Binding Elements.Count}" VerticalAlignment="Center"/> <TextBlock Margin="20, 0, 0, 0" Name="textBlockNumPasEntries" FontWeight="Bold" Text="{Binding Elements.Count}" VerticalAlignment="Center"/>
<Label Name="labelPasEntryCount" Content="{x:Static p:Resources.textEntries}" /> <Label Name="labelPasEntryCount" Content="{x:Static p:Resources.textEntries}" />
<CheckBox Name="checkBoxPasNotificationSchengen" IsThreeState="True" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationSchengen_Click"/> <CheckBox Name="checkBoxPasNotificationSchengen" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationSchengen_Click"/>
<Label Name="labelPasNotificationSchengen" Content="{x:Static p:Resources.textNotificationSchengen}" /> <Label Name="labelPasNotificationSchengen" Content="{x:Static p:Resources.textNotificationSchengen}" />
<CheckBox Name="checkBoxPasNotificationPAX" IsThreeState="True" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationPAX_Click"/> <CheckBox Name="checkBoxPasNotificationPAX" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationPAX_Click"/>
<Label Name="labelPasNotificationPAX" Content="{x:Static p:Resources.textNotificationPAX}" /> <Label Name="labelPasNotificationPAX" Content="{x:Static p:Resources.textNotificationPAX}" />
<TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="PASA" VerticalAlignment="Center" /> <TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="PASA" VerticalAlignment="Center" />
</StackPanel> </StackPanel>
@ -183,9 +183,9 @@
<Button Name="buttonImportExcelPassengerDeparture" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Width="120" HorizontalAlignment="Left" VerticalAlignment="Center" Background="Transparent" Click="buttonImportExcelPassengerDeparture_Click" /> <Button Name="buttonImportExcelPassengerDeparture" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Width="120" HorizontalAlignment="Left" VerticalAlignment="Center" Background="Transparent" Click="buttonImportExcelPassengerDeparture_Click" />
<TextBlock Margin="20, 0, 0, 0" Name="textBlockNumPasEntriesDeparture" FontWeight="Bold" Text="{Binding Elements.Count}" VerticalAlignment="Center"/> <TextBlock Margin="20, 0, 0, 0" Name="textBlockNumPasEntriesDeparture" FontWeight="Bold" Text="{Binding Elements.Count}" VerticalAlignment="Center"/>
<Label Name="labelPasEntryCountDeparture" Content="{x:Static p:Resources.textEntries}" /> <Label Name="labelPasEntryCountDeparture" Content="{x:Static p:Resources.textEntries}" />
<CheckBox Name="checkBoxPasNotificationSchengenDeparture" IsThreeState="True" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationSchengenDeparture_Click"/> <CheckBox Name="checkBoxPasNotificationSchengenDeparture" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationSchengenDeparture_Click"/>
<Label Name="labelPasNotificationSchengenDeparture" Content="{x:Static p:Resources.textNotificationSchengen}" /> <Label Name="labelPasNotificationSchengenDeparture" Content="{x:Static p:Resources.textNotificationSchengen}" />
<CheckBox Name="checkBoxPasNotificationPAXDeparture" IsThreeState="True" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationPAXDeparture_Click"/> <CheckBox Name="checkBoxPasNotificationPAXDeparture" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationPAXDeparture_Click"/>
<Label Name="labelPasNotificationPAXDeparture" Content="{x:Static p:Resources.textNotificationPAX}" /> <Label Name="labelPasNotificationPAXDeparture" Content="{x:Static p:Resources.textNotificationPAX}" />
<TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="PASD" VerticalAlignment="Center" /> <TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="PASD" VerticalAlignment="Center" />
</StackPanel> </StackPanel>

View File

@ -38,21 +38,21 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textAccurateDetailsGiven}" Name="label_AccurateDetailsGiven" Margin="0,0,10,0"/> <Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textAccurateDetailsGiven}" Name="label_AccurateDetailsGiven" Margin="0,0,10,0"/>
<!--TextBlock Grid.Row="0" Grid.Column="0" Text="{x:Static p:Resources.textAccurateDetailsGiven}" Name="label_ETAToPortOfCall" Margin="0,0,10,0" TextWrapping="Wrap" FontSize="10"/--> <!--TextBlock Grid.Row="0" Grid.Column="0" Text="{x:Static p:Resources.textAccurateDetailsGiven}" Name="label_ETAToPortOfCall" Margin="0,0,10,0" TextWrapping="Wrap" FontSize="10"/-->
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textAmountOfPlannedWasteDisposal}" Name="label_AmountOfPlannedDisposal" Margin="0,0,10,0"/> <Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textNextWasteDisposalPort}" Name="label_NextWasteDisposalPort" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textWasteDateLastDisposal}" Name="label_DateOfLastDisposal" Margin="0,0,10,0"/> <Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textWasteDateLastDisposal}" Name="label_DateOfLastDisposal" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textLastPortWasteDischarge}" Name="label_WasteLastPortDischarged" Margin="0,0,10,0"/> <Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textLastPortWasteDischarge}" Name="label_WasteLastPortDischarged" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textWasteDisposalServiceProviders}" Name="label_WasteDisposalServiceProviders" Margin="0,0,10,0"/> <Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textWasteDisposalServiceProviders}" Name="label_WasteDisposalServiceProviders" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="2" Content="{x:Static p:Resources.textValidExemption}" Name="label_ValidExemption" Margin="0,0,10,0"/> <Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="2" Content="{x:Static p:Resources.textValidExemption}" Name="label_ValidExemption" Margin="0,0,10,0"/>
<CheckBox Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" Name="checkBoxAccurateCorrectDetails" IsChecked="{Binding ConfirmationOfCorrectness, Mode=TwoWay}" /> <CheckBox Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" Name="checkBoxAccurateCorrectDetails" IsChecked="{Binding ConfirmationOfCorrectness, Mode=TwoWay}" />
<CheckBox Grid.Row="0" Grid.Column="3" VerticalAlignment="Center" Name="checkBoxValidExemption" IsChecked="{Binding WasteDisposalValidExemption, Mode=TwoWay}" /> <CheckBox Grid.Row="0" Grid.Column="3" VerticalAlignment="Center" Name="checkBoxValidExemption" IsChecked="{Binding WasteDisposalValidExemption, Mode=TwoWay}" />
<ComboBox Grid.Row="1" Grid.Column="1" Name="comboBoxWasteDisposal" Margin="2" SelectedIndex="{Binding WasteDisposalDelivery, Mode=TwoWay}"/> <enictrl:LocodeControl Grid.Row="3" Grid.Column="1" x:Name="locodeCtrlNextWastePort" LocodeValue="{Binding NextWasteDisposalPort, Mode=TwoWay}" LocodeSource="SSN" />
<DatePicker Grid.Row="2" Grid.Column="1" Name="datePickerDateLastDisposal" Margin="2" SelectedDate="{Binding LastWasteDisposalDate, Mode=TwoWay}" DisplayDateStart="1/1/1800" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate"> <DatePicker Grid.Row="1" Grid.Column="1" Name="datePickerDateLastDisposal" Margin="2" SelectedDate="{Binding LastWasteDisposalDate, Mode=TwoWay}" DisplayDateStart="1/1/1800" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
<DatePicker.BlackoutDates> <DatePicker.BlackoutDates>
<CalendarDateRange Start="1/1/0001" End="12/31/1799"/> <CalendarDateRange Start="1/1/0001" End="12/31/1799"/>
<CalendarDateRange Start="1/1/2199" End="1/1/9999"/> <CalendarDateRange Start="1/1/2199" End="1/1/9999"/>
</DatePicker.BlackoutDates> </DatePicker.BlackoutDates>
</DatePicker> </DatePicker>
<enictrl:LocodeControl Grid.Row="3" Grid.Column="1" x:Name="locodeCtrlLastWastePort" LocodeValue="{Binding LastWasteDisposalPort, Mode=TwoWay}" LocodeSource="SSN" /> <enictrl:LocodeControl Grid.Row="2" Grid.Column="1" x:Name="locodeCtrlLastWastePort" LocodeValue="{Binding LastWasteDisposalPort, Mode=TwoWay}" LocodeSource="SSN" />
<TextBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3" Grid.RowSpan="2" Name="textBoxWasteDisposalServiceProviders" Text="{Binding WasteDisposalServiceProviderText}" Margin="2" /> <TextBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3" Grid.RowSpan="2" Name="textBoxWasteDisposalServiceProviders" Text="{Binding WasteDisposalServiceProviderText}" Margin="2" />
<Button Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="1" Name="buttonAddMissingEntries" Content="{x:Static p:Resources.textAddMissingEntries}" Margin="2" Click="buttonAddMissingEntries_Click"/> <Button Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="1" Name="buttonAddMissingEntries" Content="{x:Static p:Resources.textAddMissingEntries}" Margin="2" Click="buttonAddMissingEntries_Click"/>
<Button Grid.Row="6" Grid.Column="2" Grid.ColumnSpan="1" Name="buttonImportFromExcel" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Click="buttonImportFromExcel_Click" /> <Button Grid.Row="6" Grid.Column="2" Grid.ColumnSpan="1" Name="buttonImportFromExcel" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Click="buttonImportFromExcel_Click" />
@ -123,18 +123,6 @@
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>
<DataGridTemplateColumn IsReadOnly="True" Width="0.12*">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock TextWrapping="Wrap" Text="{x:Static p:Resources.textWasteAmountDischargedLastPort}" FontSize="9"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock TextAlignment="Center" Text="{Binding WasteDisposedAtLastPort_MTQ, StringFormat={}{0:N3}}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns> </DataGrid.Columns>
</enictrl:ENIDataGrid> </enictrl:ENIDataGrid>
</Grid> </Grid>

View File

@ -2,6 +2,7 @@
// Description: Detailansicht Müllmeldung // Description: Detailansicht Müllmeldung
// //
using System.Linq;
using System.Collections.Generic; using System.Collections.Generic;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
@ -43,10 +44,10 @@ namespace ENI2.DetailViewControls
{ {
this.RegisterLocodeChange(this.locodeCtrlLastWastePort, Message.NotificationClass.WAS); this.RegisterLocodeChange(this.locodeCtrlLastWastePort, Message.NotificationClass.WAS);
this.RegisterLocodeChange(this.locodeCtrlNextWastePort, Message.NotificationClass.WAS);
this.RegisterCheckboxChange(this.checkBoxAccurateCorrectDetails, Message.NotificationClass.WAS); this.RegisterCheckboxChange(this.checkBoxAccurateCorrectDetails, Message.NotificationClass.WAS);
this.RegisterCheckboxChange(this.checkBoxValidExemption, Message.NotificationClass.WAS); this.RegisterCheckboxChange(this.checkBoxValidExemption, Message.NotificationClass.WAS);
this.RegisterDatePickerChange(this.datePickerDateLastDisposal, Message.NotificationClass.WAS); this.RegisterDatePickerChange(this.datePickerDateLastDisposal, Message.NotificationClass.WAS);
this.RegisterComboboxIndexChange(this.comboBoxWasteDisposal, Message.NotificationClass.WAS);
this.RegisterTextboxChange(this.textBoxWasteDisposalServiceProviders, Message.NotificationClass.WAS); this.RegisterTextboxChange(this.textBoxWasteDisposalServiceProviders, Message.NotificationClass.WAS);
} }
@ -55,7 +56,7 @@ namespace ENI2.DetailViewControls
{ {
bool on = !(this.checkBoxValidExemption.IsChecked ?? false); bool on = !(this.checkBoxValidExemption.IsChecked ?? false);
this.checkBoxAccurateCorrectDetails.IsEnabled = on; this.checkBoxAccurateCorrectDetails.IsEnabled = on;
this.comboBoxWasteDisposal.IsEnabled = on; this.locodeCtrlNextWastePort.IsEnabled = on;
this.textBoxWasteDisposalServiceProviders.IsEnabled = on; this.textBoxWasteDisposalServiceProviders.IsEnabled = on;
this.dataGridWaste.IsEnabled = on; this.dataGridWaste.IsEnabled = on;
this.locodeCtrlLastWastePort.IsEnabled = on; this.locodeCtrlLastWastePort.IsEnabled = on;
@ -77,8 +78,7 @@ namespace ENI2.DetailViewControls
WasteCapacity_MTQ = 0, WasteCapacity_MTQ = 0,
WasteDescription = "", WasteDescription = "",
WasteDisposalAmount_MTQ = 0, WasteDisposalAmount_MTQ = 0,
WasteDisposalPort = "ZZUKN", WasteDisposalPort = "ZZUKN"
WasteDisposedAtLastPort_MTQ = 0
}; };
this._was.Waste.Add(newWaste); this._was.Waste.Add(newWaste);
} }
@ -124,14 +124,22 @@ namespace ENI2.DetailViewControls
was.MessageCore = this.Core; was.MessageCore = this.Core;
was.MessageHeader = this._wasMessage; was.MessageHeader = this._wasMessage;
_wasMessage.Elements.Add(was); _wasMessage.Elements.Add(was);
}
else
{
// remove "old" Waste Entries from display (not deleted in the DB!)
for(int i = (was.Waste.Count - 1); i >= 0; i--)
{
if (was.Waste[i].WasteType > 999)
was.Waste.RemoveAt(i);
}
} }
this.wasGroupBox.DataContext = was; this.wasGroupBox.DataContext = was;
this._was = was; this._was = was;
this.dataGridWaste.Initialize(); this.dataGridWaste.Initialize();
this.dataGridWaste.ItemsSource = was.Waste; this.dataGridWaste.ItemsSource = was.Waste;
this.comboBoxWasteDisposal.ItemsSource = _wasteDeliveryList;
this.dataGridWaste.AddingNewItem += DataGridWaste_AddingNewItem; this.dataGridWaste.AddingNewItem += DataGridWaste_AddingNewItem;
this.dataGridWaste.EditRequested += DataGridWaste_EditRequested; this.dataGridWaste.EditRequested += DataGridWaste_EditRequested;
this.dataGridWaste.DeleteRequested += DataGridWaste_DeleteRequested; this.dataGridWaste.DeleteRequested += DataGridWaste_DeleteRequested;

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>4</ApplicationRevision> <ApplicationRevision>6</ApplicationRevision>
<ApplicationVersion>7.0.0.4</ApplicationVersion> <ApplicationVersion>7.0.0.6</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut> <CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted> <PublishWizardCompleted>true</PublishWizardCompleted>

View File

@ -28,14 +28,12 @@ namespace ENI2.EditControls
private void EditWasteDialog_Loaded(object sender, RoutedEventArgs e) private void EditWasteDialog_Loaded(object sender, RoutedEventArgs e)
{ {
Dictionary<int, string> codeDict = new Dictionary<int, string>(); Dictionary<int, string> codeDict = new Dictionary<int, string>();
for (int i = 0; i < WAS.RequiredCodes.Length; i++) foreach (string key in WAS.WasteCodeDict.Keys)
{ codeDict.Add(int.Parse(key), string.Format("{0} - {1}", key, WAS.WasteCodeDict[key]));
codeDict[WAS.RequiredCodes[i]] = string.Format("{0} - {1}", WAS.RequiredCodes[i], WAS.RequiredTypes[i]);
}
this.comboBoxWasteCode.ItemsSource = codeDict; this.comboBoxWasteCode.ItemsSource = codeDict;
this.comboBoxWasteCode.SelectedValue = this.Waste.WasteType; this.comboBoxWasteCode.SelectedValue = this.Waste.WasteType;
this.textBoxDescription.Text = this.Waste.WasteDescription; this.textBoxDescription.Text = this.Waste.WasteDescription;
this.doubleUpDownAmountWasteDischargedLastPort.Value = this.Waste.WasteDisposedAtLastPort_MTQ;
this.doubleUpDownAmountDisposed.Value = this.Waste.WasteDisposalAmount_MTQ; this.doubleUpDownAmountDisposed.Value = this.Waste.WasteDisposalAmount_MTQ;
this.doubleUpDownAmountGeneratedTilNextPort.Value = this.Waste.WasteAmountGeneratedTillNextPort_MTQ; this.doubleUpDownAmountGeneratedTilNextPort.Value = this.Waste.WasteAmountGeneratedTillNextPort_MTQ;
this.doubleUpDownAmountRetained.Value = this.Waste.WasteAmountRetained_MTQ; this.doubleUpDownAmountRetained.Value = this.Waste.WasteAmountRetained_MTQ;
@ -52,8 +50,7 @@ namespace ENI2.EditControls
this.Waste.WasteType = (int)this.comboBoxWasteCode.SelectedValue; this.Waste.WasteType = (int)this.comboBoxWasteCode.SelectedValue;
else else
this.Waste.WasteType = null; this.Waste.WasteType = null;
this.Waste.WasteDescription = this.textBoxDescription.Text?.Trim(); this.Waste.WasteDescription = this.textBoxDescription.Text?.Trim();
this.Waste.WasteDisposedAtLastPort_MTQ = this.doubleUpDownAmountWasteDischargedLastPort.Value;
this.Waste.WasteDisposalAmount_MTQ = this.doubleUpDownAmountDisposed.Value; this.Waste.WasteDisposalAmount_MTQ = this.doubleUpDownAmountDisposed.Value;
this.Waste.WasteAmountGeneratedTillNextPort_MTQ = this.doubleUpDownAmountGeneratedTilNextPort.Value; this.Waste.WasteAmountGeneratedTillNextPort_MTQ = this.doubleUpDownAmountGeneratedTilNextPort.Value;
this.Waste.WasteAmountRetained_MTQ = this.doubleUpDownAmountRetained.Value; this.Waste.WasteAmountRetained_MTQ = this.doubleUpDownAmountRetained.Value;

View File

@ -55,21 +55,22 @@ namespace ENI2.EditControls
(aMessage.MessageNotificationClass == Message.NotificationClass.HAZD) || (aMessage.MessageNotificationClass == Message.NotificationClass.HAZD) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.INFO) || (aMessage.MessageNotificationClass == Message.NotificationClass.INFO) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.LADG) || (aMessage.MessageNotificationClass == Message.NotificationClass.LADG) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.NAME) || (aMessage.MessageNotificationClass == Message.NotificationClass.NAME) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.PRE72H) || (aMessage.MessageNotificationClass == Message.NotificationClass.PRE72H) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.SERV) || (aMessage.MessageNotificationClass == Message.NotificationClass.SERV) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.TIEFD) || (aMessage.MessageNotificationClass == Message.NotificationClass.TIEFD) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.TOWD) || (aMessage.MessageNotificationClass == Message.NotificationClass.TOWD) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.WAS) (aMessage.MessageNotificationClass == Message.NotificationClass.WAS) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.WAS_RCPT)
)) continue; )) continue;
SelectClass sc = new SelectClass(); SelectClass sc = new SelectClass();
sc.Name = Enum.GetName(typeof(bsmd.database.Message.NotificationClass), aMessage.MessageNotificationClass); sc.Name = Enum.GetName(typeof(bsmd.database.Message.NotificationClass), aMessage.MessageNotificationClass);
sc.Class = aMessage.MessageNotificationClass; sc.Class = aMessage.MessageNotificationClass;
sc.IsSelected = false; sc.IsSelected = false;
_selectClasses.Add(sc); _selectClasses.Add(sc);
} }
this.checkListBoxClasses.ItemsSource = _selectClasses; this.checkListBoxClasses.ItemsSource = _selectClasses;
this.OKClicked += SelectImportClassesDialog_OKClicked; this.OKClicked += SelectImportClassesDialog_OKClicked;
} }
@ -84,7 +85,7 @@ namespace ENI2.EditControls
class SelectClass : INotifyPropertyChanged class SelectClass : INotifyPropertyChanged
{ {
private bool _isSelected; private bool _isSelected;
public string Name { get; set; } public string Name { get; set; }
public Message.NotificationClass Class { get; set; } public Message.NotificationClass Class { get; set; }
public bool IsSelected public bool IsSelected

View File

@ -120,8 +120,7 @@ namespace ENI2.Excel
internal static void SaveMessage(Message message) internal static void SaveMessage(Message message)
{ {
message.CreatedBy = "EXCEL"; message.CreatedBy = "EXCEL";
if ((message.MessageNotificationClass == Message.NotificationClass.CREWD) || (message.MessageNotificationClass == Message.NotificationClass.CREWD) || if (message.MessageNotificationClass == Message.NotificationClass.STO)
(message.MessageNotificationClass == Message.NotificationClass.STO))
message.InternalStatus = Message.BSMDStatus.PREPARE; message.InternalStatus = Message.BSMDStatus.PREPARE;
else else
message.InternalStatus = Message.BSMDStatus.EXCEL; message.InternalStatus = Message.BSMDStatus.EXCEL;
@ -1133,8 +1132,7 @@ namespace ENI2.Excel
was.DeleteElements(); was.DeleteElements();
ScanMessage(was, reader); ScanMessage(was, reader);
was.WasteDisposalDelivery = reader.ReadDelivery("WAS.WasteDisposalDelivery");
was.LastWasteDisposalPort = reader.ReadLoCode("WAS.LastWasteDisposalPort"); was.LastWasteDisposalPort = reader.ReadLoCode("WAS.LastWasteDisposalPort");
was.NextWasteDisposalPort = reader.ReadLoCode("WAS.NextWasteDisposalPort"); was.NextWasteDisposalPort = reader.ReadLoCode("WAS.NextWasteDisposalPort");
was.ConfirmationOfCorrectness = true; // wir haben immer Recht (NSW7.0) was.ConfirmationOfCorrectness = true; // wir haben immer Recht (NSW7.0)
@ -1151,7 +1149,6 @@ namespace ENI2.Excel
was.WasteDisposalServiceProvider.Add(wdsp); was.WasteDisposalServiceProvider.Add(wdsp);
} }
was.WasteDisposalServiceProvider[0].WasteDisposalServiceProviderName = wastedispServProvName; was.WasteDisposalServiceProvider[0].WasteDisposalServiceProviderName = wastedispServProvName;
was.WasteDisposalServiceProvider[0].WasteDisposalDelivery = was.WasteDisposalDelivery;
} }
// Waste 1 - 25 // Waste 1 - 25
@ -1175,16 +1172,14 @@ namespace ENI2.Excel
} }
waste.WasteType = (int?) reader.ReadNumber(wasteCode); waste.WasteType = (int?) reader.ReadNumber(wasteCode);
if (waste.WasteType.HasValue && (waste.WasteType == 2313))
waste.WasteType = 2600;
// Waste description Spezialfälle für DK // Waste description Spezialfälle für DK
waste.WasteDescription = reader.ReadText(wasteDescription); waste.WasteDescription = reader.ReadText(wasteDescription);
if (waste.WasteDescription.IsNullOrEmpty()) if (waste.WasteDescription.IsNullOrEmpty())
{ {
if (reader.Mode == ExcelReader.CountryMode.DE) if ((reader.Mode == ExcelReader.CountryMode.DE) && waste.IsDashWasteCode)
{ {
waste.WasteDescription = "-"; waste.WasteDescription = "-";
} }
else if (reader.Mode == ExcelReader.CountryMode.DK) else if (reader.Mode == ExcelReader.CountryMode.DK)
@ -1223,15 +1218,7 @@ namespace ENI2.Excel
waste.WasteDisposalPort = "ZZUKN"; waste.WasteDisposalPort = "ZZUKN";
} }
waste.WasteAmountGeneratedTillNextPort_MTQ = reader.ReadNumberDefaultZero(amountGen); waste.WasteAmountGeneratedTillNextPort_MTQ = reader.ReadNumberDefaultZero(amountGen);
if(i==15) // falls letzte Zeile leer, entfernen: Christin 22.3.17
{
if ((waste.WasteDescription.IsNullOrEmpty() || waste.WasteDescription == "-") &&
((waste.WasteDisposalAmount_MTQ ?? 0) == 0) &&
(((waste.WasteType ?? 0) == 1300) || !waste.WasteType.HasValue))
was.Waste.Remove(waste);
}
if (!waste.WasteType.HasValue) if (!waste.WasteType.HasValue)
{ {

View File

@ -47,14 +47,22 @@ namespace ENI2.Excel
{ {
switch(message.MessageNotificationClass) switch(message.MessageNotificationClass)
{ {
case Message.NotificationClass.AGNT: case Message.NotificationClass.AGNT:
if (message.Elements[0] is AGNT agnt) this.WriteMessage(agnt); if (message.Elements[0] is AGNT agnt) this.WriteMessage(agnt);
break; break;
case Message.NotificationClass.ATA: case Message.NotificationClass.ATA:
if (message.Elements[0] is ATA ata) this.WriteMessage(ata); if (message.Elements[0] is ATA ata)
{
WriteDate("ATA.ATADatePortOfCall", ata.ATAPortOfCall);
WriteTime("ATA.ATATimePortOfCall", ata.ATAPortOfCall);
}
break; break;
case Message.NotificationClass.ATD: case Message.NotificationClass.ATD:
if (message.Elements[0] is ATD atd) this.WriteMessage(atd); if (message.Elements[0] is ATD atd)
{
WriteDate("ATD.ATDDatePortOfCall", atd.ATDPortOfCall);
WriteTime("ATD.ATDTimePortOfCall", atd.ATDPortOfCall);
}
break; break;
case Message.NotificationClass.BKRA: case Message.NotificationClass.BKRA:
this.WriteBKRA(message); this.WriteBKRA(message);
@ -497,7 +505,7 @@ namespace ENI2.Excel
{ {
string ibc_productName = string.Format("{1}.IBC.ProductName_{0}", i + 1, className); string ibc_productName = string.Format("{1}.IBC.ProductName_{0}", i + 1, className);
string ibc_pollutionCategory = string.Format("{1}.IBC.PollutionCategory_{0}", i + 1, className); string ibc_pollutionCategory = string.Format("{1}.IBC.PollutionCategory_{0}", i + 1, className);
string ibc_flash = string.Format("{1}.IBC.FlashpointInformation_{0}", i + 1, className); string ibc_flash = string.Format("{1}.IBC.Flashpoint_CEL_{0}", i + 1, className);
string ibc_quantity = string.Format("{1}.IBC.Quantity_KGM_{0}", i + 1, className); string ibc_quantity = string.Format("{1}.IBC.Quantity_KGM_{0}", i + 1, className);
string ibc_stowagePosition = string.Format("{1}.IBC.StowagePosition_{0}", i + 1, className); string ibc_stowagePosition = string.Format("{1}.IBC.StowagePosition_{0}", i + 1, className);
string ibc_portOfLoading = string.Format("{1}.IBC.PortOfLoading_{0}", i + 1, className); string ibc_portOfLoading = string.Format("{1}.IBC.PortOfLoading_{0}", i + 1, className);
@ -568,7 +576,7 @@ namespace ENI2.Excel
string imsbc_portOfDischarge = string.Format("{1}.IMSBC.PortOfDischarge_{0}", i + 1, className); string imsbc_portOfDischarge = string.Format("{1}.IMSBC.PortOfDischarge_{0}", i + 1, className);
string imsbc_imohazard = string.Format("{1}.IMSBC.IMOHazardClass_{0}", i + 1, className); string imsbc_imohazard = string.Format("{1}.IMSBC.IMOHazardClass_{0}", i + 1, className);
string imsbc_unnumber = string.Format("{1}.IMSBC.UNNumber_{0}", i + 1, className); string imsbc_unnumber = string.Format("{1}.IMSBC.UNNumber_{0}", i + 1, className);
string imsbc_imoclass = string.Format("{1}.IMSBC.IMOCLass_{0}", i + 1, className); string imsbc_imoclass = string.Format("{1}.IMSBC.IMOClass_{0}", i + 1, className);
string imsbc_remarks = string.Format("{1}.IMSBC.Remarks_{0}", i + 1, className); string imsbc_remarks = string.Format("{1}.IMSBC.Remarks_{0}", i + 1, className);
IMSBCPosition imsbcPosition = haz.IMSBCPositions[i]; IMSBCPosition imsbcPosition = haz.IMSBCPositions[i];
WriteText(imsbc_bcsn, imsbcPosition.BulkCargoShippingName); WriteText(imsbc_bcsn, imsbcPosition.BulkCargoShippingName);
@ -703,7 +711,7 @@ namespace ENI2.Excel
WriteDate("NOA_NOD.ETDDateFromPortOfCall", noa_nod.ETDFromKielCanal.Value); WriteDate("NOA_NOD.ETDDateFromPortOfCall", noa_nod.ETDFromKielCanal.Value);
WriteTime("NOA_NOD.ETDTimeFromPortOfCall", noa_nod.ETDFromKielCanal.Value); WriteTime("NOA_NOD.ETDTimeFromPortOfCall", noa_nod.ETDFromKielCanal.Value);
} }
} }
else else
{ {
for(int i = 0; i < Math.Min(noa_nod.NumberOfExcelRows, noa_nod.CallPurposes.Count); i++) for(int i = 0; i < Math.Min(noa_nod.NumberOfExcelRows, noa_nod.CallPurposes.Count); i++)
@ -1090,7 +1098,7 @@ namespace ENI2.Excel
string wdesc = string.Format("WAS_RCPT.WasteDeliveryReceipt_{0}.WasteDescription_{1}", i, j); string wdesc = string.Format("WAS_RCPT.WasteDeliveryReceipt_{0}.WasteDescription_{1}", i, j);
string wamount = string.Format("WAS_RCPT.WasteDeliveryReceipt_{0}.AmountWasteReceived_MTQ_{1}", i, j); string wamount = string.Format("WAS_RCPT.WasteDeliveryReceipt_{0}.AmountWasteReceived_MTQ_{1}", i, j);
WasteReceived wReceived = wrcpt.WasteReceived[i - 1]; WasteReceived wReceived = wrcpt.WasteReceived[j - 1];
WriteText(wdesc, wReceived.WasteDescription); WriteText(wdesc, wReceived.WasteDescription);
WriteNumber(wamount, wReceived.AmountWasteReceived_MTQ); WriteNumber(wamount, wReceived.AmountWasteReceived_MTQ);

View File

@ -3298,6 +3298,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Next waste disposal port.
/// </summary>
public static string textNextWasteDisposalPort {
get {
return ResourceManager.GetString("textNextWasteDisposalPort", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Notification class. /// Looks up a localized string similar to Notification class.
/// </summary> /// </summary>

View File

@ -1822,4 +1822,7 @@
<data name="textEmergencyContactNumber" xml:space="preserve"> <data name="textEmergencyContactNumber" xml:space="preserve">
<value>Emergency contact number</value> <value>Emergency contact number</value>
</data> </data>
<data name="textNextWasteDisposalPort" xml:space="preserve">
<value>Next waste disposal port</value>
</data>
</root> </root>

View File

@ -234,6 +234,7 @@ namespace bsmd.database
scmd.Parameters.AddWithNullableValue("@P5", this.LastWasteDisposalDate); scmd.Parameters.AddWithNullableValue("@P5", this.LastWasteDisposalDate);
scmd.Parameters.AddWithNullableValue("@P6", this.WasteDisposalDelivery); scmd.Parameters.AddWithNullableValue("@P6", this.WasteDisposalDelivery);
scmd.Parameters.AddWithNullableValue("@P7", this.ConfirmationOfSufficiency); scmd.Parameters.AddWithNullableValue("@P7", this.ConfirmationOfSufficiency);
scmd.Parameters.AddWithNullableValue("@P8", this.NextWasteDisposalPort);
if (this.IsNew) if (this.IsNew)
{ {
@ -241,21 +242,21 @@ namespace bsmd.database
scmd.Parameters.AddWithValue("@ID", this.Id); scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, WasteDisposalValidExemption, " + scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, WasteDisposalValidExemption, " +
"LastWasteDisposalPort, ConfirmationOfCorrectness, LastWasteDisposalDate, WasteDisposalDelivery, " + "LastWasteDisposalPort, ConfirmationOfCorrectness, LastWasteDisposalDate, WasteDisposalDelivery, " +
"ConfirmationOfSufficiency) VALUES ( @ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7 )", this.Tablename); "ConfirmationOfSufficiency, NextWasteDisposalPort) VALUES ( @ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8 )", this.Tablename);
} }
else else
{ {
scmd.Parameters.AddWithValue("ID", this.Id); scmd.Parameters.AddWithValue("ID", this.Id);
scmd.CommandText = string.Format("UPDATE {0} SET WasteDisposalValidExemption = @P2, LastWasteDisposalPort = @P3, " + scmd.CommandText = string.Format("UPDATE {0} SET WasteDisposalValidExemption = @P2, LastWasteDisposalPort = @P3, " +
"ConfirmationOfCorrectness = @P4, LastWasteDisposalDate = @P5, WasteDisposalDelivery = @P6, ConfirmationOfSufficiency = @P7 " + "ConfirmationOfCorrectness = @P4, LastWasteDisposalDate = @P5, WasteDisposalDelivery = @P6, ConfirmationOfSufficiency = @P7, " +
"WHERE Id = @ID", this.Tablename); "NextWasteDisposalPort = @P8 WHERE Id = @ID", this.Tablename);
} }
} }
public override void PrepareLoadCommand(System.Data.IDbCommand cmd, Message.LoadFilter filter, params object[] criteria) public override void PrepareLoadCommand(System.Data.IDbCommand cmd, Message.LoadFilter filter, params object[] criteria)
{ {
string query = string.Format("SELECT Id, WasteDisposalValidExemption, LastWasteDisposalPort, ConfirmationOfCorrectness, " + string query = string.Format("SELECT Id, WasteDisposalValidExemption, LastWasteDisposalPort, ConfirmationOfCorrectness, " +
"LastWasteDisposalDate, WasteDisposalDelivery, ConfirmationOfSufficiency " + "LastWasteDisposalDate, WasteDisposalDelivery, ConfirmationOfSufficiency, NextWasteDisposalPort " +
"FROM {0} ", this.Tablename); "FROM {0} ", this.Tablename);
switch (filter) switch (filter)
@ -290,6 +291,7 @@ namespace bsmd.database
if (!reader.IsDBNull(4)) was.LastWasteDisposalDate = reader.GetDateTime(4); if (!reader.IsDBNull(4)) was.LastWasteDisposalDate = reader.GetDateTime(4);
if (!reader.IsDBNull(5)) was.WasteDisposalDelivery = reader.GetByte(5); if (!reader.IsDBNull(5)) was.WasteDisposalDelivery = reader.GetByte(5);
if (!reader.IsDBNull(6)) was.ConfirmationOfSufficiency = reader.GetBoolean(6); if (!reader.IsDBNull(6)) was.ConfirmationOfSufficiency = reader.GetBoolean(6);
if (!reader.IsDBNull(7)) was.NextWasteDisposalPort = reader.GetString(7);
result.Add(was); result.Add(was);
} }
reader.Close(); reader.Close();
@ -437,8 +439,9 @@ namespace bsmd.database
int missingType = 0; int missingType = 0;
foreach(int wasteCode in RequiredCodes) foreach(string wasteCodeString in WAS.WasteCodes)
{ {
int wasteCode = int.Parse(wasteCodeString);
bool codeFound = false; bool codeFound = false;
foreach(Waste w in this.Waste) foreach(Waste w in this.Waste)
{ {
@ -455,19 +458,23 @@ namespace bsmd.database
} }
} }
if (entryMissing)
{
errors.Add(RuleEngine.CreateError(ValidationCode.POSITION_COUNT, string.Format("Waste {0}", missingType), null, this.Title, null, this.Tablename));
}
// Extravalidierung für "0" Meldung (5.3.21) // Extravalidierung für "0" Meldung (5.3.21)
double totalSludgeRetained = 0; double totalSludgeRetained = 0;
double totalWDALP = 0;
double totalWC = 0; double totalWC = 0;
double totalWAR = 0; double totalWAR = 0;
double totalWAGTNP = 0; double totalWAGTNP = 0;
double totalWDA = 0; double totalWDA = 0;
foreach(Waste w in this.Waste) foreach(Waste w in this.Waste)
{ {
if (w.WasteType == 1100) totalSludgeRetained += w.WasteAmountRetained_MTQ ?? 0; if (w.WasteType == 1100) totalSludgeRetained += w.WasteAmountRetained_MTQ ?? 0;
if (w.WasteType == 1300) totalSludgeRetained += w.WasteAmountRetained_MTQ ?? 0; if (w.WasteType == 1300) totalSludgeRetained += w.WasteAmountRetained_MTQ ?? 0;
totalWDALP += w.WasteDisposedAtLastPort_MTQ ?? 0;
totalWC += w.WasteCapacity_MTQ ?? 0; totalWC += w.WasteCapacity_MTQ ?? 0;
totalWAR += w.WasteAmountRetained_MTQ ?? 0; totalWAR += w.WasteAmountRetained_MTQ ?? 0;
totalWAGTNP += w.WasteAmountGeneratedTillNextPort_MTQ ?? 0; totalWAGTNP += w.WasteAmountGeneratedTillNextPort_MTQ ?? 0;
@ -476,11 +483,7 @@ namespace bsmd.database
if(totalSludgeRetained == 0) if(totalSludgeRetained == 0)
{ {
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Waste amount retained on board for types 1100 'sludge' and 1300 'oil-others' = 0", null, this.Title, null, this.Tablename)); violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Waste amount retained on board for types 1100 'sludge' and 1300 'oil-others' = 0", null, this.Title, null, this.Tablename));
} }
if(totalWDALP == 0)
{
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Total waste is 0 for WasteDisposedAtLastPort for all waste types", null, this.Title, null, this.Tablename));
}
if(totalWC == 0) if(totalWC == 0)
{ {
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Total waste is 0 for WasteCapacity for all waste types", null, this.Title, null, this.Tablename)); violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Total waste is 0 for WasteCapacity for all waste types", null, this.Title, null, this.Tablename));
@ -488,22 +491,7 @@ namespace bsmd.database
if(totalWAR == 0) if(totalWAR == 0)
{ {
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Total waste is 0 for WasteAmountRetained for all waste types", null, this.Title, null, this.Tablename)); violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Total waste is 0 for WasteAmountRetained for all waste types", null, this.Title, null, this.Tablename));
} }
if(totalWAGTNP == 0)
{
// herausgenommen lt Karte für 6.4.3 (15.7.21)
// violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Total waste is 0 for WasteAmountGeneratedTillNextPort for all waste types", null, this.Title, null, this.Tablename));
}
if((totalWDA == 0) && !(WasteDisposalDelivery.HasValue && (WasteDisposalDelivery.Value == 2)))
{
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Total waste is 0 for WasteDisposalDelivery for all waste types", null, this.Title, null, this.Tablename));
}
if(entryMissing)
{
errors.Add(RuleEngine.CreateError(ValidationCode.POSITION_COUNT, string.Format("Waste {0}", missingType), null, this.Title, null, this.Tablename));
}
if(!(this.ConfirmationOfCorrectness ?? false)) if(!(this.ConfirmationOfCorrectness ?? false))
{ {
errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, "Confirmation of correctness not set!", null, this.Title, null, this.Tablename)); errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, "Confirmation of correctness not set!", null, this.Title, null, this.Tablename));
@ -522,40 +510,7 @@ namespace bsmd.database
if (waste.WasteType.HasValue && waste.WasteType.Value == wasteType) if (waste.WasteType.HasValue && waste.WasteType.Value == wasteType)
return waste; return waste;
return null; return null;
} }
public List<Waste> AddRemainingWasteTypes()
{
List<Waste> result = new List<Waste>();
for (byte wType = 1; wType <= 9; wType++ )
{
bool wasteTypeFound = false;
foreach (Waste w in this.Waste)
{
if ((w.WasteType ?? 0) == wType)
wasteTypeFound = true;
}
if (!wasteTypeFound)
{
Waste newWaste = new Waste
{
WasteType = wType,
WasteAmountGeneratedTillNextPort_MTQ = 0,
WasteAmountRetained_MTQ = 0,
WasteCapacity_MTQ = 0,
WasteDisposalAmount_MTQ = 0,
Identifier = "",
WasteDisposalPort = "ZZUKN",
WasteDescription = "-",
WAS = this
};
this.Waste.Add(newWaste);
result.Add(newWaste);
}
}
return result;
}
/// <summary> /// <summary>
/// Convenience Methode, die fehlende Waste Einträge ergänzt. Verbesserte Version, aus ENI-2 herüberkopiert, damit es auch im /// Convenience Methode, die fehlende Waste Einträge ergänzt. Verbesserte Version, aus ENI-2 herüberkopiert, damit es auch im
@ -564,8 +519,10 @@ namespace bsmd.database
public void AddMissingWaste() public void AddMissingWaste()
{ {
foreach (int wasteCode in WAS.RequiredCodes) foreach (string wasteCodeString in WAS.WasteCodes)
{ {
int wasteCode = int.Parse(wasteCodeString);
Waste foundWaste = null; Waste foundWaste = null;
foreach (Waste waste in this.Waste) foreach (Waste waste in this.Waste)
{ {
@ -583,13 +540,14 @@ namespace bsmd.database
WAS = this, WAS = this,
WasteAmountGeneratedTillNextPort_MTQ = 0, WasteAmountGeneratedTillNextPort_MTQ = 0,
WasteAmountRetained_MTQ = 0, WasteAmountRetained_MTQ = 0,
WasteCapacity_MTQ = 0, WasteCapacity_MTQ = 0,
WasteDescription = (wasteCode == 1300) ? "-" : "",
WasteDisposalAmount_MTQ = 0, WasteDisposalAmount_MTQ = 0,
WasteDisposalPort = "ZZUKN", WasteDisposalPort = "ZZUKN",
WasteDisposedAtLastPort_MTQ = 0,
WasteType = wasteCode WasteType = wasteCode
}; };
newWaste.WasteDescription = (newWaste.IsDashWasteCode) ? "-" : "";
this.Waste.Add(newWaste); this.Waste.Add(newWaste);
} }
else else
@ -597,24 +555,11 @@ namespace bsmd.database
if (!foundWaste.WasteAmountGeneratedTillNextPort_MTQ.HasValue) foundWaste.WasteAmountGeneratedTillNextPort_MTQ = 0; if (!foundWaste.WasteAmountGeneratedTillNextPort_MTQ.HasValue) foundWaste.WasteAmountGeneratedTillNextPort_MTQ = 0;
if (!foundWaste.WasteAmountRetained_MTQ.HasValue) foundWaste.WasteAmountRetained_MTQ = 0; if (!foundWaste.WasteAmountRetained_MTQ.HasValue) foundWaste.WasteAmountRetained_MTQ = 0;
if (!foundWaste.WasteCapacity_MTQ.HasValue) foundWaste.WasteCapacity_MTQ = 0; if (!foundWaste.WasteCapacity_MTQ.HasValue) foundWaste.WasteCapacity_MTQ = 0;
if ((wasteCode == 1300) && foundWaste.WasteDescription.IsNullOrEmpty()) foundWaste.WasteDescription = "-"; if (foundWaste.WasteDescription.IsNullOrEmpty() && foundWaste.IsDashWasteCode) foundWaste.WasteDescription = "-";
if (!foundWaste.WasteDisposalAmount_MTQ.HasValue) foundWaste.WasteDisposalAmount_MTQ = 0; if (!foundWaste.WasteDisposalAmount_MTQ.HasValue) foundWaste.WasteDisposalAmount_MTQ = 0;
if (foundWaste.WasteDisposalPort.IsNullOrEmpty()) foundWaste.WasteDisposalPort = "ZZUKN"; if (foundWaste.WasteDisposalPort.IsNullOrEmpty()) foundWaste.WasteDisposalPort = "ZZUKN";
if (!foundWaste.WasteDisposedAtLastPort_MTQ.HasValue) foundWaste.WasteDisposedAtLastPort_MTQ = 0;
} }
} }
// falls Zeile 15 oder mehr vorhanden war / ist werden dort auch noch default Werte ergänzt
foreach(Waste foundWaste in this.Waste)
{
if (!foundWaste.WasteAmountGeneratedTillNextPort_MTQ.HasValue) foundWaste.WasteAmountGeneratedTillNextPort_MTQ = 0;
if (!foundWaste.WasteAmountRetained_MTQ.HasValue) foundWaste.WasteAmountRetained_MTQ = 0;
if (!foundWaste.WasteCapacity_MTQ.HasValue) foundWaste.WasteCapacity_MTQ = 0;
if ((foundWaste.WasteType == 1300) && foundWaste.WasteDescription.IsNullOrEmpty()) foundWaste.WasteDescription = "-";
if (!foundWaste.WasteDisposalAmount_MTQ.HasValue) foundWaste.WasteDisposalAmount_MTQ = 0;
if (foundWaste.WasteDisposalPort.IsNullOrEmpty()) foundWaste.WasteDisposalPort = "ZZUKN";
if (!foundWaste.WasteDisposedAtLastPort_MTQ.HasValue) foundWaste.WasteDisposedAtLastPort_MTQ = 0;
}
} }
#endregion #endregion

View File

@ -142,6 +142,28 @@ namespace bsmd.database
} }
} }
[JsonIgnore]
public bool IsDashWasteCode
{
get
{
if (!WasteType.HasValue) return false;
switch (WasteType.Value)
{
case 999:
case 201:
case 202:
case 203:
case 204:
case 510:
case 511:
return true;
default:
return false;
}
}
}
#endregion #endregion
#region DatabaseEntity implementation #region DatabaseEntity implementation
@ -233,15 +255,26 @@ namespace bsmd.database
public override void Validate(List<MessageError> errors, List<MessageViolation> violations) public override void Validate(List<MessageError> errors, List<MessageViolation> violations)
{ {
if (this.WasteType.HasValue && (this.WasteType.Value == 1300) && this.WasteDescription.IsNullOrEmpty()) if (this.IsDashWasteCode && this.WasteDescription.IsNullOrEmpty())
violations.Add(RuleEngine.CreateViolation(ValidationCode.V781, "WasteDescription", null, this.Title, this.Identifier, this.Tablename)); violations.Add(RuleEngine.CreateViolation(ValidationCode.V781, "WasteDescription", null, this.Title, this.Identifier, this.Tablename));
if (!this.HasValidWasteCode) if (!this.HasValidWasteCode)
violations.Add(RuleEngine.CreateViolation(ValidationCode.V784, "WasteCode", null, this.Title, this.Identifier, this.Tablename)); violations.Add(RuleEngine.CreateViolation(ValidationCode.V784, "WasteCode", null, this.Title, this.Identifier, this.Tablename));
if (this.WasteDisposalAmount_MTQ > 10000)
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Waste disposal amount", null, this.Title, this.Identifier, this.Tablename));
if (this.WasteCapacity_MTQ > 10000)
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Waste capacity", null, this.Title, this.Identifier, this.Tablename));
if (this.WasteAmountRetained_MTQ > 10000)
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Waste amount retained", null, this.Title, this.Identifier, this.Tablename));
if (this.WasteAmountGeneratedTillNextPort_MTQ > 10000)
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Waste generated till next port", null, this.Title, this.Identifier, this.Tablename));
} }
#endregion #endregion
} }
} }

View File

@ -59,7 +59,7 @@ namespace bsmd.database
[ShowReport] [ShowReport]
[Validation(ValidationCode.NOT_NULL)] [Validation(ValidationCode.NOT_NULL)]
[ENI2Validation] [ENI2Validation]
public double? AmountWasteReceived_MTQ { get; set; } public double? AmountWasteReceived_MTQ { get; set; }
#endregion #endregion
@ -136,8 +136,8 @@ namespace bsmd.database
public override void Validate(List<MessageError> errors, List<MessageViolation> violations) public override void Validate(List<MessageError> errors, List<MessageViolation> violations)
{ {
if (this.AmountWasteReceived_MTQ > 10000)
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Waste disposal amount", null, this.Title, this.Identifier, this.Tablename));
} }
#endregion #endregion

View File

@ -184,7 +184,7 @@ namespace bsmd.hisnord
vesseltype hn_stat = new vesseltype(); vesseltype hn_stat = new vesseltype();
if (stat.Beam_MTR.HasValue) if (stat.Beam_MTR.HasValue)
hn_stat.Beam_MTR = (decimal) stat.Beam_MTR.Value; hn_stat.Beam_MTR = Math.Round((decimal) stat.Beam_MTR.Value, 2);
hn_stat.CallSign = stat.CallSign; hn_stat.CallSign = stat.CallSign;
hn_stat.Flag = stat.Flag; hn_stat.Flag = stat.Flag;
if (stat.GrossTonnage.HasValue) if (stat.GrossTonnage.HasValue)
@ -217,7 +217,7 @@ namespace bsmd.hisnord
hn_stat.ISMCompany.ISMCompanyStreetAndNumber = stat.ISMCompanyStreetAndNumber; hn_stat.ISMCompany.ISMCompanyStreetAndNumber = stat.ISMCompanyStreetAndNumber;
} }
if (stat.LengthOverall_MTR.HasValue) if (stat.LengthOverall_MTR.HasValue)
hn_stat.LengthOverall_MTR = (decimal)stat.LengthOverall_MTR.Value; hn_stat.LengthOverall_MTR = Math.Round((decimal)stat.LengthOverall_MTR.Value, 2);
hn_stat.MMSINumber = stat.MMSINumber; hn_stat.MMSINumber = stat.MMSINumber;
hn_stat.PortOfRegistry = stat.PortOfRegistry; hn_stat.PortOfRegistry = stat.PortOfRegistry;
hn_stat.ShipName = stat.ShipName; hn_stat.ShipName = stat.ShipName;
@ -425,7 +425,7 @@ namespace bsmd.hisnord
if (tiefa.DraughtUponArrival_DMT.HasValue) if (tiefa.DraughtUponArrival_DMT.HasValue)
{ {
items1ChoiceType.Add(Items1ChoiceType.TIEFA); items1ChoiceType.Add(Items1ChoiceType.TIEFA);
items1.Add((decimal)tiefa.DraughtUponArrival_DMT.Value); items1.Add(Math.Round((decimal)tiefa.DraughtUponArrival_DMT.Value, 1));
} }
} }
} }
@ -447,7 +447,7 @@ namespace bsmd.hisnord
if (tiefd.DraughtUponDeparture_DMT.HasValue) if (tiefd.DraughtUponDeparture_DMT.HasValue)
{ {
items1ChoiceType.Add(Items1ChoiceType.TIEFD); items1ChoiceType.Add(Items1ChoiceType.TIEFD);
items1.Add((decimal)tiefd.DraughtUponDeparture_DMT.Value); items1.Add(Math.Round((decimal)tiefd.DraughtUponDeparture_DMT.Value, 1));
} }
} }
} }
@ -486,7 +486,7 @@ namespace bsmd.hisnord
hn_info.DeadWeightSummer_TNESpecified = info.DeplacementSummerDraught_TNE.HasValue; hn_info.DeadWeightSummer_TNESpecified = info.DeplacementSummerDraught_TNE.HasValue;
if (hn_info.DeadWeightSummer_TNESpecified) if (hn_info.DeadWeightSummer_TNESpecified)
hn_info.DeadWeightSummer_TNE = (decimal)info.DeplacementSummerDraught_TNE.Value; hn_info.DeadWeightSummer_TNE = Math.Round((decimal)info.DeplacementSummerDraught_TNE.Value, 3);
items1ChoiceType.Add(Items1ChoiceType.INFO); items1ChoiceType.Add(Items1ChoiceType.INFO);
items1.Add(hn_info); items1.Add(hn_info);
@ -516,7 +516,7 @@ namespace bsmd.hisnord
BRKA brka = message.Elements[i] as BRKA; BRKA brka = message.Elements[i] as BRKA;
hn_bkra.BunkerFuelArrival[i] = new bunkerfuel(); hn_bkra.BunkerFuelArrival[i] = new bunkerfuel();
hn_bkra.BunkerFuelArrival[i].BunkerFuelType = brka.BunkerFuelType; hn_bkra.BunkerFuelArrival[i].BunkerFuelType = brka.BunkerFuelType;
hn_bkra.BunkerFuelArrival[i].BunkerFuelQuantity_TNE = (decimal)brka.BunkerFuelQuantity_TNE; hn_bkra.BunkerFuelArrival[i].BunkerFuelQuantity_TNE = Math.Round((decimal)brka.BunkerFuelQuantity_TNE, 3);
} }
items1ChoiceType.Add(Items1ChoiceType.BKRA); items1ChoiceType.Add(Items1ChoiceType.BKRA);
items1.Add(hn_bkra); items1.Add(hn_bkra);
@ -542,7 +542,7 @@ namespace bsmd.hisnord
BRKD brkd = message.Elements[i] as BRKD; BRKD brkd = message.Elements[i] as BRKD;
hn_bkrd.BunkerFuelDeparture[i] = new bunkerfuel(); hn_bkrd.BunkerFuelDeparture[i] = new bunkerfuel();
hn_bkrd.BunkerFuelDeparture[i].BunkerFuelType = brkd.BunkerFuelType; hn_bkrd.BunkerFuelDeparture[i].BunkerFuelType = brkd.BunkerFuelType;
hn_bkrd.BunkerFuelDeparture[i].BunkerFuelQuantity_TNE = (decimal)brkd.BunkerFuelQuantity_TNE; hn_bkrd.BunkerFuelDeparture[i].BunkerFuelQuantity_TNE = Math.Round((decimal)brkd.BunkerFuelQuantity_TNE, 3);
} }
items1ChoiceType.Add(Items1ChoiceType.BKRD); items1ChoiceType.Add(Items1ChoiceType.BKRD);
items1.Add(hn_bkrd); items1.Add(hn_bkrd);
@ -709,7 +709,7 @@ namespace bsmd.hisnord
if ((ladg.CargoNumberOfItems ?? 0) > 0) if ((ladg.CargoNumberOfItems ?? 0) > 0)
lu.CargoNumberOfItems = ladg.CargoNumberOfItems.Value.ToString(); lu.CargoNumberOfItems = ladg.CargoNumberOfItems.Value.ToString();
if (ladg.CargoGrossQuantity_TNE.HasValue) if (ladg.CargoGrossQuantity_TNE.HasValue)
lu.CargoGrossQuantity_TNE = (decimal)ladg.CargoGrossQuantity_TNE.Value; lu.CargoGrossQuantity_TNE = Math.Round((decimal)ladg.CargoGrossQuantity_TNE.Value, 3);
lu.CargoPortOfLoading = ladg.PortOfLoading; lu.CargoPortOfLoading = ladg.PortOfLoading;
lu.CargoPortOfDischarge = ladg.PortOfDischarge; lu.CargoPortOfDischarge = ladg.PortOfDischarge;
@ -777,7 +777,7 @@ namespace bsmd.hisnord
hn_pre72.DateOfLastExpandedInspection = pre72h.DateOfLastExpandedInspection.Value; hn_pre72.DateOfLastExpandedInspection = pre72h.DateOfLastExpandedInspection.Value;
hn_pre72.PlannedOperations = pre72h.PlannedOperations; hn_pre72.PlannedOperations = pre72h.PlannedOperations;
if (pre72h.PlannedPeriodOfStay_HUR.HasValue) if (pre72h.PlannedPeriodOfStay_HUR.HasValue)
hn_pre72.PlannedPeriodOfStay_HUR = (decimal)pre72h.PlannedPeriodOfStay_HUR.Value; hn_pre72.PlannedPeriodOfStay_HUR = Math.Round((decimal)pre72h.PlannedPeriodOfStay_HUR.Value, 2);
hn_pre72.PlannedWorks = pre72h.PlannedWorks; hn_pre72.PlannedWorks = pre72h.PlannedWorks;
hn_pre72.Tanker = (pre72h.Tanker ?? false) ? yorntype.Y : yorntype.N; hn_pre72.Tanker = (pre72h.Tanker ?? false) ? yorntype.Y : yorntype.N;
@ -792,7 +792,7 @@ namespace bsmd.hisnord
if (pre72h.TankerHullConfiguration.HasValue) if (pre72h.TankerHullConfiguration.HasValue)
hn_pre72.TankerDetails.TankerHullConfiguration = (hullconfigtype)pre72h.TankerHullConfiguration.Value; hn_pre72.TankerDetails.TankerHullConfiguration = (hullconfigtype)pre72h.TankerHullConfiguration.Value;
if (pre72h.VolumeOfCargo.HasValue && (pre72h.VolumeOfCargo > 0)) if (pre72h.VolumeOfCargo.HasValue && (pre72h.VolumeOfCargo > 0))
hn_pre72.TankerDetails.VolumeOfCargo_TNE = (decimal)pre72h.VolumeOfCargo.Value; hn_pre72.TankerDetails.VolumeOfCargo_TNE = Math.Round((decimal)pre72h.VolumeOfCargo.Value, 3);
hn_pre72.TankerDetails.VolumeOfCargo_TNESpecified = pre72h.VolumeOfCargo.HasValue; hn_pre72.TankerDetails.VolumeOfCargo_TNESpecified = pre72h.VolumeOfCargo.HasValue;
} }
else else
@ -1220,7 +1220,7 @@ namespace bsmd.hisnord
Waste waste = was.Waste[i]; Waste waste = was.Waste[i];
if (waste.WasteDisposalAmount_MTQ.HasValue) if (waste.WasteDisposalAmount_MTQ.HasValue)
hn_waste.WasteDisposalAmount_MTQ = (decimal)waste.WasteDisposalAmount_MTQ.Value; hn_waste.WasteDisposalAmount_MTQ = Math.Round((decimal)waste.WasteDisposalAmount_MTQ.Value, 3);
hn_waste.WasteType = new wastetyp(); hn_waste.WasteType = new wastetyp();
if (waste.WasteType.HasValue) if (waste.WasteType.HasValue)
@ -1233,15 +1233,15 @@ namespace bsmd.hisnord
hn_waste.WasteDetails = new wastedetails(); hn_waste.WasteDetails = new wastedetails();
hn_waste.WasteDetails.WasteAmountGeneratedTillNextPort_MTQSpecified = true; // waste.WasteAmountGeneratedTillNextPort_MTQ.HasValue; hn_waste.WasteDetails.WasteAmountGeneratedTillNextPort_MTQSpecified = true; // waste.WasteAmountGeneratedTillNextPort_MTQ.HasValue;
// if (hn_waste.WasteDetails.WasteAmountGeneratedTillNextPort_MTQSpecified) // if (hn_waste.WasteDetails.WasteAmountGeneratedTillNextPort_MTQSpecified)
hn_waste.WasteDetails.WasteAmountGeneratedTillNextPort_MTQ = (decimal) (waste.WasteAmountGeneratedTillNextPort_MTQ ?? 0); hn_waste.WasteDetails.WasteAmountGeneratedTillNextPort_MTQ = Math.Round((decimal) (waste.WasteAmountGeneratedTillNextPort_MTQ ?? 0), 3);
hn_waste.WasteDetails.WasteAmountRetained_MTQSpecified = true; // waste.WasteAmountRetained_MTQ.HasValue; hn_waste.WasteDetails.WasteAmountRetained_MTQSpecified = true; // waste.WasteAmountRetained_MTQ.HasValue;
// if (hn_waste.WasteDetails.WasteAmountRetained_MTQSpecified) // if (hn_waste.WasteDetails.WasteAmountRetained_MTQSpecified)
hn_waste.WasteDetails.WasteAmountRetained_MTQ = (decimal) (waste.WasteAmountRetained_MTQ ?? 0); hn_waste.WasteDetails.WasteAmountRetained_MTQ = Math.Round((decimal) (waste.WasteAmountRetained_MTQ ?? 0), 3);
hn_waste.WasteDetails.WasteCapacity_MTQSpecified = true; // waste.WasteCapacity_MTQ.HasValue; hn_waste.WasteDetails.WasteCapacity_MTQSpecified = true; // waste.WasteCapacity_MTQ.HasValue;
// if (hn_waste.WasteDetails.WasteCapacity_MTQSpecified) // if (hn_waste.WasteDetails.WasteCapacity_MTQSpecified)
hn_waste.WasteDetails.WasteCapacity_MTQ = (decimal) (waste.WasteCapacity_MTQ ?? 0); hn_waste.WasteDetails.WasteCapacity_MTQ = Math.Round((decimal) (waste.WasteCapacity_MTQ ?? 0), 3);
hn_waste.WasteDetails.WasteDisposalPort = waste.WasteDisposalPort.IsNullOrEmpty() ? "ZZUKN" : waste.WasteDisposalPort; hn_waste.WasteDetails.WasteDisposalPort = waste.WasteDisposalPort.IsNullOrEmpty() ? "ZZUKN" : waste.WasteDisposalPort;