merged release v7.5
This commit is contained in:
commit
de795c12f1
@ -53,7 +53,19 @@ namespace ENI2.Controls
|
|||||||
public bool AddVisible
|
public bool AddVisible
|
||||||
{
|
{
|
||||||
get { var addButton = (Button)Template.FindName("buttonAdd", this); return addButton.Visibility == Visibility.Visible; }
|
get { var addButton = (Button)Template.FindName("buttonAdd", this); return addButton.Visibility == Visibility.Visible; }
|
||||||
set { var addButton = (Button)Template.FindName("buttonAdd", this); addButton.Visibility = value ? Visibility.Visible : Visibility.Hidden; }
|
set
|
||||||
|
{
|
||||||
|
var addButton = (Button)Template.FindName("buttonAdd", this); addButton.Visibility = value ? Visibility.Visible : Visibility.Hidden;
|
||||||
|
var okButton = (Button)Template.FindName("buttonOK", this);
|
||||||
|
if (okButton.Visibility == Visibility.Hidden)
|
||||||
|
okButton.Width = 1; // we are in a DockPanel, try to collapse okButton to place addButton more to the right
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool OkVisible
|
||||||
|
{
|
||||||
|
get { var okButton = (Button)Template.FindName("buttonOK", this); return okButton.Visibility == Visibility.Visible; }
|
||||||
|
set { var okButton = (Button)Template.FindName("buttonOK", this); okButton.Visibility = value ? Visibility.Visible : Visibility.Hidden; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_Closing(object sender, CancelEventArgs e)
|
private void Window_Closing(object sender, CancelEventArgs e)
|
||||||
|
|||||||
@ -19,14 +19,25 @@ namespace ENI2.Controls
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class LocodeControl : UserControl, INotifyPropertyChanged
|
public partial class LocodeControl : UserControl, INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#region fields
|
||||||
|
|
||||||
private List<string> _locodeList = new List<string>();
|
private List<string> _locodeList = new List<string>();
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
private bool _comboSelect;
|
private bool _comboSelect;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Construction
|
||||||
|
|
||||||
public LocodeControl()
|
public LocodeControl()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Enums
|
||||||
|
|
||||||
protected enum LocodeState
|
protected enum LocodeState
|
||||||
{
|
{
|
||||||
@ -36,6 +47,15 @@ namespace ENI2.Controls
|
|||||||
AMBIGUOUS
|
AMBIGUOUS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public void SetFocus()
|
||||||
|
{
|
||||||
|
this.comboBoxLocode.Focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Properties
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// used internally to load up drop down
|
/// used internally to load up drop down
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -89,10 +109,10 @@ namespace ENI2.Controls
|
|||||||
// MessageBox.Show(string.Format("CoerceValue is fired : Value {0}", Value));
|
// MessageBox.Show(string.Format("CoerceValue is fired : Value {0}", Value));
|
||||||
return Value;
|
return Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public RuleEngine.LocodeMode LocodeSource { get; set; }
|
public RuleEngine.LocodeMode LocodeSource { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region static methods
|
#region static methods
|
||||||
|
|
||||||
public static readonly DependencyProperty LocodeValueProperty = DependencyProperty.Register("LocodeValue", typeof(string), typeof(LocodeControl),
|
public static readonly DependencyProperty LocodeValueProperty = DependencyProperty.Register("LocodeValue", typeof(string), typeof(LocodeControl),
|
||||||
@ -220,6 +240,15 @@ namespace ENI2.Controls
|
|||||||
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("LocodeList"));
|
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("LocodeList"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void comboBoxLocode_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if ((e.Key == System.Windows.Input.Key.Down) && !this.comboBoxLocode.IsDropDownOpen)
|
||||||
|
{
|
||||||
|
this.comboBoxLocode.IsDropDownOpen = true;
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region private/protected methods
|
#region private/protected methods
|
||||||
@ -245,14 +274,6 @@ namespace ENI2.Controls
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private void comboBoxLocode_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
|
|
||||||
{
|
|
||||||
if((e.Key == System.Windows.Input.Key.Down) && !this.comboBoxLocode.IsDropDownOpen)
|
|
||||||
{
|
|
||||||
this.comboBoxLocode.IsDropDownOpen = true;
|
|
||||||
e.Handled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -333,7 +333,7 @@ namespace ENI2
|
|||||||
|
|
||||||
// Bearbeitungsinformationen für bestehende ID-Beantragung beibehalten, falls bereits vorhanden
|
// Bearbeitungsinformationen für bestehende ID-Beantragung beibehalten, falls bereits vorhanden
|
||||||
|
|
||||||
if(existingCore.IsTransit &&
|
if(existingCore.IsTransit &&
|
||||||
(existingMessage.MessageNotificationClass == Message.NotificationClass.TRANSIT) &&
|
(existingMessage.MessageNotificationClass == Message.NotificationClass.TRANSIT) &&
|
||||||
(existingMessage.InternalStatus == Message.BSMDStatus.CONFIRMED))
|
(existingMessage.InternalStatus == Message.BSMDStatus.CONFIRMED))
|
||||||
{
|
{
|
||||||
@ -392,7 +392,7 @@ namespace ENI2
|
|||||||
newMessage.MessageCoreId = newCore.Id;
|
newMessage.MessageCoreId = newCore.Id;
|
||||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(newMessage);
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(newMessage);
|
||||||
newMessage.SaveElements();
|
newMessage.SaveElements();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.OnOpenNewCoreRequested(newCore);
|
this.OnOpenNewCoreRequested(newCore);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,6 +28,7 @@
|
|||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<TextBlock Name="textBlockMessageClass" FontWeight="DemiBold" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
<TextBlock Name="textBlockMessageClass" FontWeight="DemiBold" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||||
|
<Button Content="{x:Static p:Resources.textNewDGItem}" Name="buttonNewItem" Margin="2" Click="buttonNewItem_Click" Grid.Row="0" Grid.Column="1" />
|
||||||
<Label Content="{x:Static p:Resources.textDangerousGoodsOnBoard}" Grid.Column="0" Grid.Row="1" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
<Label Content="{x:Static p:Resources.textDangerousGoodsOnBoard}" Grid.Column="0" Grid.Row="1" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
<Label Content="{x:Static p:Resources.textVesselClass}" Grid.Column="0" Grid.Row="2" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
<Label Content="{x:Static p:Resources.textVesselClass}" Grid.Column="0" Grid.Row="2" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
<Label Content="{x:Static p:Resources.textDGManifestOnBoard}" Grid.Column="2" Grid.Row="1" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
<Label Content="{x:Static p:Resources.textDGManifestOnBoard}" Grid.Column="2" Grid.Row="1" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
|||||||
@ -22,18 +22,28 @@ namespace ENI2.DetailViewControls
|
|||||||
public partial class DangerousGoodsDetailControl : DetailBaseControl
|
public partial class DangerousGoodsDetailControl : DetailBaseControl
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#region fields
|
||||||
|
|
||||||
private Message _hazaMessage;
|
private Message _hazaMessage;
|
||||||
private Message _hazdMessage;
|
private Message _hazdMessage;
|
||||||
|
|
||||||
private HAZ haza;
|
private HAZ haza;
|
||||||
private HAZ hazd;
|
private HAZ hazd;
|
||||||
|
|
||||||
|
private NewDGItemDialog newDGDialog = null;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Construction
|
||||||
|
|
||||||
public DangerousGoodsDetailControl()
|
public DangerousGoodsDetailControl()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.Loaded += DangerousGoodsDetailControl_Loaded;
|
this.Loaded += DangerousGoodsDetailControl_Loaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
private void DangerousGoodsDetailControl_Loaded(object sender, RoutedEventArgs e)
|
private void DangerousGoodsDetailControl_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
this.RegisterCheckboxChange(this.checkBoxDangerousGoodsOnBoard, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.RegisterCheckboxChange(this.checkBoxDangerousGoodsOnBoard, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
@ -799,5 +809,94 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region new sublist item button handler
|
||||||
|
|
||||||
|
private void buttonNewItem_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (newDGDialog != null)
|
||||||
|
{
|
||||||
|
newDGDialog.Activate();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
newDGDialog = new NewDGItemDialog();
|
||||||
|
newDGDialog.Closed += NewDGDialog_Closed;
|
||||||
|
newDGDialog.OKClicked += NewDGDialog_OKClicked;
|
||||||
|
newDGDialog.AddClicked += NewDGDialog_OKClicked;
|
||||||
|
newDGDialog.Show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void NewDGDialog_Closed(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
newDGDialog = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void NewDGDialog_OKClicked()
|
||||||
|
{
|
||||||
|
HAZ haz = this.IsDeparture ? hazd : haza;
|
||||||
|
|
||||||
|
HAZPosTemplate selectedTemplate = this.newDGDialog.SelectedTemplate;
|
||||||
|
|
||||||
|
if (selectedTemplate != null)
|
||||||
|
{
|
||||||
|
// create new DG position based on template
|
||||||
|
switch (selectedTemplate.TemplateType)
|
||||||
|
{
|
||||||
|
case HAZPosTemplate.SublistType.IBC:
|
||||||
|
this.tabControlPositions.SelectedIndex = 1;
|
||||||
|
IBCPosition ibcPos = new IBCPosition();
|
||||||
|
ibcPos.FlashpointInformation = selectedTemplate.Flashpoint;
|
||||||
|
ibcPos.Flashpoint_CEL = selectedTemplate.FP_IBC;
|
||||||
|
ibcPos.SpecRef15_19 = selectedTemplate.SpecRef15_19;
|
||||||
|
ibcPos.Hazards = selectedTemplate.Hazard;
|
||||||
|
ibcPos.Identifier = DatabaseEntity.GetNewIdentifier(haz.IBCPositions, "IBC-");
|
||||||
|
ibcPos.PollutionCategory = selectedTemplate.PollutionCategory;
|
||||||
|
ibcPos.HAZ = haz;
|
||||||
|
haz.IBCPositions.Add(ibcPos);
|
||||||
|
this.dataGridIBCItems.Items.Refresh();
|
||||||
|
this.DataGridIBCItems_EditRequested(ibcPos);
|
||||||
|
break;
|
||||||
|
case HAZPosTemplate.SublistType.IGC:
|
||||||
|
this.tabControlPositions.SelectedIndex = 2;
|
||||||
|
IGCPosition igcPos = new IGCPosition();
|
||||||
|
igcPos.Identifier = DatabaseEntity.GetNewIdentifier(haz.IGCPositions, "IGC-");
|
||||||
|
igcPos.UNNumber = selectedTemplate.UNNr;
|
||||||
|
igcPos.IMOClass = selectedTemplate.IMOClass;
|
||||||
|
igcPos.HAZ = haz;
|
||||||
|
haz.IGCPositions.Add(igcPos);
|
||||||
|
this.dataGridIGCItems.Items.Refresh();
|
||||||
|
this.DataGridIGCItems_EditRequested(igcPos);
|
||||||
|
break;
|
||||||
|
case HAZPosTemplate.SublistType.IMSBC:
|
||||||
|
this.tabControlPositions.SelectedIndex = 3;
|
||||||
|
IMSBCPosition imsbcPos = new IMSBCPosition();
|
||||||
|
imsbcPos.Identifier = DatabaseEntity.GetNewIdentifier(haz.IMSBCPositions, "IMSBC-");
|
||||||
|
imsbcPos.IMOHazardClass = selectedTemplate.IMSBC_HAZ;
|
||||||
|
imsbcPos.UNNumber = selectedTemplate.UNNr;
|
||||||
|
imsbcPos.IMOClass = selectedTemplate.IMOClass;
|
||||||
|
imsbcPos.MHB = selectedTemplate.MHB ?? false;
|
||||||
|
imsbcPos.HAZ = haz;
|
||||||
|
haz.IMSBCPositions.Add(imsbcPos);
|
||||||
|
this.dataGridIMSBCItems.Items.Refresh();
|
||||||
|
this.DataGridIMSBCItems_EditRequested(imsbcPos);
|
||||||
|
break;
|
||||||
|
case HAZPosTemplate.SublistType.MARPOL:
|
||||||
|
this.tabControlPositions.SelectedIndex = 4;
|
||||||
|
MARPOL_Annex_I_Position marpolPos = new MARPOL_Annex_I_Position();
|
||||||
|
marpolPos.FlashpointInformation = selectedTemplate.Flashpoint;
|
||||||
|
marpolPos.Identifier = DatabaseEntity.GetNewIdentifier(haz.MARPOLPositions, "MARPOL-");
|
||||||
|
marpolPos.HAZ = haz;
|
||||||
|
haz.MARPOLPositions.Add(marpolPos);
|
||||||
|
this.dataGridMARPOLItems.Items.Refresh();
|
||||||
|
this.DataGridMARPOLItems_EditRequested(marpolPos);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
this.SetHAZGlobalFlags();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,7 +72,7 @@ namespace ENI2.DetailViewControls
|
|||||||
this.textBoxENI.IsReadOnly = !iAmAdmin;
|
this.textBoxENI.IsReadOnly = !iAmAdmin;
|
||||||
this.textBoxIMO.IsReadOnly = !iAmAdmin;
|
this.textBoxIMO.IsReadOnly = !iAmAdmin;
|
||||||
this.locodePoC.IsEnabled = iAmAdmin;
|
this.locodePoC.IsEnabled = iAmAdmin;
|
||||||
this.textBoxDisplayId.IsReadOnly = !iAmAdmin;
|
this.textBoxDisplayId.IsReadOnly = !iAmAdmin;
|
||||||
|
|
||||||
this.textBoxENI.DataContext = this.Core;
|
this.textBoxENI.DataContext = this.Core;
|
||||||
this.textBoxIMO.DataContext = this.Core;
|
this.textBoxIMO.DataContext = this.Core;
|
||||||
|
|||||||
@ -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>2</ApplicationRevision>
|
<ApplicationRevision>12</ApplicationRevision>
|
||||||
<ApplicationVersion>7.4.0.2</ApplicationVersion>
|
<ApplicationVersion>7.5.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>62DE8527C377957850DB503DA52FF66F664BD459</ManifestCertificateThumbprint>
|
<ManifestCertificateThumbprint>F2C2D0164244EC89955EF50201EE24C2A300FF0B</ManifestCertificateThumbprint>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<SignManifests>true</SignManifests>
|
<SignManifests>true</SignManifests>
|
||||||
@ -237,6 +237,12 @@
|
|||||||
<Compile Include="EditControls\EditWasteReceivedDialog.xaml.cs">
|
<Compile Include="EditControls\EditWasteReceivedDialog.xaml.cs">
|
||||||
<DependentUpon>EditWasteReceivedDialog.xaml</DependentUpon>
|
<DependentUpon>EditWasteReceivedDialog.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="EditControls\FixImportDialog.xaml.cs">
|
||||||
|
<DependentUpon>FixImportDialog.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="EditControls\NewDGItemDialog.xaml.cs">
|
||||||
|
<DependentUpon>NewDGItemDialog.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Excel\DakosyUtil.cs" />
|
<Compile Include="Excel\DakosyUtil.cs" />
|
||||||
<Compile Include="Excel\ExcelBase.cs" />
|
<Compile Include="Excel\ExcelBase.cs" />
|
||||||
<Compile Include="Excel\ExcelComparer.cs" />
|
<Compile Include="Excel\ExcelComparer.cs" />
|
||||||
@ -644,6 +650,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="EditControls\FixImportDialog.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="EditControls\MessageHistoryDialog.xaml">
|
<Page Include="EditControls\MessageHistoryDialog.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@ -652,6 +662,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="EditControls\NewDGItemDialog.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="EditControls\NewWithIdDialog.xaml">
|
<Page Include="EditControls\NewWithIdDialog.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
|||||||
@ -3,9 +3,12 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
using bsmd.database;
|
using bsmd.database;
|
||||||
|
using Microsoft.Win32;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Net;
|
||||||
|
using System.Net.Http;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace ENI2.EditControls
|
namespace ENI2.EditControls
|
||||||
@ -28,61 +31,118 @@ namespace ENI2.EditControls
|
|||||||
|
|
||||||
#region Drag&Drop event handler
|
#region Drag&Drop event handler
|
||||||
|
|
||||||
private void imageSource_Drop(object sender, DragEventArgs e)
|
private async void imageSource_Drop(object sender, DragEventArgs e)
|
||||||
{
|
{
|
||||||
string[] files = (string[]) e.Data.GetData(DataFormats.FileDrop);
|
string[] files = (string[]) e.Data.GetData(DataFormats.FileDrop);
|
||||||
foreach (string file in files)
|
if (files != null)
|
||||||
Console.WriteLine(file);
|
|
||||||
if(files.Length > 0)
|
|
||||||
{
|
{
|
||||||
if(File.Exists(files[0]))
|
foreach (string file in files)
|
||||||
|
Console.WriteLine(file);
|
||||||
|
if (files.Length > 0)
|
||||||
{
|
{
|
||||||
if(files[0].EndsWith("xls") || files[0].EndsWith("xlsx"))
|
if (File.Exists(files[0]))
|
||||||
{
|
{
|
||||||
_sourcePath = files[0];
|
if (files[0].EndsWith("xls") || files[0].EndsWith("xlsx"))
|
||||||
textBoxSource.Text = _sourcePath;
|
{
|
||||||
|
_sourcePath = files[0];
|
||||||
|
textBoxSource.Text = _sourcePath;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
textBoxSource.Text = null;
|
||||||
|
_sourcePath = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
textBoxSource.Text = null;
|
textBoxSource.Text = null;
|
||||||
_sourcePath = null;
|
_sourcePath = null;
|
||||||
}
|
}
|
||||||
}
|
EnableCompareButton();
|
||||||
else
|
}
|
||||||
{
|
}
|
||||||
textBoxSource.Text = null;
|
else
|
||||||
_sourcePath = null;
|
{
|
||||||
|
string link = (string)e.Data.GetData(DataFormats.Text);
|
||||||
|
if(link != null)
|
||||||
|
{
|
||||||
|
|
||||||
|
using (var client = new WebClient())
|
||||||
|
{
|
||||||
|
string fileName = Path.GetTempPath() + Guid.NewGuid().ToString() + ".xlsx";
|
||||||
|
client.DownloadFile(link, fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
// check if it is really an url, try to download the file and open it
|
||||||
|
if (Uri.TryCreate(link, UriKind.Absolute, out Uri uri))
|
||||||
|
{
|
||||||
|
HttpClient client = new HttpClient();
|
||||||
|
var response = await client.GetAsync(uri);
|
||||||
|
string fileName = Path.GetTempPath() + Guid.NewGuid().ToString() + ".xlsx";
|
||||||
|
using (var fs = new FileStream(fileName, FileMode.CreateNew))
|
||||||
|
{
|
||||||
|
await response.Content.CopyToAsync(fs);
|
||||||
|
textBoxSource.Text = link;
|
||||||
|
_sourcePath = fileName;
|
||||||
|
EnableCompareButton();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
EnableCompareButton();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void imageTarget_Drop(object sender, DragEventArgs e)
|
private async void imageTarget_Drop(object sender, DragEventArgs e)
|
||||||
{
|
{
|
||||||
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
|
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
|
||||||
foreach (string file in files)
|
if (files != null)
|
||||||
Console.WriteLine(file);
|
|
||||||
if (files.Length > 0)
|
|
||||||
{
|
{
|
||||||
if (File.Exists(files[0]))
|
foreach (string file in files)
|
||||||
|
Console.WriteLine(file);
|
||||||
|
if (files.Length > 0)
|
||||||
{
|
{
|
||||||
if (files[0].EndsWith("xls") || files[0].EndsWith("xlsx"))
|
if (File.Exists(files[0]))
|
||||||
{
|
{
|
||||||
_targetPath = files[0];
|
if (files[0].EndsWith("xls") || files[0].EndsWith("xlsx"))
|
||||||
textBoxTarget.Text = _targetPath;
|
{
|
||||||
|
_targetPath = files[0];
|
||||||
|
textBoxTarget.Text = _targetPath;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_targetPath = null;
|
||||||
|
textBoxTarget.Text = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_targetPath = null;
|
_targetPath = null;
|
||||||
textBoxTarget.Text = null;
|
textBoxTarget.Text = null;
|
||||||
}
|
}
|
||||||
|
EnableCompareButton();
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string link = (string)e.Data.GetData(DataFormats.Text);
|
||||||
|
if (link != null)
|
||||||
{
|
{
|
||||||
_targetPath = null;
|
// check if it is really an url, try to download the file and open it
|
||||||
textBoxTarget.Text = null;
|
if (Uri.TryCreate(link, UriKind.Absolute, out Uri uri))
|
||||||
|
{
|
||||||
|
HttpClient client = new HttpClient();
|
||||||
|
var response = await client.GetAsync(uri);
|
||||||
|
string fileName = Path.GetTempPath() + Guid.NewGuid().ToString() + ".xlsx";
|
||||||
|
using (var fs = new FileStream(fileName, FileMode.CreateNew))
|
||||||
|
{
|
||||||
|
await response.Content.CopyToAsync(fs);
|
||||||
|
textBoxTarget.Text = link;
|
||||||
|
_targetPath = fileName;
|
||||||
|
EnableCompareButton();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
EnableCompareButton();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,15 +175,26 @@ namespace ENI2.EditControls
|
|||||||
private void buttonCompare_Click(object sender, RoutedEventArgs e)
|
private void buttonCompare_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Util.UIHelper.SetBusyState();
|
Util.UIHelper.SetBusyState();
|
||||||
string resultPath = Excel.ExcelComparer.Compare(_sourcePath, _targetPath, out string errorMessage);
|
|
||||||
if(!errorMessage.IsNullOrEmpty()) {
|
string defaultName = string.Format("{0}.xlsx", Guid.NewGuid().ToString());
|
||||||
MessageBox.Show(errorMessage, "Comparison error", MessageBoxButton.OK, MessageBoxImage.Warning);
|
SaveFileDialog sfd = new SaveFileDialog
|
||||||
}
|
|
||||||
if(File.Exists(resultPath))
|
|
||||||
{
|
{
|
||||||
if(new FileInfo(resultPath).Length > 0)
|
Filter = "Excel Files|*.xls;*.xlsx",
|
||||||
|
FileName = defaultName
|
||||||
|
};
|
||||||
|
|
||||||
|
if (sfd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
string resultPath = Excel.ExcelComparer.Compare(_sourcePath, _targetPath, sfd.FileName, out string errorMessage);
|
||||||
|
if (!errorMessage.IsNullOrEmpty()) {
|
||||||
|
MessageBox.Show(errorMessage, "Comparison error", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||||
|
}
|
||||||
|
if (File.Exists(resultPath))
|
||||||
{
|
{
|
||||||
Process.Start(resultPath);
|
if (new FileInfo(resultPath).Length > 0)
|
||||||
|
{
|
||||||
|
Process.Start(resultPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@ namespace ENI2.EditControls
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Loaded += CopyDeclarationDialog_Loaded;
|
Loaded += CopyDeclarationDialog_Loaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
|
|||||||
@ -43,7 +43,7 @@
|
|||||||
<TextBox Grid.Row="0" Grid.Column="1" Width="auto" Name="textBoxDuty" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
|
<TextBox Grid.Row="0" Grid.Column="1" Width="auto" Name="textBoxDuty" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||||
<TextBox Grid.Row="1" Grid.Column="1" Width="auto" Name="textBoxLastName" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
|
<TextBox Grid.Row="1" Grid.Column="1" Width="auto" Name="textBoxLastName" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||||
<TextBox Grid.Row="1" Grid.Column="3" Width="auto" Name="textBoxFirstName" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
|
<TextBox Grid.Row="1" Grid.Column="3" Width="auto" Name="textBoxFirstName" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||||
<ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxGender" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" ContextMenu="{DynamicResource ClearContextMenu}"/>
|
<ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxGender" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" SelectedValuePath="Key" DisplayMemberPath="Value" ContextMenu="{DynamicResource ClearContextMenu}"/>
|
||||||
<TextBox Grid.Row="2" Grid.Column="3" Width="auto" Name="textBoxPlaceOfBirth" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
|
<TextBox Grid.Row="2" Grid.Column="3" Width="auto" Name="textBoxPlaceOfBirth" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||||
<ComboBox Grid.Row="3" Grid.Column="1" Name="comboBoxNationality" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" ContextMenu="{DynamicResource ClearContextMenu}"/>
|
<ComboBox Grid.Row="3" Grid.Column="1" Name="comboBoxNationality" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" ContextMenu="{DynamicResource ClearContextMenu}"/>
|
||||||
<DatePicker Grid.Row="3" Grid.Column="3" Name="datePickerDateOfBirth" Margin="2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
<DatePicker Grid.Row="3" Grid.Column="3" Name="datePickerDateOfBirth" Margin="2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
||||||
@ -52,7 +52,7 @@
|
|||||||
<CalendarDateRange Start="1/1/2199" End="1/1/9999"/>
|
<CalendarDateRange Start="1/1/2199" End="1/1/9999"/>
|
||||||
</DatePicker.BlackoutDates>
|
</DatePicker.BlackoutDates>
|
||||||
</DatePicker>
|
</DatePicker>
|
||||||
<ComboBox Grid.Row="4" Grid.Column="1" Name="comboBoxIdDocType" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" ContextMenu="{DynamicResource ClearContextMenu}" />
|
<ComboBox Grid.Row="4" Grid.Column="1" Name="comboBoxIdDocType" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" SelectedValuePath="Key" DisplayMemberPath="Value" ContextMenu="{DynamicResource ClearContextMenu}" />
|
||||||
<!-- <ComboBox Grid.Row="4" Grid.Column="3" Width="auto" Name="comboBoxCountryOfBirth" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" ContextMenu="{DynamicResource ClearContextMenu}"/>-->
|
<!-- <ComboBox Grid.Row="4" Grid.Column="3" Width="auto" Name="comboBoxCountryOfBirth" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" ContextMenu="{DynamicResource ClearContextMenu}"/>-->
|
||||||
<TextBox Grid.Row="5" Grid.Column="3" Width="auto" Name="textBoxIdDocNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
<TextBox Grid.Row="5" Grid.Column="3" Width="auto" Name="textBoxIdDocNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
||||||
<TextBox Grid.Row="5" Grid.Column="1" Width="auto" Name="textBoxVisaNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
|
<TextBox Grid.Row="5" Grid.Column="1" Width="auto" Name="textBoxVisaNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||||
|
|||||||
@ -30,19 +30,14 @@ namespace ENI2.EditControls
|
|||||||
this.textBoxDuty.Text = this.CREW.CrewMemberDuty;
|
this.textBoxDuty.Text = this.CREW.CrewMemberDuty;
|
||||||
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.GenderList;
|
this.comboBoxGender.ItemsSource = GlobalStructures.GenderDict;
|
||||||
//this.comboBoxGender.KeyUp += ComboBox_KeyUp;
|
this.comboBoxGender.SelectedValue = (this.CREW.CrewMemberGender == null) ? null : this.CREW.CrewMemberGender.ToString();
|
||||||
this.comboBoxGender.SelectedIndex = this.CREW.CrewMemberGender ?? -1;
|
|
||||||
if (this.CREW.CrewMemberGender == 9)
|
|
||||||
this.comboBoxGender.SelectedIndex = 3;
|
|
||||||
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.KeyUp += ComboBox_KeyUp;
|
|
||||||
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.IDDocTypeList;
|
this.comboBoxIdDocType.ItemsSource = GlobalStructures.IDDocTypeDict;
|
||||||
//this.comboBoxIdDocType.KeyUp += ComboBox_KeyUp;
|
this.comboBoxIdDocType.SelectedValue = (this.CREW.CrewMemberIdentityDocumentType == null) ? null : this.CREW.CrewMemberIdentityDocumentType.ToString();
|
||||||
this.comboBoxIdDocType.SelectedIndex = this.CREW.CrewMemberIdentityDocumentType ?? -1;
|
|
||||||
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;
|
||||||
@ -62,15 +57,14 @@ namespace ENI2.EditControls
|
|||||||
this.CREW.CrewMemberDuty = this.textBoxDuty.Text.Trim();
|
this.CREW.CrewMemberDuty = this.textBoxDuty.Text.Trim();
|
||||||
this.CREW.CrewMemberLastName = this.textBoxLastName.Text.Trim();
|
this.CREW.CrewMemberLastName = this.textBoxLastName.Text.Trim();
|
||||||
this.CREW.CrewMemberFirstName = this.textBoxFirstName.Text.Trim();
|
this.CREW.CrewMemberFirstName = this.textBoxFirstName.Text.Trim();
|
||||||
this.CREW.CrewMemberGender = (this.comboBoxGender.SelectedIndex == -1) ? null : (byte?) this.comboBoxGender.SelectedIndex;
|
this.CREW.CrewMemberGender = (this.comboBoxGender.SelectedIndex == -1) ? null : (byte?) byte.Parse((string) this.comboBoxGender.SelectedValue);
|
||||||
if (this.CREW.CrewMemberGender == 3) this.CREW.CrewMemberGender = 9;
|
|
||||||
this.CREW.CrewMemberPlaceOfBirth = this.textBoxPlaceOfBirth.Text.Trim();
|
this.CREW.CrewMemberPlaceOfBirth = this.textBoxPlaceOfBirth.Text.Trim();
|
||||||
this.CREW.CrewMemberNationality = (this.comboBoxNationality.SelectedValue == null) ? "" : (string)this.comboBoxNationality.SelectedValue;
|
this.CREW.CrewMemberNationality = (this.comboBoxNationality.SelectedValue == null) ? "" : (string) this.comboBoxNationality.SelectedValue;
|
||||||
this.CREW.CrewMemberDateOfBirth = this.datePickerDateOfBirth.SelectedDate;
|
this.CREW.CrewMemberDateOfBirth = this.datePickerDateOfBirth.SelectedDate;
|
||||||
this.CREW.CrewMemberIdentityDocumentType = (this.comboBoxIdDocType.SelectedIndex == -1) ? null : (byte?)this.comboBoxIdDocType.SelectedIndex;
|
this.CREW.CrewMemberIdentityDocumentType = (this.comboBoxIdDocType.SelectedIndex == -1) ? null : (byte?) byte.Parse((string)this.comboBoxIdDocType.SelectedValue);
|
||||||
this.CREW.CrewMemberIdentityDocumentId = this.textBoxIdDocNumber.Text.Trim();
|
this.CREW.CrewMemberIdentityDocumentId = this.textBoxIdDocNumber.Text.Trim();
|
||||||
this.CREW.CrewMemberVisaNumber = this.textBoxVisaNumber.Text.Trim();
|
this.CREW.CrewMemberVisaNumber = this.textBoxVisaNumber.Text.Trim();
|
||||||
this.CREW.CrewMemberIdentityDocumentIssuingState = (this.comboBoxIssuingState.SelectedValue == null) ? "" : (string)this.comboBoxIssuingState.SelectedValue;
|
this.CREW.CrewMemberIdentityDocumentIssuingState = (this.comboBoxIssuingState.SelectedValue == null) ? "" : (string) this.comboBoxIssuingState.SelectedValue;
|
||||||
this.CREW.CrewMemberIdentityDocumentExpiryDate = this.datePickerExpiryDate.SelectedDate;
|
this.CREW.CrewMemberIdentityDocumentExpiryDate = this.datePickerExpiryDate.SelectedDate;
|
||||||
// this.CREW.CrewMemberCountryOfBirth = (this.comboBoxCountryOfBirth.SelectedValue == null) ? "" : (string)this.comboBoxCountryOfBirth.SelectedValue;
|
// this.CREW.CrewMemberCountryOfBirth = (this.comboBoxCountryOfBirth.SelectedValue == null) ? "" : (string)this.comboBoxCountryOfBirth.SelectedValue;
|
||||||
// this.CREW.Effects = this.textBoxEffects.Text.Trim();
|
// this.CREW.Effects = this.textBoxEffects.Text.Trim();
|
||||||
|
|||||||
@ -47,7 +47,7 @@ namespace ENI2.EditControls
|
|||||||
|
|
||||||
this.OKClicked += EditIMSBCDialog_OKClicked;
|
this.OKClicked += EditIMSBCDialog_OKClicked;
|
||||||
this.AddVisible = true;
|
this.AddVisible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CopyValuesToEntity()
|
public void CopyValuesToEntity()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
<TextBox Grid.Row="0" Grid.Column="1" Width="auto" Name="textBoxLastName" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
<TextBox Grid.Row="0" Grid.Column="1" Width="auto" Name="textBoxLastName" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
||||||
<TextBox Grid.Row="0" Grid.Column="3" Width="auto" Name="textBoxFirstName" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
<TextBox Grid.Row="0" Grid.Column="3" Width="auto" Name="textBoxFirstName" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
||||||
<ComboBox Grid.Row="1" Grid.Column="1" Name="comboBoxGender" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True"/>
|
<ComboBox Grid.Row="1" Grid.Column="1" Name="comboBoxGender" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True"/>
|
||||||
<TextBox Grid.Row="1" Grid.Column="3" Width="auto" Name="textBoxPlaceOfBirth" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
<TextBox Grid.Row="1" Grid.Column="3" Width="auto" Name="textBoxPlaceOfBirth" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
||||||
<ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxNationality" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
<ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxNationality" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
||||||
<DatePicker Grid.Row="2" Grid.Column="3" Name="datePickerDateOfBirth" Margin="2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
<DatePicker Grid.Row="2" Grid.Column="3" Name="datePickerDateOfBirth" Margin="2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
||||||
@ -56,7 +56,7 @@
|
|||||||
<CalendarDateRange Start="1/1/2199" End="1/1/9999"/>
|
<CalendarDateRange Start="1/1/2199" End="1/1/9999"/>
|
||||||
</DatePicker.BlackoutDates>
|
</DatePicker.BlackoutDates>
|
||||||
</DatePicker>
|
</DatePicker>
|
||||||
<ComboBox Grid.Row="3" Grid.Column="1" Name="comboBoxIdDocType" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
<ComboBox Grid.Row="3" Grid.Column="1" Name="comboBoxIdDocType" Margin="2" IsEditable="True" SelectedValuePath="Key" DisplayMemberPath="Value" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
||||||
<!--<ComboBox Grid.Row="3" Grid.Column="3" Name="comboBoxCountryOfBirth" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />-->
|
<!--<ComboBox Grid.Row="3" Grid.Column="3" Name="comboBoxCountryOfBirth" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />-->
|
||||||
<TextBox Grid.Row="4" Grid.Column="3" Width="auto" Name="textBoxIdDocNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
<TextBox Grid.Row="4" Grid.Column="3" Width="auto" Name="textBoxIdDocNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
||||||
<TextBox Grid.Row="4" Grid.Column="1" Width="auto" Name="textBoxVisaNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
<TextBox Grid.Row="4" Grid.Column="1" Width="auto" Name="textBoxVisaNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
||||||
|
|||||||
@ -29,19 +29,14 @@ namespace ENI2.EditControls
|
|||||||
// copy into fields
|
// copy into fields
|
||||||
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.GenderList;
|
this.comboBoxGender.ItemsSource = GlobalStructures.GenderDict;
|
||||||
//this.comboBoxGender.KeyUp += ComboBox_KeyUp;
|
this.comboBoxGender.SelectedValue = this.PAS.PassengerGender ?? -1;
|
||||||
this.comboBoxGender.SelectedIndex = this.PAS.PassengerGender ?? -1;
|
|
||||||
if (this.PAS.PassengerGender == 9)
|
|
||||||
this.comboBoxGender.SelectedIndex = 3;
|
|
||||||
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.KeyUp += ComboBox_KeyUp;
|
|
||||||
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.IDDocTypeList;
|
this.comboBoxIdDocType.ItemsSource = GlobalStructures.IDDocTypeDict;
|
||||||
//this.comboBoxIdDocType.KeyUp += ComboBox_KeyUp;
|
this.comboBoxIdDocType.SelectedValue = this.PAS.PassengerIdentityDocumentType ?? null;
|
||||||
this.comboBoxIdDocType.SelectedIndex = this.PAS.PassengerIdentityDocumentType ?? -1;
|
|
||||||
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;
|
||||||
@ -66,13 +61,11 @@ namespace ENI2.EditControls
|
|||||||
// copy back
|
// copy back
|
||||||
this.PAS.PassengerLastName = this.textBoxLastName.Text.Trim();
|
this.PAS.PassengerLastName = this.textBoxLastName.Text.Trim();
|
||||||
this.PAS.PassengerFirstName = this.textBoxFirstName.Text.Trim();
|
this.PAS.PassengerFirstName = this.textBoxFirstName.Text.Trim();
|
||||||
this.PAS.PassengerGender = (this.comboBoxGender.SelectedIndex == -1) ? null : (byte?)this.comboBoxGender.SelectedIndex;
|
this.PAS.PassengerGender = (this.comboBoxGender.SelectedIndex == -1) ? null : (byte?)byte.Parse((string)this.comboBoxGender.SelectedValue);
|
||||||
if (this.PAS.PassengerGender == 3)
|
|
||||||
this.PAS.PassengerGender = 9;
|
|
||||||
this.PAS.PassengerPlaceOfBirth = this.textBoxPlaceOfBirth.Text.Trim();
|
this.PAS.PassengerPlaceOfBirth = this.textBoxPlaceOfBirth.Text.Trim();
|
||||||
this.PAS.PassengerNationality = (this.comboBoxNationality.SelectedValue == null) ? "" : (string)this.comboBoxNationality.SelectedValue;
|
this.PAS.PassengerNationality = (this.comboBoxNationality.SelectedValue == null) ? "" : (string)this.comboBoxNationality.SelectedValue;
|
||||||
this.PAS.PassengerDateOfBirth = this.datePickerDateOfBirth.SelectedDate;
|
this.PAS.PassengerDateOfBirth = this.datePickerDateOfBirth.SelectedDate;
|
||||||
this.PAS.PassengerIdentityDocumentType = (this.comboBoxIdDocType.SelectedIndex == -1) ? null : (byte?)this.comboBoxIdDocType.SelectedIndex;
|
this.PAS.PassengerIdentityDocumentType = (this.comboBoxIdDocType.SelectedIndex == -1) ? null : (byte?) byte.Parse((string)this.comboBoxIdDocType.SelectedValue);
|
||||||
this.PAS.PassengerIdentityDocumentId = this.textBoxIdDocNumber.Text.Trim();
|
this.PAS.PassengerIdentityDocumentId = this.textBoxIdDocNumber.Text.Trim();
|
||||||
this.PAS.PassengerVisaNumber = this.textBoxVisaNumber.Text.Trim();
|
this.PAS.PassengerVisaNumber = this.textBoxVisaNumber.Text.Trim();
|
||||||
this.PAS.PassengerPortOfEmbarkation = this.locodePortOfEmbarkation.LocodeValue;
|
this.PAS.PassengerPortOfEmbarkation = this.locodePortOfEmbarkation.LocodeValue;
|
||||||
|
|||||||
31
ENI2/EditControls/FixImportDialog.xaml
Normal file
31
ENI2/EditControls/FixImportDialog.xaml
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<enictrl:EditWindowBase x:Class="ENI2.EditControls.FixImportDialog"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||||
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
|
xmlns:local="clr-namespace:ENI2.EditControls"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="Fix imported value" Height="200" Width="500" WindowStyle="SingleBorderWindow" Background="AliceBlue" Loaded="EditWindowBase_Loaded">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="80" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Label Content="Type" Grid.Row="0" Grid.Column="0" Focusable="False" />
|
||||||
|
<Label Content="Value" Grid.Row="1" Grid.Column="0" Focusable="False" />
|
||||||
|
<Label Content="Selection" Grid.Row="2" Grid.Column="0" Focusable="False"/>
|
||||||
|
|
||||||
|
<TextBlock FontWeight="DemiBold" VerticalAlignment="Center" Name="textBlockType" Grid.Row="0" Grid.Column="1" Focusable="False">bla</TextBlock>
|
||||||
|
<TextBlock FontWeight="DemiBold" VerticalAlignment="Center" Name="textBlockValue" Grid.Row="1" Grid.Column="1" Focusable="False">bla</TextBlock>
|
||||||
|
<xctk:WatermarkComboBox Grid.Column="1" Grid.Row="2" x:Name="comboBoxValues" IsTextSearchEnabled="True" SelectedValuePath="Key" DisplayMemberPath="Value" Margin="2" IsEditable="True" Watermark="Select an appropriate value" />
|
||||||
|
<enictrl:LocodeControl Grid.Column="1" Grid.Row="2" x:Name="locodeControl" Visibility="Hidden" />
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</enictrl:EditWindowBase>
|
||||||
88
ENI2/EditControls/FixImportDialog.xaml.cs
Normal file
88
ENI2/EditControls/FixImportDialog.xaml.cs
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
// Copyright (c) 2017- schick Informatik
|
||||||
|
// Description: Dialog to confirm values during excel import (e.g. CREW/PAS)
|
||||||
|
//
|
||||||
|
|
||||||
|
using ENI2.Controls;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Windows;
|
||||||
|
using bsmd.database;
|
||||||
|
|
||||||
|
namespace ENI2.EditControls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for FixImportDialog.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class FixImportDialog : EditWindowBase
|
||||||
|
{
|
||||||
|
public FixImportDialog()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool LocodeMode
|
||||||
|
{
|
||||||
|
get { return this.locodeControl.Visibility == Visibility.Visible; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.locodeControl.Visibility = value ? Visibility.Visible : Visibility.Hidden;
|
||||||
|
this.comboBoxValues.Visibility = value ? Visibility.Hidden : Visibility.Visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string SelectedValue
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (LocodeMode) return this.locodeControl.LocodeValue;
|
||||||
|
return this.comboBoxValues.SelectedValue as string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Value
|
||||||
|
{
|
||||||
|
get { return this.textBlockValue.Text; }
|
||||||
|
set { this.textBlockValue.Text = value.Trim(); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ValueType
|
||||||
|
{
|
||||||
|
get { return this.textBlockType.Text; }
|
||||||
|
set { this.textBlockType.Text = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public Dictionary<string, string> SelectionValues { get; set; }
|
||||||
|
|
||||||
|
#region event handler
|
||||||
|
|
||||||
|
private void EditWindowBase_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
this.EnableOK(false);
|
||||||
|
|
||||||
|
if (LocodeMode)
|
||||||
|
{
|
||||||
|
this.locodeControl.SetFocus();
|
||||||
|
this.locodeControl.PropertyChanged += LocodeControl_PropertyChanged;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.comboBoxValues.ItemsSource = this.SelectionValues;
|
||||||
|
this.comboBoxValues.SelectionChanged += ComboBoxValues_SelectionChanged;
|
||||||
|
this.comboBoxValues.Focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ComboBoxValues_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
string val = this.comboBoxValues.SelectedValue as string;
|
||||||
|
this.EnableOK(!val.IsNullOrEmpty());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LocodeControl_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||||
|
{
|
||||||
|
this.EnableOK(!locodeControl.LocodeValue.IsNullOrEmpty());
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
43
ENI2/EditControls/NewDGItemDialog.xaml
Normal file
43
ENI2/EditControls/NewDGItemDialog.xaml
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<enictrl:EditWindowBase x:Class="ENI2.EditControls.NewDGItemDialog"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="clr-namespace:ENI2.EditControls"
|
||||||
|
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||||
|
xmlns:p="clr-namespace:ENI2.Properties"
|
||||||
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="{x:Static p:Resources.textNewDGItem}" Height="350" Width="600" WindowStyle="SingleBorderWindow" Background="AliceBlue" ResizeMode="CanResize"
|
||||||
|
Icon="/ENI2;component/Resources/bullet_ball_yellow.ico" Loaded="EditWindowBase_Loaded">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="90" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="80" />
|
||||||
|
<ColumnDefinition Width="2*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Label Content="{x:Static p:Resources.textType}" Grid.Row="0" Grid.Column="0" />
|
||||||
|
<ComboBox Name="comboBoxType" Grid.Column="1" Grid.Row="0" Margin="2" SelectionChanged="comboBoxType_SelectionChanged" />
|
||||||
|
<Label Content="{x:Static p:Resources.textDescription}" Grid.Row="1" Grid.Column="0" />
|
||||||
|
<xctk:WatermarkTextBox Margin="2" Watermark="{x:Static p:Resources.textSearch}" Name="textBoxSearchDescription" Grid.Row="1" Grid.Column="1" TextChanged="textBoxSearchDescription_TextChanged" />
|
||||||
|
<ListBox Name="listBoxDescription" Grid.Column="1" Grid.Row="2" Margin="2" SelectionChanged="listBoxDescription_SelectionChanged" />
|
||||||
|
<Label Content="{x:Static p:Resources.textRemarks}" Grid.Row="5" Grid.Column="0" />
|
||||||
|
<Border BorderThickness="1" Grid.Column="1" Grid.Row="3" Grid.RowSpan="2" BorderBrush="Black" Margin="2">
|
||||||
|
<TextBlock Name="textBlockDescription" Margin="2" Background="LightGray" TextWrapping="Wrap"/>
|
||||||
|
</Border>
|
||||||
|
<Border BorderThickness="1" Grid.Column="1" Grid.Row="5" Grid.RowSpan="2" BorderBrush="Black" Margin="2">
|
||||||
|
<TextBlock Name="textBlockRemarks" Margin="2" Background="LightGray" TextWrapping="Wrap" />
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</enictrl:EditWindowBase>
|
||||||
92
ENI2/EditControls/NewDGItemDialog.xaml.cs
Normal file
92
ENI2/EditControls/NewDGItemDialog.xaml.cs
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
// Copyright (c) 2017- schick Informatik
|
||||||
|
// Description: select a new DG item from a selection of templates
|
||||||
|
//
|
||||||
|
|
||||||
|
using bsmd.database;
|
||||||
|
using ENI2.Controls;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
|
||||||
|
namespace ENI2.EditControls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for NewDGItemDialog.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class NewDGItemDialog : EditWindowBase
|
||||||
|
{
|
||||||
|
private List<HAZPosTemplate> _data = null;
|
||||||
|
private static object filterLock = new object();
|
||||||
|
|
||||||
|
public NewDGItemDialog()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public HAZPosTemplate SelectedTemplate
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.listBoxDescription.SelectedItem as HAZPosTemplate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void EditWindowBase_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// load combo boxes
|
||||||
|
_data = LocalizedLookup.LoadHAZTemplates();
|
||||||
|
this.listBoxDescription.ItemsSource = _data;
|
||||||
|
this.comboBoxType.ItemsSource = Enum.GetValues(typeof(HAZPosTemplate.SublistType));
|
||||||
|
this.OkVisible = false;
|
||||||
|
this.AddVisible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void comboBoxType_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
FilterDescriptions();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void listBoxDescription_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (this.listBoxDescription.SelectedItem is HAZPosTemplate selectedTemplate)
|
||||||
|
{
|
||||||
|
this.textBlockDescription.Text = selectedTemplate.Description;
|
||||||
|
this.textBlockRemarks.Text = selectedTemplate.Comment;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.textBlockDescription.Text = "";
|
||||||
|
this.textBlockRemarks.Text = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void textBoxSearchDescription_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
|
{
|
||||||
|
FilterDescriptions();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FilterDescriptions()
|
||||||
|
{
|
||||||
|
string searchText = this.textBoxSearchDescription.Text.Trim();
|
||||||
|
|
||||||
|
lock (filterLock)
|
||||||
|
{
|
||||||
|
IEnumerable<HAZPosTemplate> filtered = _data;
|
||||||
|
if (searchText.Length > 0)
|
||||||
|
{
|
||||||
|
filtered = _data.Where(elem => elem.Description.ToUpperInvariant().Contains(searchText.ToUpperInvariant()));
|
||||||
|
}
|
||||||
|
if (this.comboBoxType.SelectedItem != null)
|
||||||
|
{
|
||||||
|
HAZPosTemplate.SublistType sType = (HAZPosTemplate.SublistType)this.comboBoxType.SelectedItem;
|
||||||
|
filtered = filtered.Where(elem => elem.TemplateType == sType);
|
||||||
|
}
|
||||||
|
this.listBoxDescription.ItemsSource = filtered;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -30,7 +30,7 @@ namespace ENI2.EditControls
|
|||||||
|
|
||||||
List<KeyValuePair<Message.NSWProvider, string>> comboDataSource = new List<KeyValuePair<Message.NSWProvider, string>>()
|
List<KeyValuePair<Message.NSWProvider, string>> comboDataSource = new List<KeyValuePair<Message.NSWProvider, string>>()
|
||||||
{
|
{
|
||||||
new KeyValuePair<Message.NSWProvider, string>( Message.NSWProvider.DUDR, "HIS-Nord" ),
|
new KeyValuePair<Message.NSWProvider, string>( Message.NSWProvider.DUDR, "HIS-Nord" ),
|
||||||
new KeyValuePair<Message.NSWProvider, string>(Message.NSWProvider.DBH, "DBH")
|
new KeyValuePair<Message.NSWProvider, string>(Message.NSWProvider.DBH, "DBH")
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -52,11 +52,11 @@ namespace ENI2.EditControls
|
|||||||
|
|
||||||
private void textBoxVisitTransitId_TextChanged(object sender, TextChangedEventArgs e)
|
private void textBoxVisitTransitId_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
{
|
{
|
||||||
this.CheckComplete();
|
this.CheckComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckComplete()
|
private void CheckComplete()
|
||||||
{
|
{
|
||||||
bool isComplete = true;
|
bool isComplete = true;
|
||||||
|
|
||||||
bool isValidId = bsmd.database.Util.IsVisitId(textBoxVisitTransitId.Text) || bsmd.database.Util.IsTransitId(textBoxVisitTransitId.Text);
|
bool isValidId = bsmd.database.Util.IsVisitId(textBoxVisitTransitId.Text) || bsmd.database.Util.IsTransitId(textBoxVisitTransitId.Text);
|
||||||
|
|||||||
@ -38,7 +38,7 @@ namespace ENI2.EditControls
|
|||||||
|
|
||||||
this.EnableOK(false);
|
this.EnableOK(false);
|
||||||
this.locodePoC.PropertyChanged += LocodePoC_PropertyChanged;
|
this.locodePoC.PropertyChanged += LocodePoC_PropertyChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void VisitIdDialog_OKClicked()
|
private void VisitIdDialog_OKClicked()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -430,10 +430,14 @@ namespace ENI2.Excel
|
|||||||
STAT stat = statMessage.Elements[0] as STAT;
|
STAT stat = statMessage.Elements[0] as STAT;
|
||||||
stat.ShipName = reader.ReadCellAsText("ship", "C8");
|
stat.ShipName = reader.ReadCellAsText("ship", "C8");
|
||||||
stat.CallSign = reader.ReadCellAsText("ship", "C9");
|
stat.CallSign = reader.ReadCellAsText("ship", "C9");
|
||||||
core.IMO = reader.ReadCellAsText("ship", "C10");
|
|
||||||
core.ENI = reader.ReadCellAsText("ship", "C11");
|
// diese Felder werden bei der Id-Anlage gesetzt und sollten nicht mehr überschrieben
|
||||||
core.PoC = reader.ReadCellAsText("port message", "C8");
|
// werden können (jenseits mit Admin-Berechtigungen in der Overview)
|
||||||
DBManager.Instance.Save(core);
|
// core.IMO = reader.ReadCellAsText("ship", "C10");
|
||||||
|
// core.ENI = reader.ReadCellAsText("ship", "C11");
|
||||||
|
// core.PoC = reader.ReadCellAsText("port message", "C8");
|
||||||
|
// DBManager.Instance.Save(core);
|
||||||
|
|
||||||
stat.MMSINumber = reader.ReadCellAsText("ship", "C12");
|
stat.MMSINumber = reader.ReadCellAsText("ship", "C12");
|
||||||
stat.Flag = reader.ReadCellAsText("ship", "C13");
|
stat.Flag = reader.ReadCellAsText("ship", "C13");
|
||||||
stat.LengthOverall_MTR = reader.ReadCellAsDecimal("ship", "C14");
|
stat.LengthOverall_MTR = reader.ReadCellAsDecimal("ship", "C14");
|
||||||
@ -1233,21 +1237,21 @@ namespace ENI2.Excel
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static byte? ParseGender(string gender)
|
internal static byte? ParseGender(string gender)
|
||||||
{
|
{
|
||||||
byte? result = null;
|
byte? result = null;
|
||||||
if(!gender.IsNullOrEmpty())
|
if(!gender.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
if (gender.Equals("male", StringComparison.OrdinalIgnoreCase)) result = 1;
|
if (gender.Equals("male", StringComparison.OrdinalIgnoreCase) || gender.Equals("m", StringComparison.OrdinalIgnoreCase)) result = 1;
|
||||||
if (gender.Equals("female", StringComparison.OrdinalIgnoreCase)) result = 2;
|
if (gender.Equals("female", StringComparison.OrdinalIgnoreCase) || gender.Equals("f", StringComparison.OrdinalIgnoreCase)) result = 2;
|
||||||
if (gender.Equals("not_applicable", StringComparison.OrdinalIgnoreCase)) result = 9;
|
if (gender.Equals("not_applicable", StringComparison.OrdinalIgnoreCase) || gender.Equals("not applicable", StringComparison.OrdinalIgnoreCase) || gender.Equals("n", StringComparison.OrdinalIgnoreCase)) result = 9;
|
||||||
if (gender.Equals("not_known", StringComparison.OrdinalIgnoreCase)) result = 0;
|
if (gender.Equals("not_known", StringComparison.OrdinalIgnoreCase) || gender.Equals("not known", StringComparison.OrdinalIgnoreCase)) result = 0;
|
||||||
if (gender.Equals("other", StringComparison.OrdinalIgnoreCase)) result = 9;
|
if (gender.Equals("other", StringComparison.OrdinalIgnoreCase) || gender.Equals("d", StringComparison.OrdinalIgnoreCase) || gender.Equals("diverse", StringComparison.OrdinalIgnoreCase)) result = 9;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static byte? ParseDocumentType(string docType)
|
internal static byte? ParseDocumentType(string docType)
|
||||||
{
|
{
|
||||||
byte? result = null;
|
byte? result = null;
|
||||||
if(!docType.IsNullOrEmpty())
|
if(!docType.IsNullOrEmpty())
|
||||||
|
|||||||
@ -4,10 +4,6 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using Microsoft.Office.Interop.Excel;
|
using Microsoft.Office.Interop.Excel;
|
||||||
|
|
||||||
@ -21,7 +17,7 @@ namespace ENI2.Excel
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static class ExcelComparer
|
public static class ExcelComparer
|
||||||
{
|
{
|
||||||
private static int diffColor = ColorTranslator.ToOle(Color.FromArgb(150, 150, 255)); // blue
|
private static readonly int diffColor = ColorTranslator.ToOle(Color.FromArgb(150, 150, 255)); // blue
|
||||||
|
|
||||||
private static bool GetSheetRange(Worksheet sheet, out int lastUsedRow, out int lastUsedColumn)
|
private static bool GetSheetRange(Worksheet sheet, out int lastUsedRow, out int lastUsedColumn)
|
||||||
{
|
{
|
||||||
@ -65,17 +61,16 @@ namespace ENI2.Excel
|
|||||||
return columnName;
|
return columnName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string Compare(string sourcePath, string targetPath, out string errorMessage)
|
public static string Compare(string sourcePath, string targetPath, string comparisonFileName, out string errorMessage)
|
||||||
{
|
{
|
||||||
string fileName = Path.GetTempPath() + Guid.NewGuid().ToString() + ".xlsx";
|
|
||||||
errorMessage = "";
|
errorMessage = "";
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
File.Copy(targetPath, fileName);
|
File.Copy(targetPath, comparisonFileName);
|
||||||
ExcelReader source = new ExcelReader(sourcePath, true, false);
|
ExcelReader source = new ExcelReader(sourcePath, true, false);
|
||||||
ExcelReader comparison = new ExcelReader(fileName, false, false);
|
ExcelReader comparison = new ExcelReader(comparisonFileName, false, false);
|
||||||
|
|
||||||
/* erste Variante Vergleich über Namen der Zellen
|
/* erste Variante Vergleich über Namen der Zellen
|
||||||
|
|
||||||
@ -186,7 +181,9 @@ namespace ENI2.Excel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
comparison.Save(fileName);
|
comparison.Save(comparisonFileName);
|
||||||
|
source.Dispose();
|
||||||
|
comparison.Dispose();
|
||||||
errorMessage = string.Format("{0} differences found", counter);
|
errorMessage = string.Format("{0} differences found", counter);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -194,7 +191,7 @@ namespace ENI2.Excel
|
|||||||
errorMessage = ex.Message;
|
errorMessage = ex.Message;
|
||||||
}
|
}
|
||||||
|
|
||||||
return fileName;
|
return comparisonFileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -146,8 +146,7 @@ namespace ENI2.Excel
|
|||||||
result = 2;
|
result = 2;
|
||||||
}
|
}
|
||||||
else if (val.Equals("n", StringComparison.CurrentCultureIgnoreCase) ||
|
else if (val.Equals("n", StringComparison.CurrentCultureIgnoreCase) ||
|
||||||
val.Equals("not applicable", StringComparison.CurrentCultureIgnoreCase) ||
|
val.Equals("not applicable", StringComparison.CurrentCultureIgnoreCase) ||
|
||||||
val.Equals("not_applicable", StringComparison.CurrentCultureIgnoreCase) ||
|
|
||||||
val.Equals("d", StringComparison.CurrentCultureIgnoreCase) ||
|
val.Equals("d", StringComparison.CurrentCultureIgnoreCase) ||
|
||||||
val.Equals("diverse", StringComparison.CurrentCultureIgnoreCase))
|
val.Equals("diverse", StringComparison.CurrentCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
@ -629,8 +628,8 @@ namespace ENI2.Excel
|
|||||||
{
|
{
|
||||||
if (boolString.Equals("TRUE", StringComparison.OrdinalIgnoreCase)) return true;
|
if (boolString.Equals("TRUE", StringComparison.OrdinalIgnoreCase)) return true;
|
||||||
if (boolString.Equals("FALSE", StringComparison.OrdinalIgnoreCase)) return false;
|
if (boolString.Equals("FALSE", StringComparison.OrdinalIgnoreCase)) return false;
|
||||||
if (boolString.Equals("YES", StringComparison.OrdinalIgnoreCase)) return true;
|
if (boolString.Equals("YES", StringComparison.OrdinalIgnoreCase) || boolString.Equals("Y", StringComparison.OrdinalIgnoreCase)) return true;
|
||||||
if (boolString.Equals("NO", StringComparison.OrdinalIgnoreCase)) return false;
|
if (boolString.Equals("NO", StringComparison.OrdinalIgnoreCase) || boolString.Equals("N", StringComparison.OrdinalIgnoreCase)) return false;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else return null;
|
else return null;
|
||||||
|
|||||||
@ -14,6 +14,7 @@ using System.Reflection;
|
|||||||
using log4net;
|
using log4net;
|
||||||
using bsmd.database;
|
using bsmd.database;
|
||||||
using ENI2.Locode;
|
using ENI2.Locode;
|
||||||
|
using ENI2.EditControls;
|
||||||
|
|
||||||
namespace ENI2.Excel
|
namespace ENI2.Excel
|
||||||
{
|
{
|
||||||
@ -21,6 +22,11 @@ namespace ENI2.Excel
|
|||||||
{
|
{
|
||||||
private static readonly ILog _log = LogManager.GetLogger(typeof(ExcelUtil));
|
private static readonly ILog _log = LogManager.GetLogger(typeof(ExcelUtil));
|
||||||
|
|
||||||
|
private static readonly Dictionary<string, string> _countryImportDict = new Dictionary<string, string>();
|
||||||
|
private static readonly Dictionary<string, string> _genderImportDict = new Dictionary<string, string>();
|
||||||
|
private static readonly Dictionary<string, string> _documentTypeImportDict = new Dictionary<string, string>();
|
||||||
|
private static readonly Dictionary<string, string> _locodeImportDict = new Dictionary<string, string>();
|
||||||
|
|
||||||
#region Process Sheet (normal BSMD sheet import)
|
#region Process Sheet (normal BSMD sheet import)
|
||||||
|
|
||||||
internal static bool ProcessSheet(ExcelReader reader, out string readMessage, MessageCore messageCore, List<Message.NotificationClass> notificationClasses)
|
internal static bool ProcessSheet(ExcelReader reader, out string readMessage, MessageCore messageCore, List<Message.NotificationClass> notificationClasses)
|
||||||
@ -2055,61 +2061,59 @@ namespace ENI2.Excel
|
|||||||
private static bool ScanCREW(Message crewMessage, ExcelReader reader, bool isOldVersion)
|
private static bool ScanCREW(Message crewMessage, ExcelReader reader, bool isOldVersion)
|
||||||
{
|
{
|
||||||
crewMessage.DeleteElements();
|
crewMessage.DeleteElements();
|
||||||
|
string sheetTitle = "6. CREW - Arrival";
|
||||||
|
// 6. CREW - Arrival
|
||||||
|
// 5.9.22: Changed this area to work like reading from a Dakosy Sheet (by values in rows, not cell names)
|
||||||
|
|
||||||
bool? notificationSchengen = reader.ReadBoolean("CREW.NotificationSchengen");
|
bool? notificationSchengen = reader.ReadBoolean("CREW.NotificationSchengen");
|
||||||
bool? notificationPax = reader.ReadBoolean("CREW.NotificationPAX");
|
bool? notificationPax = reader.ReadBoolean("CREW.NotificationPAX");
|
||||||
|
|
||||||
for (int i = 0; i < crewMessage.NumberOfExcelRows; i++)
|
for (int i = 0; i < 5000; i++)
|
||||||
{
|
{
|
||||||
string crewLastName = string.Format("CREW.CrewMemberLastName_{0}", i + 1);
|
|
||||||
string crewFirstName = string.Format("CREW.CrewMemberFirstName_{0}", i + 1);
|
|
||||||
string crewGender = string.Format("CREW.CrewMemberGender_{0}", i + 1);
|
|
||||||
string crewNationality = string.Format("CREW.CrewMemberNationality_{0}", i + 1);
|
|
||||||
string crewDuty = string.Format("CREW.CrewMemberDuty_{0}", i + 1);
|
|
||||||
string crewPlaceOfBirth = string.Format("CREW.CrewMemberPlaceOfBirth_{0}", i + 1);
|
|
||||||
string crewDateOfBirth = string.Format("CREW.CrewMemberDateOfBirth_{0}", i + 1);
|
|
||||||
string crewIdentDocType = string.Format("CREW.CrewMemberIdentityDocumentType_{0}", i + 1);
|
|
||||||
string crewIdentDocId = string.Format("CREW.CrewMemberIdentityDocumentId_{0}", i + 1);
|
|
||||||
string crewVisaNo = string.Format("CREW.CrewMemberVisaNumber_{0}", i + 1);
|
|
||||||
string crewIssuing = string.Format("CREW.CrewMemberIdentityDocumentIssuingState_{0}", i + 1);
|
|
||||||
string crewIdentDocExpiry = string.Format("CREW.CrewmemberIdentityDocumentExpiryDate_{0}", i + 1);
|
|
||||||
string crewCountryOfBirth = string.Format("CREW.CountryOfBirth_{0}", i + 1);
|
|
||||||
string crewEffects = string.Format("CREW.Effects_{0}", i + 1);
|
|
||||||
|
|
||||||
string lastName = reader.ReadText(crewLastName);
|
string lastName = reader.ReadCellAsText(sheetTitle, string.Format("C{0}", i + 18));
|
||||||
string firstName = reader.ReadText(crewFirstName);
|
string firstName = reader.ReadCellAsText(sheetTitle, string.Format("D{0}", i + 18));
|
||||||
|
if (lastName.IsNullOrEmpty() && firstName.IsNullOrEmpty()) break;
|
||||||
|
|
||||||
if (!lastName.IsNullOrEmpty() || !firstName.IsNullOrEmpty())
|
if (!(crewMessage.GetSublistElementWithIdentifier((i + 1).ToString()) is CREW crew))
|
||||||
{
|
{
|
||||||
if (!(crewMessage.GetSublistElementWithIdentifier((i + 1).ToString()) is CREW crew))
|
crew = new CREW();
|
||||||
{
|
crew.Identifier = (i + 1).ToString();
|
||||||
crew = new CREW();
|
crew.MessageHeader = crewMessage;
|
||||||
crew.Identifier = (i + 1).ToString();
|
crewMessage.Elements.Add(crew);
|
||||||
crew.MessageHeader = crewMessage;
|
|
||||||
crewMessage.Elements.Add(crew);
|
|
||||||
}
|
|
||||||
|
|
||||||
crew.NotificationSchengen = notificationSchengen;
|
|
||||||
crew.NotificationPAX = notificationPax;
|
|
||||||
crew.CrewMemberLastName = lastName;
|
|
||||||
crew.CrewMemberFirstName = firstName;
|
|
||||||
crew.CrewMemberGender = reader.ReadGender(crewGender);
|
|
||||||
crew.CrewMemberDuty = reader.ReadText(crewDuty);
|
|
||||||
crew.CrewMemberNationality = reader.ReadNationality(crewNationality);
|
|
||||||
crew.CrewMemberPlaceOfBirth = reader.ReadText(crewPlaceOfBirth);
|
|
||||||
crew.CrewMemberDateOfBirth = reader.ReadBirthDate(crewDateOfBirth);
|
|
||||||
crew.CrewMemberIdentityDocumentType = reader.ReadIdentityDocumentType(crewIdentDocType);
|
|
||||||
crew.CrewMemberIdentityDocumentId = reader.ReadText(crewIdentDocId);
|
|
||||||
crew.CrewMemberVisaNumber = reader.ReadText(crewVisaNo);
|
|
||||||
crew.CrewMemberIdentityDocumentIssuingState = reader.ReadNationality(crewIssuing);
|
|
||||||
if (crew.CrewMemberIdentityDocumentIssuingState.IsNullOrEmpty() && isOldVersion)
|
|
||||||
crew.CrewMemberIdentityDocumentIssuingState = "XX";
|
|
||||||
crew.CrewMemberIdentityDocumentExpiryDate = reader.ReadDate(crewIdentDocExpiry);
|
|
||||||
if (!crew.CrewMemberIdentityDocumentExpiryDate.HasValue && isOldVersion)
|
|
||||||
crew.CrewMemberIdentityDocumentExpiryDate = new DateTime(2100, 12, 31);
|
|
||||||
crew.CrewMemberCountryOfBirth = reader.ReadNationality(crewCountryOfBirth);
|
|
||||||
crew.Effects = reader.ReadText(crewEffects);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
crew.NotificationSchengen = notificationSchengen;
|
||||||
|
crew.NotificationPAX = notificationPax;
|
||||||
|
crew.CrewMemberLastName = lastName;
|
||||||
|
crew.CrewMemberFirstName = firstName;
|
||||||
|
|
||||||
|
crew.CrewMemberGender = ReadGender(reader.ReadCellAsText(sheetTitle, string.Format("E{0}", i + 18)), out bool canceled);
|
||||||
|
if (canceled) return true;
|
||||||
|
|
||||||
|
crew.CrewMemberDuty = reader.ReadCellAsText(sheetTitle, string.Format("F{0}", i + 18));
|
||||||
|
crew.CrewMemberNationality = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("G{0}", i + 18)), out canceled);
|
||||||
|
if (canceled) return true;
|
||||||
|
crew.CrewMemberPlaceOfBirth = reader.ReadCellAsText(sheetTitle, string.Format("H{0}", i + 18));
|
||||||
|
crew.CrewMemberCountryOfBirth = reader.ReadCellAsText(sheetTitle, string.Format("G{0}", i + 18));
|
||||||
|
crew.CrewMemberDateOfBirth = reader.ReadCellAsDateTime(sheetTitle, string.Format("J{0}", i + 18));
|
||||||
|
|
||||||
|
crew.CrewMemberIdentityDocumentType = ReadDocumentType(reader.ReadCellAsText(sheetTitle, string.Format("K{0}", i + 18)), out canceled);
|
||||||
|
if (canceled) return true;
|
||||||
|
|
||||||
|
crew.CrewMemberIdentityDocumentId = reader.ReadCellAsText(sheetTitle, string.Format("L{0}", i + 18));
|
||||||
|
crew.CrewMemberVisaNumber = reader.ReadCellAsText(sheetTitle, string.Format("O{0}", i + 18));
|
||||||
|
crew.CrewMemberIdentityDocumentIssuingState = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("M{0}", i + 18)), out canceled);
|
||||||
|
if (canceled) return true;
|
||||||
|
if (crew.CrewMemberIdentityDocumentIssuingState.IsNullOrEmpty() && isOldVersion)
|
||||||
|
crew.CrewMemberIdentityDocumentIssuingState = "XX";
|
||||||
|
crew.CrewMemberIdentityDocumentExpiryDate = reader.ReadCellAsDateTime(sheetTitle, string.Format("N{0}", i + 18));
|
||||||
|
if (!crew.CrewMemberIdentityDocumentExpiryDate.HasValue && isOldVersion)
|
||||||
|
crew.CrewMemberIdentityDocumentExpiryDate = new DateTime(2100, 12, 31);
|
||||||
|
|
||||||
|
crew.Effects = reader.ReadCellAsText("2. PORT", string.Format("C{0}", i + 142));
|
||||||
|
|
||||||
|
Util.UIHelper.SetBusyState(); // dialog might reset busy state
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -2118,56 +2122,56 @@ namespace ENI2.Excel
|
|||||||
private static bool ScanCREWD(Message crewdMessage, ExcelReader reader)
|
private static bool ScanCREWD(Message crewdMessage, ExcelReader reader)
|
||||||
{
|
{
|
||||||
crewdMessage.DeleteElements();
|
crewdMessage.DeleteElements();
|
||||||
|
string sheetTitle = "7. CREW - Departure";
|
||||||
// CREW DEPARTURE
|
// CREW DEPARTURE
|
||||||
|
|
||||||
bool? notificationSchengen = reader.ReadBoolean("CREWD.NotificationSchengen");
|
bool? notificationSchengen = reader.ReadBoolean("CREWD.NotificationSchengen");
|
||||||
bool? notificationPax = reader.ReadBoolean("CREWD.NotificationPAX");
|
bool? notificationPax = reader.ReadBoolean("CREWD.NotificationPAX");
|
||||||
|
|
||||||
for (int i = 0; i < crewdMessage.NumberOfExcelRows; i++)
|
for (int i = 0; i < 5000; i++)
|
||||||
{
|
{
|
||||||
string crewLastName = string.Format("CREWD.CrewMemberLastName_{0}", i + 1);
|
|
||||||
string crewFirstName = string.Format("CREWD.CrewMemberFirstName_{0}", i + 1);
|
|
||||||
string crewGender = string.Format("CREWD.CrewMemberGender_{0}", i + 1);
|
|
||||||
string crewNationality = string.Format("CREWD.CrewMemberNationality_{0}", i + 1);
|
|
||||||
string crewDuty = string.Format("CREWD.CrewMemberDuty_{0}", i + 1);
|
|
||||||
string crewPlaceOfBirth = string.Format("CREWD.CrewMemberPlaceOfBirth_{0}", i + 1);
|
|
||||||
string crewDateOfBirth = string.Format("CREWD.CrewMemberDateOfBirth_{0}", i + 1);
|
|
||||||
string crewIdentDocType = string.Format("CREWD.CrewMemberIdentityDocumentType_{0}", i + 1);
|
|
||||||
string crewIdentDocId = string.Format("CREWD.CrewMemberIdentityDocumentId_{0}", i + 1);
|
|
||||||
string crewVisaNo = string.Format("CREWD.CrewMemberVisaNumber_{0}", i + 1);
|
|
||||||
string crewIssuing = string.Format("CREWD.CrewMemberIdentityDocumentIssuingState_{0}", i + 1);
|
|
||||||
string crewIdentDocExpiry = string.Format("CREWD.CrewmemberIdentityDocumentExpiryDate_{0}", i + 1);
|
|
||||||
string crewCountryOfBirth = string.Format("CREWD.CountryOfBirth_{0}", i + 1);
|
|
||||||
|
|
||||||
string lastName = reader.ReadText(crewLastName);
|
string lastName = reader.ReadCellAsText(sheetTitle, string.Format("C{0}", i + 18));
|
||||||
if (!lastName.IsNullOrEmpty())
|
if (lastName.IsNullOrEmpty()) break;
|
||||||
|
|
||||||
|
if (!(crewdMessage.GetSublistElementWithIdentifier((i + 1).ToString()) is CREWD crewd))
|
||||||
{
|
{
|
||||||
if (!(crewdMessage.GetSublistElementWithIdentifier((i + 1).ToString()) is CREWD crew))
|
crewd = new CREWD();
|
||||||
{
|
crewd.Identifier = (i + 1).ToString();
|
||||||
crew = new CREWD();
|
crewd.MessageHeader = crewdMessage;
|
||||||
crew.IsDeparture = true;
|
crewdMessage.Elements.Add(crewd);
|
||||||
crew.Identifier = (i + 1).ToString();
|
|
||||||
crew.MessageHeader = crewdMessage;
|
|
||||||
crewdMessage.Elements.Add(crew);
|
|
||||||
}
|
|
||||||
|
|
||||||
crew.IsDeparture = true;
|
|
||||||
crew.NotificationSchengen = notificationSchengen;
|
|
||||||
crew.NotificationPAX = notificationPax;
|
|
||||||
crew.CrewMemberLastName = lastName;
|
|
||||||
crew.CrewMemberFirstName = reader.ReadText(crewFirstName);
|
|
||||||
crew.CrewMemberGender = reader.ReadGender(crewGender);
|
|
||||||
crew.CrewMemberDuty = reader.ReadText(crewDuty);
|
|
||||||
crew.CrewMemberNationality = reader.ReadNationality(crewNationality);
|
|
||||||
crew.CrewMemberPlaceOfBirth = reader.ReadText(crewPlaceOfBirth);
|
|
||||||
crew.CrewMemberDateOfBirth = reader.ReadBirthDate(crewDateOfBirth);
|
|
||||||
crew.CrewMemberIdentityDocumentType = reader.ReadIdentityDocumentType(crewIdentDocType);
|
|
||||||
crew.CrewMemberIdentityDocumentId = reader.ReadText(crewIdentDocId);
|
|
||||||
crew.CrewMemberVisaNumber = reader.ReadText(crewVisaNo);
|
|
||||||
crew.CrewMemberIdentityDocumentIssuingState = reader.ReadNationality(crewIssuing);
|
|
||||||
crew.CrewMemberIdentityDocumentExpiryDate = reader.ReadDate(crewIdentDocExpiry);
|
|
||||||
crew.CrewMemberCountryOfBirth = reader.ReadNationality(crewCountryOfBirth);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
crewd.NotificationSchengen = notificationSchengen;
|
||||||
|
crewd.NotificationPAX = notificationPax;
|
||||||
|
crewd.CrewMemberLastName = lastName;
|
||||||
|
crewd.CrewMemberFirstName = reader.ReadCellAsText(sheetTitle, string.Format("D{0}", i + 18));
|
||||||
|
|
||||||
|
crewd.CrewMemberGender = ReadGender(reader.ReadCellAsText(sheetTitle, string.Format("E{0}", i + 18)), out bool canceled);
|
||||||
|
if (canceled) return true;
|
||||||
|
|
||||||
|
crewd.CrewMemberDuty = reader.ReadCellAsText(sheetTitle, string.Format("F{0}", i + 18));
|
||||||
|
crewd.CrewMemberNationality = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("G{0}", i + 18)), out canceled);
|
||||||
|
if (canceled) return true;
|
||||||
|
crewd.CrewMemberPlaceOfBirth = reader.ReadCellAsText(sheetTitle, string.Format("H{0}", i + 18));
|
||||||
|
crewd.CrewMemberCountryOfBirth = reader.ReadCellAsText(sheetTitle, string.Format("G{0}", i + 18));
|
||||||
|
crewd.CrewMemberDateOfBirth = reader.ReadCellAsDateTime(sheetTitle, string.Format("J{0}", i + 18));
|
||||||
|
|
||||||
|
|
||||||
|
crewd.CrewMemberIdentityDocumentType = ReadDocumentType(reader.ReadCellAsText(sheetTitle, string.Format("K{0}", i + 18)), out canceled);
|
||||||
|
if (canceled) return true;
|
||||||
|
|
||||||
|
crewd.CrewMemberIdentityDocumentId = reader.ReadCellAsText(sheetTitle, string.Format("L{0}", i + 18));
|
||||||
|
crewd.CrewMemberVisaNumber = reader.ReadCellAsText(sheetTitle, string.Format("O{0}", i + 18));
|
||||||
|
crewd.CrewMemberIdentityDocumentIssuingState = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("M{0}", i + 18)), out canceled);
|
||||||
|
if (canceled) return true;
|
||||||
|
if (crewd.CrewMemberIdentityDocumentIssuingState.IsNullOrEmpty())
|
||||||
|
crewd.CrewMemberIdentityDocumentIssuingState = "XX";
|
||||||
|
crewd.CrewMemberIdentityDocumentExpiryDate = reader.ReadCellAsDateTime(sheetTitle, string.Format("N{0}", i + 18));
|
||||||
|
if (!crewd.CrewMemberIdentityDocumentExpiryDate.HasValue)
|
||||||
|
crewd.CrewMemberIdentityDocumentExpiryDate = new DateTime(2100, 12, 31);
|
||||||
|
|
||||||
|
crewd.Effects = reader.ReadCellAsText("2. PORT", string.Format("C{0}", i + 142));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -2178,71 +2182,73 @@ namespace ENI2.Excel
|
|||||||
|
|
||||||
private static bool ScanPAS(Message pasMessage, ExcelReader reader, bool isOldVersion)
|
private static bool ScanPAS(Message pasMessage, ExcelReader reader, bool isOldVersion)
|
||||||
{
|
{
|
||||||
pasMessage.DeleteElements();
|
|
||||||
|
List<PAS> newPasList = new List<PAS>();
|
||||||
|
|
||||||
|
string sheetTitle = "8. PAX - Arrival";
|
||||||
|
|
||||||
bool? notificationSchengen = reader.ReadBoolean("PAS.NotificationSchengen");
|
bool? notificationSchengen = reader.ReadBoolean("PAS.NotificationSchengen");
|
||||||
bool? notificationPax = reader.ReadBoolean("PAS.NotificationPAX");
|
bool? notificationPax = reader.ReadBoolean("PAS.NotificationPAX");
|
||||||
|
|
||||||
for (int i = 0; i < pasMessage.NumberOfExcelRows; i++)
|
for (int i = 0; i < 5000; i++)
|
||||||
{
|
{
|
||||||
string pasLastName = string.Format("PAS.PassengerLastName_{0}", i + 1);
|
|
||||||
string pasFirstName = string.Format("PAS.PassengerFirstName_{0}", i + 1);
|
|
||||||
string pasGender = string.Format("PAS.PassengerGender_{0}", i + 1);
|
|
||||||
string pasNationality = string.Format("PAS.PassengerNationality_{0}", i + 1);
|
|
||||||
string pasEmbarkation = string.Format("PAS.PassengerPortOfEmbarkation_{0}", i + 1);
|
|
||||||
string pasDebarkation = string.Format("PAS.PassengerPortOfDisembarkation_{0}", i + 1);
|
|
||||||
string pasTransit = string.Format("PAS.PassengerInTransit_{0}", i + 1);
|
|
||||||
string pasPlaceOfBirth = string.Format("PAS.PassengerPlaceOfBirth_{0}", i + 1);
|
|
||||||
string pasDateOfBirth = string.Format("PAS.PassengerDateOfBirth_{0}", i + 1);
|
|
||||||
string pasIdentDocType = string.Format("PAS.PassengerIdentityDocumentType_{0}", i + 1);
|
|
||||||
string pasIdentDocId = string.Format("PAS.PassengerIdentityDocumentId_{0}", i + 1);
|
|
||||||
string pasVisaNo = string.Format("PAS.PassengerVisaNumber_{0}", i + 1);
|
|
||||||
string pasIssuing = string.Format("PAS.PassengerIdentityDocumentIssuingState_{0}", i + 1);
|
|
||||||
string pasExpiryDate = string.Format("PAS.PassengerIdentityDocumentExpiryDate_{0}", i + 1);
|
|
||||||
string pasCountryOfBirth = string.Format("PAS.CountryOfBirth_{0}", i + 1);
|
|
||||||
string pasEmergencyCare = string.Format("PAS.EmergencyCare_{0}", i + 1);
|
|
||||||
string pasEmergencyContact = string.Format("PAS.EmergencyContactNumber_{0}", i + 1);
|
|
||||||
|
|
||||||
string lastName = reader.ReadText(pasLastName);
|
string lastName = reader.ReadCellAsText(sheetTitle, string.Format("C{0}", i + 17));
|
||||||
string firstName = reader.ReadText(pasFirstName);
|
string firstName = reader.ReadCellAsText(sheetTitle, string.Format("D{0}", i + 17));
|
||||||
|
if (lastName.IsNullOrEmpty() && firstName.IsNullOrEmpty()) break; // finish after reading last row
|
||||||
|
|
||||||
|
DateTime? dateOfBirth = reader.ReadCellAsDateTime(sheetTitle, string.Format("L{0}", i + 17));
|
||||||
|
PAS pas = new PAS();
|
||||||
|
pas.Identifier = (i + 1).ToString();
|
||||||
|
pas.MessageHeader = pasMessage;
|
||||||
|
newPasList.Add(pas);
|
||||||
|
|
||||||
if (!lastName.IsNullOrEmpty() || !firstName.IsNullOrEmpty())
|
pas.NotificationSchengen = notificationSchengen;
|
||||||
{
|
pas.NotificationPAX = notificationPax;
|
||||||
if (!(pasMessage.GetSublistElementWithIdentifier((i + 1).ToString()) is PAS pas))
|
pas.PassengerLastName = lastName;
|
||||||
{
|
pas.PassengerFirstName = firstName;
|
||||||
pas = new PAS();
|
|
||||||
pas.Identifier = (i + 1).ToString();
|
pas.PassengerNationality = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("I{0}", i + 17)), out bool canceled);
|
||||||
pas.MessageHeader = pasMessage;
|
if (canceled) return true;
|
||||||
pasMessage.Elements.Add(pas);
|
pas.PassengerIdentityDocumentIssuingState = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("O{0}", i + 17)), out canceled);
|
||||||
}
|
if (canceled) return true;
|
||||||
|
if (pas.PassengerIdentityDocumentIssuingState == null) return true;
|
||||||
|
|
||||||
|
pas.PassengerGender = ReadGender(reader.ReadCellAsText(sheetTitle, string.Format("E{0}", i + 17)), out canceled);
|
||||||
|
if (canceled) return true;
|
||||||
|
pas.PassengerPortOfEmbarkation = ReadLocode(reader.ReadCellAsText(sheetTitle, string.Format("F{0}", i + 17)), out canceled);
|
||||||
|
if (canceled) return true;
|
||||||
|
pas.PassengerPortOfDisembarkation = ReadLocode(reader.ReadCellAsText(sheetTitle, string.Format("G{0}", i + 17)), out canceled);
|
||||||
|
if (canceled) return true;
|
||||||
|
|
||||||
|
pas.PassengerInTransit = reader.ReadCellAsBool(sheetTitle, string.Format("H{0}", i + 17));
|
||||||
|
|
||||||
|
pas.PassengerPlaceOfBirth = reader.ReadCellAsText(sheetTitle, string.Format("J{0}", i + 17));
|
||||||
|
pas.PassengerCountryOfBirth = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("K{0}", i + 17)), out canceled);
|
||||||
|
if (canceled) return true;
|
||||||
|
pas.PassengerDateOfBirth = dateOfBirth;
|
||||||
|
|
||||||
|
pas.PassengerIdentityDocumentType = ReadDocumentType(reader.ReadCellAsText(sheetTitle, string.Format("M{0}", i + 17)), out canceled);
|
||||||
|
if (canceled) return true;
|
||||||
|
pas.PassengerIdentityDocumentId = reader.ReadCellAsText(sheetTitle, string.Format("N{0}", i + 17));
|
||||||
|
|
||||||
|
pas.PassengerIdentityDocumentExpiryDate = reader.ReadCellAsDateTime(sheetTitle, string.Format("P{0}", i + 17));
|
||||||
|
if(!pas.PassengerIdentityDocumentExpiryDate.HasValue)
|
||||||
|
pas.PassengerIdentityDocumentExpiryDate = new DateTime(2100, 12, 31);
|
||||||
|
|
||||||
|
pas.PassengerVisaNumber = reader.ReadCellAsText(sheetTitle, string.Format("Q{0}", i + 17));
|
||||||
|
pas.EmergencyCare = reader.ReadCellAsText(sheetTitle, string.Format("R{0}", i + 17));
|
||||||
|
pas.EmergencyContactNumber = reader.ReadCellAsText(sheetTitle, string.Format("S{0}", i + 17));
|
||||||
|
|
||||||
|
Util.UIHelper.SetBusyState(); // dialog might reset busy state
|
||||||
|
|
||||||
pas.NotificationSchengen = notificationSchengen;
|
|
||||||
pas.NotificationPAX = notificationPax;
|
|
||||||
pas.PassengerLastName = lastName;
|
|
||||||
pas.PassengerFirstName = firstName;
|
|
||||||
pas.PassengerGender = reader.ReadGender(pasGender);
|
|
||||||
pas.PassengerNationality = reader.ReadNationality(pasNationality);
|
|
||||||
// TODO: Nicht klar ob hier LOCODEs kommen oder nicht
|
|
||||||
pas.PassengerPortOfEmbarkation = reader.ReadLoCode(pasEmbarkation);
|
|
||||||
pas.PassengerPortOfDisembarkation = reader.ReadLoCode(pasDebarkation);
|
|
||||||
pas.PassengerInTransit = reader.ReadBoolean(pasTransit);
|
|
||||||
pas.PassengerPlaceOfBirth = reader.ReadText(pasPlaceOfBirth);
|
|
||||||
pas.PassengerDateOfBirth = reader.ReadBirthDate(pasDateOfBirth);
|
|
||||||
pas.PassengerIdentityDocumentType = reader.ReadIdentityDocumentType(pasIdentDocType);
|
|
||||||
pas.PassengerIdentityDocumentId = reader.ReadText(pasIdentDocId);
|
|
||||||
pas.PassengerVisaNumber = reader.ReadText(pasVisaNo);
|
|
||||||
pas.PassengerIdentityDocumentIssuingState = reader.ReadNationality(pasIssuing);
|
|
||||||
if (pas.PassengerIdentityDocumentIssuingState.IsNullOrEmpty() && isOldVersion)
|
|
||||||
pas.PassengerIdentityDocumentIssuingState = "XX";
|
|
||||||
pas.PassengerIdentityDocumentExpiryDate = reader.ReadDate(pasExpiryDate);
|
|
||||||
if (!pas.PassengerIdentityDocumentExpiryDate.HasValue && isOldVersion)
|
|
||||||
pas.PassengerIdentityDocumentExpiryDate = new DateTime(2100, 12, 31);
|
|
||||||
pas.PassengerCountryOfBirth = reader.ReadNationality(pasCountryOfBirth);
|
|
||||||
pas.EmergencyCare = reader.ReadText(pasEmergencyCare);
|
|
||||||
pas.EmergencyContactNumber = reader.ReadText(pasEmergencyContact);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DBManager.Instance.DeleteAllPASForMessage(pasMessage.Id);
|
||||||
|
pasMessage.Elements.Clear();
|
||||||
|
foreach (PAS pas in newPasList)
|
||||||
|
pasMessage.Elements.Add(pas);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2292,21 +2298,23 @@ namespace ENI2.Excel
|
|||||||
pas.IsDeparture = true;
|
pas.IsDeparture = true;
|
||||||
pas.NotificationSchengen = notificationSchengen;
|
pas.NotificationSchengen = notificationSchengen;
|
||||||
pas.NotificationPAX = notificationPax;
|
pas.NotificationPAX = notificationPax;
|
||||||
pas.PassengerLastName = lastName;
|
pas.PassengerLastName = lastName;
|
||||||
pas.PassengerFirstName = reader.ReadText(pasFirstName);
|
pas.PassengerFirstName = reader.ReadText(pasFirstName);
|
||||||
pas.PassengerGender = reader.ReadGender(pasGender);
|
pas.PassengerGender = reader.ReadGender(pasGender);
|
||||||
pas.PassengerNationality = reader.ReadNationality(pasNationality);
|
pas.PassengerNationality = reader.ReadNationality(pasNationality);
|
||||||
// TODO: Nicht klar ob hier LOCODEs kommen oder nicht
|
|
||||||
pas.PassengerPortOfEmbarkation = reader.ReadTextNoWhitespace(pasEmbarkation);
|
pas.PassengerPortOfEmbarkation = reader.ReadTextNoWhitespace(pasEmbarkation);
|
||||||
pas.PassengerPortOfDisembarkation = reader.ReadTextNoWhitespace(pasDebarkation);
|
pas.PassengerPortOfDisembarkation = reader.ReadTextNoWhitespace(pasDebarkation);
|
||||||
pas.PassengerInTransit = reader.ReadBoolean(pasTransit);
|
pas.PassengerInTransit = reader.ReadBoolean(pasTransit);
|
||||||
pas.PassengerPlaceOfBirth = reader.ReadText(pasPlaceOfBirth);
|
pas.PassengerPlaceOfBirth = reader.ReadText(pasPlaceOfBirth);
|
||||||
pas.PassengerDateOfBirth = reader.ReadBirthDate(pasDateOfBirth);
|
pas.PassengerDateOfBirth = reader.ReadBirthDate(pasDateOfBirth);
|
||||||
pas.PassengerIdentityDocumentType = reader.ReadIdentityDocumentType(pasIdentDocType);
|
pas.PassengerIdentityDocumentType = reader.ReadIdentityDocumentType(pasIdentDocType);
|
||||||
pas.PassengerIdentityDocumentId = reader.ReadText(pasIdentDocId);
|
pas.PassengerIdentityDocumentId = reader.ReadText(pasIdentDocId);
|
||||||
pas.PassengerVisaNumber = reader.ReadText(pasVisaNo);
|
pas.PassengerVisaNumber = reader.ReadText(pasVisaNo);
|
||||||
pas.PassengerIdentityDocumentIssuingState = reader.ReadNationality(pasIssuing);
|
pas.PassengerIdentityDocumentIssuingState = reader.ReadNationality(pasIssuing);
|
||||||
pas.PassengerIdentityDocumentExpiryDate = reader.ReadDate(pasExpiryDate);
|
pas.PassengerIdentityDocumentExpiryDate = reader.ReadDate(pasExpiryDate);
|
||||||
|
if (!pas.PassengerIdentityDocumentExpiryDate.HasValue)
|
||||||
|
pas.PassengerIdentityDocumentExpiryDate = new DateTime(2100, 12, 31);
|
||||||
pas.PassengerCountryOfBirth = reader.ReadNationality(pasCountryOfBirth);
|
pas.PassengerCountryOfBirth = reader.ReadNationality(pasCountryOfBirth);
|
||||||
pas.EmergencyCare = reader.ReadText(pasEmergencyCare);
|
pas.EmergencyCare = reader.ReadText(pasEmergencyCare);
|
||||||
pas.EmergencyContactNumber = reader.ReadText(pasEmergencyContact);
|
pas.EmergencyContactNumber = reader.ReadText(pasEmergencyContact);
|
||||||
@ -2441,5 +2449,201 @@ namespace ENI2.Excel
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region "Semi-Manual" import functions (may open interactive dialog)
|
||||||
|
|
||||||
|
public static byte? ReadGender(string gender, out bool canceled)
|
||||||
|
{
|
||||||
|
byte? result = DakosyUtil.ParseGender(gender);
|
||||||
|
canceled = false;
|
||||||
|
|
||||||
|
if (!gender.IsNullOrEmpty() && !result.HasValue)
|
||||||
|
{
|
||||||
|
// special treatment / callback
|
||||||
|
if (_genderImportDict.ContainsKey(gender))
|
||||||
|
{
|
||||||
|
result = byte.Parse(_genderImportDict[gender]); // we have mapped this before
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FixImportDialog fid = new FixImportDialog();
|
||||||
|
fid.Value = gender;
|
||||||
|
fid.ValueType = "Gender";
|
||||||
|
fid.SelectionValues = Util.GlobalStructures.GenderDict;
|
||||||
|
if (fid.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!fid.SelectedValue.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
_genderImportDict[gender] = fid.SelectedValue;
|
||||||
|
result = byte.Parse(_genderImportDict[gender]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
canceled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!result.HasValue)
|
||||||
|
{
|
||||||
|
result = 0; // not known
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static byte? ReadDocumentType(string documentType, out bool canceled)
|
||||||
|
{
|
||||||
|
byte? result = DakosyUtil.ParseDocumentType(documentType);
|
||||||
|
canceled = false;
|
||||||
|
|
||||||
|
if (!result.HasValue)
|
||||||
|
{
|
||||||
|
if (documentType.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
result = 5; // OTHER_LEGAL_IDENTITY_DOCUMENT (CH, 17.10.22)
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// special treatment / callback
|
||||||
|
if (_documentTypeImportDict.ContainsKey(documentType))
|
||||||
|
{
|
||||||
|
result = byte.Parse(_documentTypeImportDict[documentType]); // we have mapped this before
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FixImportDialog fid = new FixImportDialog();
|
||||||
|
fid.Value = documentType;
|
||||||
|
fid.ValueType = "Document type";
|
||||||
|
fid.SelectionValues = Util.GlobalStructures.IDDocTypeDict;
|
||||||
|
if (fid.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!fid.SelectedValue.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
_documentTypeImportDict[documentType] = fid.SelectedValue;
|
||||||
|
result = byte.Parse(_documentTypeImportDict[documentType]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
canceled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string ReadNationality(string nationality, out bool canceled)
|
||||||
|
{
|
||||||
|
string result = null;
|
||||||
|
canceled = false;
|
||||||
|
nationality = nationality.Trim();
|
||||||
|
if (nationality.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
result = "XX";
|
||||||
|
}
|
||||||
|
else if(CREW.NationalityDict.ContainsKey(nationality.ToUpper()))
|
||||||
|
{
|
||||||
|
result = nationality.ToUpper();
|
||||||
|
}
|
||||||
|
else if(CREW.NationalityDict.ContainsKey(nationality.ToUpper()))
|
||||||
|
{
|
||||||
|
result = CREW.NationalityDict[nationality.ToUpper()];
|
||||||
|
}
|
||||||
|
else if(_countryImportDict.ContainsKey(nationality))
|
||||||
|
{
|
||||||
|
result = _countryImportDict[nationality];
|
||||||
|
}
|
||||||
|
else // we cannot find whatever this is..
|
||||||
|
{
|
||||||
|
FixImportDialog fid = new FixImportDialog();
|
||||||
|
fid.Value = nationality;
|
||||||
|
fid.ValueType = "Nationality";
|
||||||
|
fid.SelectionValues = CREW.NationalityDict;
|
||||||
|
if(fid.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if(!fid.SelectedValue.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
_countryImportDict[nationality] = fid.SelectedValue;
|
||||||
|
result = fid.SelectedValue.Substring(0,2); // attention manual entry
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
canceled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string ReadLocode(string val, out bool canceled)
|
||||||
|
{
|
||||||
|
string result = null;
|
||||||
|
canceled = false;
|
||||||
|
|
||||||
|
val = val.ToUpper();
|
||||||
|
|
||||||
|
if (val.IsNullOrEmpty()) return "ZZUKN";
|
||||||
|
|
||||||
|
// check if this is a legitimate Locode
|
||||||
|
if (!LocodeDB.LocationNameFromLocode(val).IsNullOrEmpty()) return val;
|
||||||
|
|
||||||
|
// check if it is a port that we already know
|
||||||
|
|
||||||
|
// _log.WarnFormat("unknown Locode {0}", val);
|
||||||
|
// reverse search: if this is a name lookup port code
|
||||||
|
List<string> possibleLocodes = LocodeDB.AllLocodesForCityName(val);
|
||||||
|
|
||||||
|
if(possibleLocodes.Count > 1)
|
||||||
|
{
|
||||||
|
if (!_locodeImportDict.ContainsKey(val))
|
||||||
|
{
|
||||||
|
FixImportDialog fid = new FixImportDialog();
|
||||||
|
fid.Value = val;
|
||||||
|
fid.ValueType = "Locode";
|
||||||
|
Dictionary<string, string> ld = new Dictionary<string, string>();
|
||||||
|
foreach (string locode in possibleLocodes)
|
||||||
|
ld[locode] = locode;
|
||||||
|
fid.SelectionValues = ld;
|
||||||
|
if (fid.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
_locodeImportDict[val] = fid.SelectedValue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
canceled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_locodeImportDict.ContainsKey(val))
|
||||||
|
result = _locodeImportDict[val];
|
||||||
|
}
|
||||||
|
else if(possibleLocodes.Count == 1)
|
||||||
|
{
|
||||||
|
result = possibleLocodes[0];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!_locodeImportDict.ContainsKey(val))
|
||||||
|
{
|
||||||
|
// nothing found, let the user pick a locode by himself
|
||||||
|
FixImportDialog fid = new FixImportDialog();
|
||||||
|
fid.Value = val;
|
||||||
|
fid.ValueType = "Locode";
|
||||||
|
fid.LocodeMode = true;
|
||||||
|
if (fid.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
_locodeImportDict[val] = fid.SelectedValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (_locodeImportDict.ContainsKey(val))
|
||||||
|
result = _locodeImportDict[val];
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,7 +47,7 @@ namespace ENI2
|
|||||||
Dictionary<string, string> result = new Dictionary<string, string>();
|
Dictionary<string, string> result = new Dictionary<string, string>();
|
||||||
string query = string.Format("SELECT Code, PortArea FROM INFO_PortArea WHERE Locode = '{0}' ORDER BY PortArea", locode);
|
string query = string.Format("SELECT Code, PortArea FROM INFO_PortArea WHERE Locode = '{0}' ORDER BY PortArea", locode);
|
||||||
SQLiteCommand cmd = new SQLiteCommand(query, _con);
|
SQLiteCommand cmd = new SQLiteCommand(query, _con);
|
||||||
IDataReader reader = cmd.ExecuteReader();
|
IDataReader reader = cmd.ExecuteReader();
|
||||||
while(reader.Read())
|
while(reader.Read())
|
||||||
{
|
{
|
||||||
string code = null;
|
string code = null;
|
||||||
@ -95,7 +95,7 @@ namespace ENI2
|
|||||||
result[code] = string.Format("{0} {1}", code, name);
|
result[code] = string.Format("{0} {1}", code, name);
|
||||||
}
|
}
|
||||||
reader.Close();
|
reader.Close();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Dictionary<string, string> getVesselTypes()
|
public static Dictionary<string, string> getVesselTypes()
|
||||||
@ -236,7 +236,7 @@ namespace ENI2
|
|||||||
}
|
}
|
||||||
reader.Close();
|
reader.Close();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<LocodeDB.LocodeEntry> SSNAllLocodesForCityNameAsEntries(string city)
|
public static List<LocodeDB.LocodeEntry> SSNAllLocodesForCityNameAsEntries(string city)
|
||||||
{
|
{
|
||||||
@ -251,7 +251,7 @@ namespace ENI2
|
|||||||
if (!reader.IsDBNull(0) && !reader.IsDBNull(1))
|
if (!reader.IsDBNull(0) && !reader.IsDBNull(1))
|
||||||
{
|
{
|
||||||
LocodeDB.LocodeEntry entry = new LocodeDB.LocodeEntry();
|
LocodeDB.LocodeEntry entry = new LocodeDB.LocodeEntry();
|
||||||
entry.Locode = reader.GetString(0);
|
entry.Locode = reader.GetString(0);
|
||||||
entry.Name = reader.GetString(1);
|
entry.Name = reader.GetString(1);
|
||||||
results.Add(entry);
|
results.Add(entry);
|
||||||
}
|
}
|
||||||
@ -260,5 +260,14 @@ namespace ENI2
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<HAZPosTemplate> LoadHAZTemplates()
|
||||||
|
{
|
||||||
|
SQLiteCommand cmd = new SQLiteCommand(HAZPosTemplate.GetQuery(), _con);
|
||||||
|
IDataReader reader = cmd.ExecuteReader();
|
||||||
|
List<HAZPosTemplate> result = HAZPosTemplate.LoadList(reader);
|
||||||
|
reader.Close();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
9
ENI2/Properties/Resources.Designer.cs
generated
9
ENI2/Properties/Resources.Designer.cs
generated
@ -3309,6 +3309,15 @@ namespace ENI2.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to New dangerous goods item.
|
||||||
|
/// </summary>
|
||||||
|
public static string textNewDGItem {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("textNewDGItem", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to New group.
|
/// Looks up a localized string similar to New group.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -1849,4 +1849,7 @@
|
|||||||
<data name="import2" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="import2" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\import2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\import2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="textNewDGItem" xml:space="preserve">
|
||||||
|
<value>New dangerous goods item</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@ -2,8 +2,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace ENI2.Util
|
namespace ENI2.Util
|
||||||
{
|
{
|
||||||
@ -14,7 +12,7 @@ namespace ENI2.Util
|
|||||||
var nAttributes = eValue.GetType().GetField(eValue.ToString()).GetCustomAttributes(typeof(DescriptionAttribute), false);
|
var nAttributes = eValue.GetType().GetField(eValue.ToString()).GetCustomAttributes(typeof(DescriptionAttribute), false);
|
||||||
if (nAttributes.Any())
|
if (nAttributes.Any())
|
||||||
return (nAttributes.First() as DescriptionAttribute).Description;
|
return (nAttributes.First() as DescriptionAttribute).Description;
|
||||||
return eValue.ToString();
|
return eValue.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IEnumerable<KeyValuePair<string, string>> GetAllValuesAndDescription(Type t)
|
public static IEnumerable<KeyValuePair<string, string>> GetAllValuesAndDescription(Type t)
|
||||||
|
|||||||
@ -12,24 +12,24 @@ using ENI2.Locode;
|
|||||||
namespace ENI2.Util
|
namespace ENI2.Util
|
||||||
{
|
{
|
||||||
static class GlobalStructures
|
static class GlobalStructures
|
||||||
{
|
{
|
||||||
|
|
||||||
public static string[] GenderList =
|
public static Dictionary<string, string> GenderDict = new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
Properties.Resources.textNotKnown,
|
{ "0", Properties.Resources.textNotKnown },
|
||||||
Properties.Resources.textMale,
|
{ "1", Properties.Resources.textMale },
|
||||||
Properties.Resources.textFemale,
|
{ "2", Properties.Resources.textFemale },
|
||||||
Properties.Resources.textNotApplicable
|
{ "9", Properties.Resources.textNotApplicable }
|
||||||
};
|
};
|
||||||
|
|
||||||
public static string[] IDDocTypeList =
|
public static Dictionary<string, string> IDDocTypeDict = new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
Properties.Resources.textIdentityCard,
|
{ "0", Properties.Resources.textIdentityCard },
|
||||||
Properties.Resources.textPassport,
|
{ "1", Properties.Resources.textPassport },
|
||||||
Properties.Resources.textMusterBook,
|
{ "2", Properties.Resources.textMusterBook },
|
||||||
Properties.Resources.textPhotoId,
|
{ "3", Properties.Resources.textPhotoId },
|
||||||
Properties.Resources.textResidencePermit,
|
{ "4", Properties.Resources.textResidencePermit },
|
||||||
Properties.Resources.textOtherLegalIdentityDocument
|
{ "5", Properties.Resources.textOtherLegalIdentityDocument }
|
||||||
};
|
};
|
||||||
|
|
||||||
public static byte[] ShipSecurityLevels = { 1, 2, 3 };
|
public static byte[] ShipSecurityLevels = { 1, 2, 3 };
|
||||||
|
|||||||
22
SQL/Optimization_Indices.sql
Normal file
22
SQL/Optimization_Indices.sql
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
-- Some indices added during database optimization (Aug 22)
|
||||||
|
|
||||||
|
CREATE NONCLUSTERED INDEX IX_WAS_ID_WASTE ON [dbo].[Waste] ([WASId])
|
||||||
|
|
||||||
|
USE [nsw]
|
||||||
|
GO
|
||||||
|
|
||||||
|
SET ANSI_PADDING ON
|
||||||
|
GO
|
||||||
|
|
||||||
|
/****** Object: Index [IX_Visit_Transit_Core] Script Date: 25.08.2022 09:21:34 ******/
|
||||||
|
CREATE NONCLUSTERED INDEX [IX_Visit_Transit_Core] ON [dbo].[MessageCore]
|
||||||
|
(
|
||||||
|
[VisitId] ASC,
|
||||||
|
[TransitId] ASC
|
||||||
|
)
|
||||||
|
INCLUDE ( [QueryNSWStatus]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CREATE NONCLUSTERED INDEX IX_NOT_CLASS_MH ON [dbo].[MessageHeader] ([NotificationClass])
|
||||||
@ -14,7 +14,7 @@ using System.Collections.Generic;
|
|||||||
|
|
||||||
namespace bsmd.database
|
namespace bsmd.database
|
||||||
{
|
{
|
||||||
public class CREW : DatabaseEntity, ISublistElement
|
public class CREW : DatabaseEntity, ISublistElement, IBulkSaver
|
||||||
{
|
{
|
||||||
|
|
||||||
public CREW()
|
public CREW()
|
||||||
@ -272,6 +272,112 @@ namespace bsmd.database
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Validation
|
||||||
|
|
||||||
|
public override void Validate(List<MessageError> errors, List<MessageViolation> violations)
|
||||||
|
{
|
||||||
|
if (this.CrewMemberIdentityDocumentType.HasValue)
|
||||||
|
{
|
||||||
|
if (this.CrewMemberIdentityDocumentType.Value == 5)
|
||||||
|
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Doc. type set to OTHER_LEGAL_IDENTITY_DOCUMENT", null, this.Title, this.Identifier, this.Tablename));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.CrewMemberIdentityDocumentIssuingState != null)
|
||||||
|
{
|
||||||
|
if (this.CrewMemberIdentityDocumentIssuingState.Equals("XX"))
|
||||||
|
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Id. doc issuing state set to XX", null, this.Title, this.Identifier, this.Tablename));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.CrewMemberNationality != null)
|
||||||
|
{
|
||||||
|
if (this.CrewMemberNationality.Equals("XX"))
|
||||||
|
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Nationality set to XX", null, this.Title, this.Identifier, this.Tablename));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.CrewMemberIdentityDocumentExpiryDate.HasValue)
|
||||||
|
{
|
||||||
|
if (this.CrewMemberIdentityDocumentExpiryDate.Equals(new DateTime(2100, 12, 31)))
|
||||||
|
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Id doc expiry date set to 31/12/2100", null, this.Title, this.Identifier, this.Tablename));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.CrewMemberGender.HasValue)
|
||||||
|
{
|
||||||
|
if (this.CrewMemberGender == 0)
|
||||||
|
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Gender set to unknown", null, this.Title, this.Identifier, this.Tablename));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region IBulkSaver implementation
|
||||||
|
|
||||||
|
public DataTable PrepareBulkInsert(List<DatabaseEntity> databaseEntities)
|
||||||
|
{
|
||||||
|
DataTable result = new DataTable();
|
||||||
|
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "MessageHeaderId", DataType = MessageHeader.Id.GetType() });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "CrewMemberLastName", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "CrewMemberFirstName", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "CrewMemberPlaceOfBirth", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "CrewMemberDateOfBirth", DataType = typeof(DateTime), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "CrewMemberGender", DataType = typeof(byte), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "CrewMemberNationality", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "CrewMemberIdentityDocumentType", DataType = typeof(byte), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "CrewMemberIdentityDocumentId", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "CrewMemberVisaNumber", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "CrewMemberDuty", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "Identifier", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "IsDeparture", DataType = typeof(bool), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "CrewMemberIdentityDocumentIssuingState", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "CrewMemberIdentityDocumentExpiryDate", DataType = typeof(DateTime), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "NotificationSchengen", DataType = typeof(bool), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "NotificationPAX", DataType = typeof(bool), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "CrewMemberCountryOfBirth", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "Effects", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
|
||||||
|
foreach (CREW crew in databaseEntities)
|
||||||
|
{
|
||||||
|
DataRow row = result.NewRow();
|
||||||
|
row[0] = crew.MessageHeader.Id;
|
||||||
|
row[1] = crew.CrewMemberLastName ?? (object)DBNull.Value;
|
||||||
|
row[2] = crew.CrewMemberFirstName ?? (object)DBNull.Value;
|
||||||
|
row[3] = crew.CrewMemberPlaceOfBirth ?? (object)DBNull.Value;
|
||||||
|
row[4] = crew.CrewMemberDateOfBirth ?? (object)DBNull.Value;
|
||||||
|
row[5] = crew.CrewMemberGender ?? (object)DBNull.Value;
|
||||||
|
row[6] = crew.CrewMemberNationality?.Substring(0,2) ?? (object)DBNull.Value;
|
||||||
|
row[7] = crew.CrewMemberIdentityDocumentType ?? (object)DBNull.Value;
|
||||||
|
row[8] = crew.CrewMemberIdentityDocumentId ?? (object)DBNull.Value;
|
||||||
|
row[9] = crew.CrewMemberVisaNumber ?? (object)DBNull.Value;
|
||||||
|
row[10] = crew.CrewMemberDuty ?? (object)DBNull.Value;
|
||||||
|
row[11] = crew.Identifier ?? (object)DBNull.Value;
|
||||||
|
row[12] = crew.IsDeparture;
|
||||||
|
row[13] = crew.CrewMemberIdentityDocumentIssuingState?.Substring(0,2) ?? (object)DBNull.Value;
|
||||||
|
row[14] = crew.CrewMemberIdentityDocumentExpiryDate ?? (object)DBNull.Value;
|
||||||
|
row[15] = crew.NotificationSchengen ?? (object)DBNull.Value;
|
||||||
|
row[16] = crew.NotificationPAX ?? (object)DBNull.Value;
|
||||||
|
if (crew.CrewMemberCountryOfBirth == null)
|
||||||
|
{
|
||||||
|
row[17] = DBNull.Value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (crew.CrewMemberCountryOfBirth.Length > 2)
|
||||||
|
row[17] = crew.CrewMemberCountryOfBirth.Substring(0, 2);
|
||||||
|
else
|
||||||
|
row[17] = crew.CrewMemberCountryOfBirth;
|
||||||
|
}
|
||||||
|
row[18] = crew.Effects ?? (object)DBNull.Value;
|
||||||
|
result.Rows.Add(row);
|
||||||
|
}
|
||||||
|
|
||||||
|
result.TableName = this.tablename;
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region CREWD
|
#region CREWD
|
||||||
|
|||||||
@ -729,6 +729,18 @@ namespace bsmd.database
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void DeleteAllPASForMessage(Guid? id)
|
||||||
|
{
|
||||||
|
if (!id.HasValue) return;
|
||||||
|
using (SqlCommand cmd = new SqlCommand())
|
||||||
|
{
|
||||||
|
cmd.CommandText = "DELETE FROM PAS WHERE MessageHeaderId = @MESSAGEHEADERID";
|
||||||
|
cmd.Parameters.AddWithValue("@MESSAGEHEADERID", id);
|
||||||
|
int numDel = this.PerformNonQuery(cmd);
|
||||||
|
_log.InfoFormat("Deleted all elements ({0}) from PAS message", numDel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region internal/private funcs
|
#region internal/private funcs
|
||||||
@ -1611,7 +1623,7 @@ namespace bsmd.database
|
|||||||
bulkCopy.WriteToServer(table);
|
bulkCopy.WriteToServer(table);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
136
bsmd.database/HAZPosTemplate.cs
Normal file
136
bsmd.database/HAZPosTemplate.cs
Normal file
@ -0,0 +1,136 @@
|
|||||||
|
// Copyright (c) 2020-present schick Informatik
|
||||||
|
// Description: Container for HAZA subclass templates
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
|
||||||
|
namespace bsmd.database
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Container for a dangerous goods template description which is imported from SQLite / Excel DB
|
||||||
|
/// Instances of this class will be offered to users as templates and respective DG entries created on them:
|
||||||
|
/// IGC, IMSBC, IBC and MARPOL (not! IMDG)
|
||||||
|
/// </summary>
|
||||||
|
public class HAZPosTemplate
|
||||||
|
{
|
||||||
|
|
||||||
|
#region enums
|
||||||
|
|
||||||
|
public enum SublistType
|
||||||
|
{
|
||||||
|
IBC,
|
||||||
|
IGC,
|
||||||
|
IMSBC,
|
||||||
|
MARPOL
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Properties
|
||||||
|
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
public byte? Hazard { get; set; }
|
||||||
|
|
||||||
|
public byte? Flashpoint { get; set; }
|
||||||
|
|
||||||
|
public bool? SpecRef15_19 { get; set; }
|
||||||
|
|
||||||
|
public bool? MHB { get; set; }
|
||||||
|
|
||||||
|
public byte? IMSBC_HAZ { get; set; }
|
||||||
|
|
||||||
|
public string UNNr { get; set; }
|
||||||
|
|
||||||
|
public string IMOClass { get; set; }
|
||||||
|
|
||||||
|
public string Comment { get; set; }
|
||||||
|
|
||||||
|
public SublistType TemplateType { get; set; }
|
||||||
|
|
||||||
|
public byte? PollutionCategory { get; set; }
|
||||||
|
|
||||||
|
public string FP_IBC { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region static storage helper classes
|
||||||
|
|
||||||
|
public static string GetQuery()
|
||||||
|
{
|
||||||
|
return "SELECT Beschreibung, HAZARD_ENUM, FP_ENUM, \"15.19?\", Typ, MHB, IMSBC_HAZ, \"UN-Nr.\", \"IMO-Cl.\", POLLUTION_CATEGORY_ENUM, Bemerkung, FP_IBC FROM GEFAHRGUTLISTE ORDER BY Beschreibung";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<HAZPosTemplate> LoadList(IDataReader reader)
|
||||||
|
{
|
||||||
|
List<HAZPosTemplate> result = new List<HAZPosTemplate>();
|
||||||
|
|
||||||
|
while(reader.Read())
|
||||||
|
{
|
||||||
|
if (reader.IsDBNull(4)) continue; // this row has no type -> ignore
|
||||||
|
HAZPosTemplate hpt = new HAZPosTemplate();
|
||||||
|
hpt.Description = reader.GetString(0);
|
||||||
|
if (!reader.IsDBNull(1))
|
||||||
|
hpt.Hazard = (byte) reader.GetByte(1);
|
||||||
|
if (!reader.IsDBNull(2))
|
||||||
|
hpt.Flashpoint = (byte) reader.GetByte(2);
|
||||||
|
if (!reader.IsDBNull(3))
|
||||||
|
{
|
||||||
|
string specRefString = reader.GetString(3);
|
||||||
|
if (specRefString.Equals("JA", StringComparison.OrdinalIgnoreCase) || specRefString.Equals("Yes", StringComparison.OrdinalIgnoreCase)) hpt.SpecRef15_19 = true;
|
||||||
|
if (specRefString.Equals("NEIN", StringComparison.OrdinalIgnoreCase) || specRefString.Equals("No", StringComparison.OrdinalIgnoreCase)) hpt.SpecRef15_19 = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
string type = reader.GetString(4);
|
||||||
|
switch(type)
|
||||||
|
{
|
||||||
|
case "IBC": hpt.TemplateType = SublistType.IBC; break;
|
||||||
|
case "IGC": hpt.TemplateType = SublistType.IGC; break;
|
||||||
|
case "IMSBC": hpt.TemplateType = SublistType.IMSBC ; break;
|
||||||
|
case "MARPOL": hpt.TemplateType = SublistType.MARPOL; break;
|
||||||
|
default:
|
||||||
|
continue; // ignore this thing
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!reader.IsDBNull(5))
|
||||||
|
{
|
||||||
|
string mhbstring = reader.GetString(5);
|
||||||
|
if (mhbstring.Equals("y", StringComparison.OrdinalIgnoreCase))
|
||||||
|
hpt.MHB = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!reader.IsDBNull(6))
|
||||||
|
hpt.IMSBC_HAZ = (byte)reader.GetByte(6);
|
||||||
|
if (!reader.IsDBNull(7))
|
||||||
|
hpt.UNNr = reader.GetString(7);
|
||||||
|
if(!reader.IsDBNull(8))
|
||||||
|
hpt.IMOClass = reader.GetString(8);
|
||||||
|
if (!reader.IsDBNull(9))
|
||||||
|
hpt.PollutionCategory = (byte)reader.GetByte(9);
|
||||||
|
if (!reader.IsDBNull(10))
|
||||||
|
hpt.Comment = reader.GetString(10);
|
||||||
|
if (!reader.IsDBNull(11))
|
||||||
|
hpt.FP_IBC = reader.GetString(11);
|
||||||
|
|
||||||
|
result.Add(hpt);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region overrides
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
if (this.Description.Length > 75)
|
||||||
|
return string.Format("{0}...", this.Description.Substring(0, 75));
|
||||||
|
return Description;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,8 +1,5 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
using System.Data;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace bsmd.database
|
namespace bsmd.database
|
||||||
{
|
{
|
||||||
@ -50,4 +47,9 @@ namespace bsmd.database
|
|||||||
string Identifier { get; set; }
|
string Identifier { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface IBulkSaver
|
||||||
|
{
|
||||||
|
DataTable PrepareBulkInsert(List<DatabaseEntity> databaseEntities);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -125,7 +125,7 @@ namespace bsmd.database
|
|||||||
// create table columns
|
// create table columns
|
||||||
foreach (PropertyInfo p in properties)
|
foreach (PropertyInfo p in properties)
|
||||||
{
|
{
|
||||||
if (!(p.CanRead && p.CanWrite)) continue;
|
if (!(p.CanRead && p.CanWrite)) continue;
|
||||||
Type propType = p.PropertyType;
|
Type propType = p.PropertyType;
|
||||||
DataColumn dc = new DataColumn();
|
DataColumn dc = new DataColumn();
|
||||||
dc.ColumnName = p.Name;
|
dc.ColumnName = p.Name;
|
||||||
|
|||||||
@ -692,12 +692,19 @@ namespace bsmd.database
|
|||||||
|
|
||||||
public void SaveElements()
|
public void SaveElements()
|
||||||
{
|
{
|
||||||
foreach (DatabaseEntity dbEntity in this.Elements)
|
if (CanDoBulkSave())
|
||||||
{
|
{
|
||||||
DBManager.Instance.Save(dbEntity);
|
this.BulkSaveElements();
|
||||||
if (dbEntity is ISublistContainer sublistContainer)
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (DatabaseEntity dbEntity in this.Elements)
|
||||||
{
|
{
|
||||||
(sublistContainer).SaveElements();
|
DBManager.Instance.Save(dbEntity);
|
||||||
|
if (dbEntity is ISublistContainer sublistContainer)
|
||||||
|
{
|
||||||
|
sublistContainer.SaveElements();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -857,7 +864,7 @@ namespace bsmd.database
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region IComparable implementation
|
#region IComparable implementation
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -903,6 +910,39 @@ namespace bsmd.database
|
|||||||
else this.Flags &= (int)~flag;
|
else this.Flags &= (int)~flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bulk save is actually bulk insert and can only be done for certain
|
||||||
|
/// message classes where bulk save is implemented
|
||||||
|
/// </summary>
|
||||||
|
private bool CanDoBulkSave()
|
||||||
|
{
|
||||||
|
if(this.MessageNotificationClass == NotificationClass.CREW ||
|
||||||
|
this.MessageNotificationClass == NotificationClass.CREWD ||
|
||||||
|
this.MessageNotificationClass == NotificationClass.PAS ||
|
||||||
|
this.MessageNotificationClass == NotificationClass.PASD)
|
||||||
|
{
|
||||||
|
foreach (DatabaseEntity subEntity in this.Elements)
|
||||||
|
if (!subEntity.IsNew)
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BulkSaveElements()
|
||||||
|
{
|
||||||
|
if (this.Elements.Count == 0) return; // NOP
|
||||||
|
if(this.Elements[0] is IBulkSaver ibs)
|
||||||
|
{
|
||||||
|
DataTable dt = ibs.PrepareBulkInsert(new List<DatabaseEntity>(this.Elements));
|
||||||
|
DBManager.Instance.PerformBulkInsert(dt);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("bulk save called on classes that do not support it");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,14 +14,18 @@ using System.Collections.Generic;
|
|||||||
|
|
||||||
namespace bsmd.database
|
namespace bsmd.database
|
||||||
{
|
{
|
||||||
public class PAS : DatabaseEntity, ISublistElement
|
public class PAS : DatabaseEntity, ISublistElement, IBulkSaver
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#region Construction
|
||||||
|
|
||||||
public PAS()
|
public PAS()
|
||||||
{
|
{
|
||||||
this.tablename = "[dbo].[PAS]";
|
this.tablename = "[dbo].[PAS]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
@ -314,19 +318,117 @@ namespace bsmd.database
|
|||||||
|
|
||||||
public override void Validate(List<MessageError> errors, List<MessageViolation> violations)
|
public override void Validate(List<MessageError> errors, List<MessageViolation> violations)
|
||||||
{
|
{
|
||||||
/* Nach RM Christin / Trello vom 27.11.17 auskommentiert
|
// /* Nach RM Christin / Trello vom 27.11.17 auskommentiert
|
||||||
|
// und heute (19.10.22) wieder einkommentiert
|
||||||
|
|
||||||
if (this.PassengerPortOfDisembarkation != null)
|
if (this.PassengerPortOfDisembarkation != null)
|
||||||
{
|
{
|
||||||
if (this.PassengerPortOfDisembarkation.Equals("ZZUKN"))
|
if (this.PassengerPortOfDisembarkation.Equals("ZZUKN"))
|
||||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.NOT_NULL, "PassengerPortOfDisembarkation", null, this.Title, this.Identifier, this.Tablename));
|
violations.Add(RuleEngine.CreateViolation(ValidationCode.NOT_NULL, "Port of disembarkation set to ZZUKN", null, this.Title, this.Identifier, this.Tablename));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.PassengerPortOfEmbarkation != null)
|
if (this.PassengerPortOfEmbarkation != null)
|
||||||
{
|
{
|
||||||
if (this.PassengerPortOfEmbarkation.Equals("ZZUKN"))
|
if (this.PassengerPortOfEmbarkation.Equals("ZZUKN"))
|
||||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.NOT_NULL, "PassengerPortOfEmbarkation", null, this.Title, this.Identifier, this.Tablename));
|
violations.Add(RuleEngine.CreateViolation(ValidationCode.NOT_NULL, "Port of embarkation set to ZZUKN", null, this.Title, this.Identifier, this.Tablename));
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
if(this.PassengerIdentityDocumentType.HasValue)
|
||||||
|
{
|
||||||
|
if(this.PassengerIdentityDocumentType.Value == 5)
|
||||||
|
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Doc. type set to OTHER_LEGAL_IDENTITY_DOCUMENT", null, this.Title, this.Identifier, this.Tablename));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.PassengerNationality != null)
|
||||||
|
{
|
||||||
|
if (this.PassengerNationality.Equals("XX"))
|
||||||
|
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Nationality set to XX", null, this.Title, this.Identifier, this.Tablename));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.PassengerIdentityDocumentIssuingState != null)
|
||||||
|
{
|
||||||
|
if (this.PassengerIdentityDocumentIssuingState.Equals("XX"))
|
||||||
|
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Id. doc issuing state set to XX", null, this.Title, this.Identifier, this.Tablename));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.PassengerIdentityDocumentExpiryDate.HasValue)
|
||||||
|
{
|
||||||
|
if(this.PassengerIdentityDocumentExpiryDate.Equals(new DateTime(2100, 12, 31)))
|
||||||
|
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Id doc expiry date set to 31/12/2100", null, this.Title, this.Identifier, this.Tablename));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.PassengerGender.HasValue)
|
||||||
|
{
|
||||||
|
if(this.PassengerGender == 0)
|
||||||
|
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Gender set to unknown", null, this.Title, this.Identifier, this.Tablename));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region IBulkSaver implementation
|
||||||
|
|
||||||
|
public DataTable PrepareBulkInsert(List<DatabaseEntity> databaseEntities)
|
||||||
|
{
|
||||||
|
DataTable result = new DataTable();
|
||||||
|
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "MessageHeaderId", DataType = MessageHeader.Id.GetType() });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "PassengerLastName", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "PassengerFirstName", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "PassengerPlaceOfBirth", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "PassengerDateOfBirth", DataType = typeof(DateTime), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "PassengerGender", DataType = typeof(byte), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "PassengerNationality", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "PassengerIdentityDocumentType", DataType = typeof(byte), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "PassengerIdentityDocumentId", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "PassengerVisaNumber", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "PassengerPortOfEmbarkation", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "PassengerPortOfDisembarkation", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "PassengerInTransit", DataType = typeof(bool), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "Identifier", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "IsDeparture", DataType = typeof(bool), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "PassengerIdentityDocumentIssuingState", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "PassengerIdentityDocumentExpiryDate", DataType = typeof(DateTime), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "NotificationSchengen", DataType = typeof(bool), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "NotificationPAX", DataType = typeof(bool), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "EmergencyCare", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "EmergencyContactNumber", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
result.Columns.Add(new DataColumn { ColumnName = "PassengerCountryOfBirth", DataType = typeof(string), AllowDBNull = true });
|
||||||
|
|
||||||
|
foreach (PAS pas in databaseEntities)
|
||||||
|
{
|
||||||
|
DataRow row = result.NewRow();
|
||||||
|
|
||||||
|
row[0] = pas.MessageHeader.Id;
|
||||||
|
row[1] = pas.PassengerLastName ?? (object)DBNull.Value;
|
||||||
|
row[2] = pas.PassengerFirstName ?? (object)DBNull.Value;
|
||||||
|
row[3] = pas.PassengerPlaceOfBirth ?? (object)DBNull.Value;
|
||||||
|
row[4] = pas.PassengerDateOfBirth ?? (object)DBNull.Value;
|
||||||
|
row[5] = pas.PassengerGender ?? (object)DBNull.Value;
|
||||||
|
row[6] = pas.PassengerNationality ?? (object)DBNull.Value;
|
||||||
|
row[7] = pas.PassengerIdentityDocumentType ?? (object)DBNull.Value;
|
||||||
|
row[8] = pas.PassengerIdentityDocumentId ?? (object)DBNull.Value;
|
||||||
|
row[9] = pas.PassengerVisaNumber ?? (object)DBNull.Value;
|
||||||
|
row[10] = pas.PassengerPortOfEmbarkation ?? (object)DBNull.Value;
|
||||||
|
row[11] = pas.PassengerPortOfDisembarkation ?? (object)DBNull.Value;
|
||||||
|
row[12] = pas.PassengerInTransit ?? (object)DBNull.Value;
|
||||||
|
row[13] = pas.Identifier ?? (object)DBNull.Value;
|
||||||
|
row[14] = pas.IsDeparture;
|
||||||
|
row[15] = pas.PassengerIdentityDocumentIssuingState ?? (object)DBNull.Value;
|
||||||
|
row[16] = pas.PassengerIdentityDocumentExpiryDate ?? (object)DBNull.Value;
|
||||||
|
row[17] = pas.NotificationSchengen ?? (object)DBNull.Value;
|
||||||
|
row[18] = pas.NotificationPAX ?? (object)DBNull.Value;
|
||||||
|
row[19] = pas.EmergencyCare ?? (object)DBNull.Value;
|
||||||
|
row[20] = pas.EmergencyContactNumber ?? (object)DBNull.Value;
|
||||||
|
row[21] = pas.PassengerCountryOfBirth ?? (object)DBNull.Value;
|
||||||
|
|
||||||
|
result.Rows.Add(row);
|
||||||
|
}
|
||||||
|
|
||||||
|
result.TableName = this.tablename;
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@ -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.4.0")]
|
[assembly: AssemblyInformationalVersion("7.5.0")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2014-2022 schick Informatik")]
|
[assembly: AssemblyCopyright("Copyright © 2014-2022 schick Informatik")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyVersion("7.4.0.*")]
|
[assembly: AssemblyVersion("7.5.0.*")]
|
||||||
|
|
||||||
|
|||||||
@ -271,6 +271,12 @@ namespace bsmd.database
|
|||||||
|
|
||||||
if (this.WasteAmountGeneratedTillNextPort_MTQ > 10000)
|
if (this.WasteAmountGeneratedTillNextPort_MTQ > 10000)
|
||||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Waste generated till next port", null, this.Title, this.Identifier, this.Tablename));
|
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Waste generated till next port", null, this.Title, this.Identifier, this.Tablename));
|
||||||
|
|
||||||
|
if(this.WasteDisposalAmount_MTQ > this.WasteCapacity_MTQ)
|
||||||
|
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Disposal greater than capacity!", null, this.Title, this.Identifier, this.Tablename));
|
||||||
|
|
||||||
|
if((this.WasteAmountGeneratedTillNextPort_MTQ + this.WasteAmountRetained_MTQ) > this.WasteCapacity_MTQ)
|
||||||
|
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Waste generated+retained greater than capacity!", null, this.Title, this.Identifier, this.Tablename));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@ -113,6 +113,7 @@
|
|||||||
<Compile Include="Customer.cs" />
|
<Compile Include="Customer.cs" />
|
||||||
<Compile Include="Extensions.cs" />
|
<Compile Include="Extensions.cs" />
|
||||||
<Compile Include="HAZ.cs" />
|
<Compile Include="HAZ.cs" />
|
||||||
|
<Compile Include="HAZPosTemplate.cs" />
|
||||||
<Compile Include="IBCPosition.cs" />
|
<Compile Include="IBCPosition.cs" />
|
||||||
<Compile Include="IDatabaseEntity.cs" />
|
<Compile Include="IDatabaseEntity.cs" />
|
||||||
<Compile Include="IGCPosition.cs" />
|
<Compile Include="IGCPosition.cs" />
|
||||||
|
|||||||
294
misc/GEFAHRGUTLISTE.csv
Normal file
294
misc/GEFAHRGUTLISTE.csv
Normal file
@ -0,0 +1,294 @@
|
|||||||
|
Beschreibung;Gefahr;HAZARD_ENUM;FP;FP_ENUM;15.19?;Typ;IMSBC;MHB;IMSBC_MHB;Group;IMSBC_HAZ;UN-Nr.;IMO-Cl.;IBC;POLLUTION_CATEGORY_ENUM;MARPOL;IGC;FP_IBC;Bemerkung
|
||||||
|
1,3 Pentadiene / Piperylene;P;0;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Acetic acid ;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
Acetic acid glacial;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
Acetone ;;;<60°C;2;Nein;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
Acrylonitrile (ACN) ;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Alcoholic beverages, n.o.s. (Wine);;;;; ;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
Alkanes (C6-C9);;;>60°C;1;Ja;IBC;;;;;;;;x (X);0;;;;
|
||||||
|
n-Alkanens (C10+) ;;;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Alkylate;;;<60°C;2; ;MARPOL;;;;;;;;;;x;;6;
|
||||||
|
alpha-Methylstyrene ;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Ammonia aqueous (28% or less);S/P;2;NF;0;Ja;IBC;;;;;;;;x (Y);1;;;NF;
|
||||||
|
Ammonia / Anhydrous / Ammoniak;;;;; ;IGC;;;;;;1005;2.3;;;;x;;
|
||||||
|
Ammoniak Liquid 24,5% ;S/P;2;;;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Ammonium Nitrate Fertilizer ;;;;; ;IMSBC;x;;;B;1;2067;5.1;;;;;;
|
||||||
|
Ammonium Nitrate with not more than 0,2% total;;;;; ;IMSBC;x;;;B;1;1942;5.1;;;;;;
|
||||||
|
Ammonium Polyphosphate Solution (APP) ;P;0;>60°C;1;Nein;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
Ammonium Sulphate;;;;; ;;;;;;;;;;;;;;Keine Anmeldung, IMSBC Gruppe C
|
||||||
|
Ammonium nitrate solution (93% or less) ;S/P;2;NF;0;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Aniline ;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Anthracene Oil , ;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (X);0;;;;
|
||||||
|
Anthracite / Coal / Kohle;;;;; ;IMSBC;x;y;;A/B;2;;;;;;;;Gruppe: B (und A)
|
||||||
|
ATRES / RAT / Atmospheric Residues / Residues (petroleum) atmospheric (APS Bottoms Resid A);;;>60°C;1;;MARPOL;;;;;;;;;;x;;;
|
||||||
|
AVGAS / Aviation Gasoline / Flugbenzin;;;;;;MARPOL;;;;;;;;;;x;;;
|
||||||
|
BALED RDF;;;;;;IMSBC;x ;y;;B;1;;;;;;;;
|
||||||
|
Base Oil / Lubricating oil / SN150/ SN500 / SN900 / VISOM 4 / Ultra S4 / Bright Stock / QHVI4 / QHVI8 / VHVI-4 = DISTILLATES (PETROLEUM) / HYDROTREATED HEAVY PARAFFINIC,;;;>60°C;1; ;MARPOL;;;;;;;;;;x;;;
|
||||||
|
Benzene / Benzol;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;-11;
|
||||||
|
Biodiesel / FAME - Fatty acid methyl esters;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Y) ;;;;;
|
||||||
|
Bitumen ;;;>60°C;1;;MARPOL;;;;;;;;;;x;;;
|
||||||
|
Blei in Blöcken / Lead Ingots;;;;;;;;;;;;;;;;;;; kein Gefahrgut! Aussage Herr Jnassen Rhenus Midgard Nordenham (tel. 21.07.2021)
|
||||||
|
Butan;;;;;;IGC;;;;;;1011;2.1;;;;x;;
|
||||||
|
Butene / Buthylen;;;;;;IGC;;;;;;1012;2.1;;;;x;;
|
||||||
|
Butyl acrylate (all isomers);S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Calcined clay / Kalzinierter Ton;;;;; ;;;;;;;;;;;;;;Keine Anmeldung, IMSBC Gruppe C
|
||||||
|
C9 Petroleum Resin;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Calcium Ammonium Nitrate 27% N / CAN (in Big BAG);;;;; ;;;;;;;;;;;;;;Keine Anmeldung lt. Aussage von Wasserschutzpolizeit Hamburg
|
||||||
|
Calcium Ammonium Nitrate 27% N / CAN (in BULK);;;;; ;;;;;;;;;;;;;;Keine Anmeldung, IMSBC Gruppe C
|
||||||
|
Calcium Chloride Solution;P;0;>60°C;1; ;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
CARBON BLACK FEEDSTOCK / D8 / ANTHRACENE OIL;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (X);0;x;;;nach Sicherheitsdatenblatt fragen kann IBC oder Marpol sein
|
||||||
|
Carbon Black Oil Propylene Oxide;;;;;;MARPOL;;;;;;;;;;x;;;
|
||||||
|
Carbon Dioxide;;;;; ;IGC;;;;;;1013;2.2;;;;x;;
|
||||||
|
Caromax 28 ;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (X);0;;;;
|
||||||
|
Caustic potash / Potassium hydroxide solution / Kalilauge ;S/P;2;NF;0;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Caustic soda / Sodium hydroxide solution / Natronlauge;S/P;2;NF;0; Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
China Clay;;;;; ;;;;;;;;;;;;;;Keine Anmeldung lt. Aussage von Herrn Schlicht (S+B) in Absprache mit Wasserschutz
|
||||||
|
Clay / TON;;;;; ;;;;;;;;;;;;;;Keine Anmeldung, IMSBC Gruppe C
|
||||||
|
Chloroform ;S/P;2;NF;0;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Coal Tar ,;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (X);0;;;;
|
||||||
|
Coal Tar Pitch (Flüssig);S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (X);0;;;;
|
||||||
|
Coal Tar Pitch / Steinkohlenteerpech (FEST);;;;;;IMSBC;x;y;;B;1;;;;;;;;
|
||||||
|
Coconut oil ;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
COKE BREEZE / Koksgrus;;;;; ;IMSBC;x;;;;;;;;;;;;"NICHT MHB + KEINE UN-Nummer! Mit UN-Nr. ""0000"" + IMO-class ""1.1"" eingeben + Vermerk: ""UN-no. + IMO-class not available"" (im Jgegis muss es mit ""MHB"" angemeldet werden) - GR. A"
|
||||||
|
Used cooking oil (mit Triglycerides, C16-C18 and C18 unsaturated) ;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Used cooking oil (wenn Triglycerides nicht ausdrücklich ausgewiesen) ;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (X);0;;;;
|
||||||
|
Copper concentrates ;;;;; ;IMSBC;x;;;A;0;3077;9;;;;;;
|
||||||
|
Copper concentrates (Metal Sulphide Concentrates);;;;; ;IMSBC;x;y;;A/B;2;;;;;;;;
|
||||||
|
Corn Oil , ;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Creosete Oil ;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (X);0;;;;
|
||||||
|
Crude Benzene and mixtures having 10% benzene or more ;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Cumene / Isopropylbenzene ;P;0;<60°C;2;Ja;IBC;;;;;;;;x (y);1;;;;
|
||||||
|
Cutterstock / Cutter;;;;; ;MARPOL;;;;;;;;;;x;;;
|
||||||
|
Cyclohexane;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
DDGS Pellets / Dried Distiller Grains with solubles;;;;;;;;;;;;;;;;;;;Keine Anmeldung
|
||||||
|
DINP DIALKYL / Diisononylphthalat;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (X);0;;;;
|
||||||
|
Distillate Hydrocrackers / DHC;;;;; ;MARPOL;;;;;;;;;;x;;;Bottoms Raw marterial for chemical industry Feedingstock for mineral oil industry
|
||||||
|
DIAMMONIUM PHOSPHATE / DAP;;;;; ;;;;;;;;;;;;;;Keine Anmeldung, IMSBC Gruppe C
|
||||||
|
1,1- Dichloroethane;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
DIRECT REDUCED IRON;;;;; ;IMSBC;x;y;;B;1;;;;;;;;
|
||||||
|
"Distillate / D10V / LVG / D8C / D10C / D10JUB / D 600 / D 700 / D 2000
|
||||||
|
";;;;; ;MARPOL;;;;;;;;;;x;;;
|
||||||
|
DOLOMITE;;;;; ;;;;;;;;;;;;;;Keine Anmeldung, IMSBC Gruppe C, evtl. Ist auch Dolomitic quicklime gemeint, Nachfragen
|
||||||
|
Dolomitic quicklime;;;;; ;IMSBC;x;y;;B;1;;;;;;;;
|
||||||
|
Eisen II Sulphat;;;;; ;;;;;;;;;;;;;;Keine Anmeldung, IMSBC Gruppe C
|
||||||
|
Eisensilikat granulat / Iron Silicate Granules;;;;;;;;;;;;;;;;;;;Keine Anmeldung, IMSBC Gruppe C
|
||||||
|
Energy Rich Fuel / Neste Renewable Diesel / NExBTL / HVO / Hydrotreated Vegetable Oils;S/P;2;>60°C;1;;;;;;;;;;;;;;;siehe Bemerkung NExBTL - Renewable Diesel
|
||||||
|
Ethyl acetate ;P;0;<60°C;2;Ja;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
Ethanol / Ethyl alcohol / Grain alcohol / Drinking alcohol;frei lassen;;<60°C;2;Nein;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
Ethylene glycol / (Mono-)Ethylenglycol / MEG / Glycol;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
Ethyl tert-butyl ether / ETBE ;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Ethylene;;;;; ;IGC;;;;;;1038;2.1;;;;X;;
|
||||||
|
ETHYLENE DICHLORIDE (ETD) ;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Y) ;;;;;
|
||||||
|
Etibor / BORAX / PENTAHYDRATE CRUDE;;;;; ;;;;;;;;;;;;;;Keine Anmeldung
|
||||||
|
EXTRAIT / Vacuum gas oil;;;;;;MARPOL;;;;;;;;;;x;;;
|
||||||
|
Fatty acids, (C16+);P;0;<60°C;2;Ja;IBC;;;;;;;;x (Y) ;;;;;
|
||||||
|
FAME / Fatty acid methyl esters / Biodiesel ,;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Y) ;;;;;
|
||||||
|
Feed Phosphate / Monocalcium Phosphate;;;;; ;;;;;;;;;;;;;;Keine Anmeldung, IMSBC Gruppe C
|
||||||
|
Ferroalloys / Ferro Silico Mangan / Ferrolegierung (unter 20 %);;;;; ;;;;;;;;;;;;;;Keine Anmeldung, IMSBC Gruppe C
|
||||||
|
Ferrochrom;;;;;;;;;;;;;;;;;;;Keine Anmeldung, IMSBC Gruppe C
|
||||||
|
Ferrosilicochrom 40 / Ferrosilicon;;;;; ;IMSBC;x;;;B;1;1408;4.3;;;;;;
|
||||||
|
FERROUS METAL / BORINGS / SHAVINGS / TURNINGS / CUTTINGS;;;;; ;IMSBC;x;;;B;1;2793;4.2;;;;;;
|
||||||
|
Fish Meal treated with Antioxidant;;;;; ;IMSBC;x;;;B;1;2216;9;;;;;;wenn Ladehafen Bremen dann Gruppe C und nicht anzumelden
|
||||||
|
Fishoil;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Y) ;;;;;
|
||||||
|
Fish Silage Protein Concentrate (containing 4% or less formic acid);P;0;NF;0;Ja;IBC;;;;;;;;x (Y) ;;;;;
|
||||||
|
Fish protein concentrate (containing 4% or less formic acid);P;0;NF;0;Nein;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
FLUORSPAR / Flussspat;;;;; ;IMSBC;x;y;;B;1;;;;;;;;
|
||||||
|
Fly Ash;;;;; ;;;;;;;;;;;;;;Keine Anmeldung
|
||||||
|
Formaldehyde solutions / Formalin ;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
FORMIC ACID (85% or less acid) , ;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
FORMIC ACID (over 85% acid) , ;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Foundry Coke / Gießereikoks /COKE;;;;; ;;;;;;;;;;;;;;Keine Anmeldung, IMSBC Gruppe C
|
||||||
|
Fraction C6 (containing benzene);S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Gas Condensate;;;<60°C;2; ;MARPOL;;;;;;;;;;x;;;
|
||||||
|
GAS OIL / Light Cycle Oil;;;>60°C;1; ;MARPOL;;;;;;;;;;x;;;
|
||||||
|
Gasoline blending stocks / Reformates / Gasoline blending stocks / polymer-fuel /Gasoline blending stocks / alkylates-fuel;;;;; ;MARPOL;;;;;;;;;;x;;;
|
||||||
|
Glycerine;S;1;>60°C;1;Nein;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
Ground Colemanite;;;;; ;;;;;;;;;;;;;;Keine Anmeldung
|
||||||
|
Gypsum / Gips;;;;; ;;;;;;;;;;;;;;Keine Anmeldung, IMSBC Gruppe C
|
||||||
|
HCGO / Heavy Cycle Gas Oil;;;;; ;MARPOL;;;;;;;;;;x;;;
|
||||||
|
HFO ;;;;;;MARPOL;;;;;;;;;;x;;;
|
||||||
|
Holzstämme / Wooden Poles;;;;; ;IMSBC;x;y;;B;1;;;;;;;;Nur wenn unter Deck, nur wenn in Loser Schüttung!
|
||||||
|
Hydrochloric Acid;S/P;2;NF;0;Ja;IBC;;;;;;;;x (Z);2;;;NF;
|
||||||
|
Hydrocarbon Wax / PROWAX 312;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (X);0;;;;
|
||||||
|
Hydro Cracker Bottoms ;;;;;;MARPOL;;;;;;;;;;x;;;
|
||||||
|
Hydrotreated Renewable Oil ;S/P;2;>60°C;1; ;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
IFO380 ;;;>60°C;1; ;MARPOL;;;;;;;;;;x;;;
|
||||||
|
ILMENITE CLAY / Ilmenit-Ton;;;;; ;IMSBC;x;;;;;;;;;;;;Anmerkung: Ilmenite für Nordenham= Ilmenit Sand - keine Anmeldung als GG
|
||||||
|
ILMENITE Concentrate;;;;;;IMSBC;x;;;;;;;;;;;;Keine Anmeldung, IMSBC Gruppe C
|
||||||
|
IRON ORE / Eisenerz;;;;; ;;;;;;;;;;;;;;Keine Anmeldung, IMSBC Gruppe C
|
||||||
|
IRON ORE / Eisenerz (FINES);;;;;;IMSBC;x;;;A;0;;;;;;;;x Kein MHB, ohne UN-/IMO-Nr. senden = geht nur im ENI (JGegis will eine Auswahl)
|
||||||
|
Iso- and cyclo-alkanes (C12+) / LIAV270 ;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Iso- and cyclo-alkanes (C10-C11+) ;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Isomerate ;;;<60°C;2;;MARPOL;;;;;;;;;;x ;;;
|
||||||
|
Isopentane / Pentane ;P;0;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Isoprene ;S/P;2;<60°C;2;;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
JET A1 / Normal Russian TS-1 / Kerosin / Kerosene;;;<60°C;2; ;MARPOL;;;;;;;;;;X;;;
|
||||||
|
Kalk ungeschlöscht / LIME UNSLAKED;;;;; ;IMSBC;x;y;;B;1;;;;;;;;
|
||||||
|
Odourless Kerosene;;;>60°C;1;;MARPOL;;;;;;;;;;x;;;
|
||||||
|
Kokospalmenschalen;;;;;;IMSBC;x;;;;;;;;;;;;Keine Anmeldung
|
||||||
|
Lard / Schmalz;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
LCCS / Light Catalytically Cracked Spirit / Light Catalytically Cracked Naphtha;;;;; ;MARPOL;;;;;;;;;;x;;;
|
||||||
|
Lecithin ;;;;;;IBC;;;;;;;;x (OS);3;;;;
|
||||||
|
Lead Concentrate ;;;;; ;IMSBC;x;;;A;0;3077;9;;;;;;"Nachfragen ob als Mineral Concentrates (3077/9) oder METAL SULPHIDE CONCENTRATES (MHB) (""Shippers declaration for solid bulk cargos"" anfordern oder auch ""Cargo information for solid bulk cargos"""
|
||||||
|
Lead Concentrate (Metal Sulphide Concentrates);;;;; ;IMSBC;x;y;;A/B;2;;;;;;;;"Nachfragen ob als Mineral Concentrates (3077/9) oder METAL SULPHIDE CONCENTRATES (MHB) (""Shippers declaration for solid bulk cargos"" anfordern oder auch ""Cargo information for solid bulk cargos"""
|
||||||
|
Lead Ingots;;;;;;IBC;;;;;;;; ;;;;;Keine Anmeldung lt. Aussage Herr Jnassen Rhenus Midgard Nordenham (tel. 21.07.2021)
|
||||||
|
Light Vacuum Gas Oil / Petroleum / Petroleum Hydrocarbons;;;;;;MARPOL;;;;;;;;;;x;;;
|
||||||
|
Ligninsulphonic Acid / Sodium Salt Solution;P;0;>60°C;1;Nein;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
Ligno Sulphonate Sodium / Sulphite Lie (Lye) ;P;0;>60°C;1; ;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
Lime ;;;;;;IMSBC;x;y;;B;1;;;;;;;;
|
||||||
|
Limestone / Kalkstein;;;;; ;;;;;;;;;;;;;;Keine Anmeldung
|
||||||
|
Liquid petroleum paraffin, fraction of C14-C17 <2% aromatics);P;0;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Lukoil / Crude Oil;;;;; ;MARPOL;;;;;;;;;;x;;;
|
||||||
|
Magnesium Chloride Solution;P;0;>60°C;1;Nein;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
Metal Sulphide Concentrates / Zink / Blei / Silber;;;;; ;IMSBC;x;y;;A/B;2;;;;;;;;
|
||||||
|
Methanol / Methyl Alcohol ;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Y) ;;;;;
|
||||||
|
Methyl Acrylate ;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Methyl Alcohol / Methanol ;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Y) ;;;;;
|
||||||
|
Methyl Isobutyl Ketone ;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
Methylendiphenylisocyanate / MDI / Polymethylene polyphenyl isocyanate ;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Y) ;;;;;
|
||||||
|
Methyl Methacrylate Monomer / MMM ;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Y) ;;;;;
|
||||||
|
Methyl Tert-Butyl Ether / MTBE ;P;0;<60°C;2;Ja;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
Mixed Fatty acid / MFA;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Y) ;;;;;
|
||||||
|
Mixed Xylene ;P;0;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Molasses;;;NF;0; ;IBC;;;;;;;;x (OS);3;;;;Nicht anmeldepflichtig - Ausnahme: BREMEN (lt Auskunft von Herrn Kraft 09.01.2018)//FÜR BREMEN ANMELDEN ÜBER J GEGIS - an DBH - ohne Visit ID
|
||||||
|
Monoammonium Phosphate / MAP;;;;; ;;;;;;;;;;;;;;Keine Anmeldung
|
||||||
|
Monocalcium Phosphate / MCP / Futtermittel;;;;; ;IMSBC;x;y;;A/B;2;;;;;;;;Verpackt (IMDG) nicht anmeldepflichtig
|
||||||
|
Monoethylen Glycol / MEG;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
Muriate of potash / Kaliumchlorid;;;;; ;;;;;;;;;;;;;;Keine Anmeldung
|
||||||
|
n-Alkanes (C10+) / N-Paraffine / Paraffine Normal;P;0;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
N-Butanol / N-BUTYL ALCOHOL;;;<60°C;2; ;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
N-paraffines / N-ALKANES (C10+);P;0;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Naphtha ;;;<60°C;2;;MARPOL;;;;;;;;;;x;;;
|
||||||
|
Naphthalene / Molten;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (X);0;;;;
|
||||||
|
Nepherlin Matrix 350 / Sand / Glas / Porzellan;;;;; ;;;;;;;;;;;;;;
|
||||||
|
NESSOL 40 (Noxious liquid, F, (6) n.o.s White Spirit);P;0;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Nessol D40 (Noxious liquid, F, (8) n.o.s. (siehe Noxious liquid…); ;; ;; ;IBC;;;;;;;; ;;;;;
|
||||||
|
Nessol D60 ( (contains Iso- und Cycloalkanes (C10-C11) (siehe Noxious liquid...); ;; ;; ;IBC;;;;;;;; ;;;;;
|
||||||
|
Nessol D100 (contains Iso- und Cycloalkanes (C12+) ; ;; ;; ;IBC;;;;;;;; ;;;;;
|
||||||
|
NExBTL / Renewable Diesel;;;>60°C;1;;IBC;;;;;;;;x (Y);1;;;>60;Risks: nicht zu finden in IBC-Code
|
||||||
|
Refinery NexTAME / Noxious liquid, F, (4) n.o.s. (trade name ...., contains ....) ;;;<60°C;2;Ja;IBC;;;;;;;;x (X);0;;;;
|
||||||
|
Nickelconzentrat ;;;;;;IMSBC;x;;;A;0;;;;;;;;
|
||||||
|
Nitric acid (70% and over) ;S/P;2;NF;0;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Nitric acid (less than 70%) ;S/P;2;NF;0;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Nonene / All Isomers;P;0;<60°C;2; ;IBC;;;;;;;;x (Y);1;;;;siehe auch Propylene Trimer
|
||||||
|
NON OXY EBOB / Gasoline;;;;;;MARPOL;;;;;;;;;;x;;;
|
||||||
|
Normal Russian TS-1 Kerosene;;;;;;MARPOL;;;;;;;;;;x;;>23;
|
||||||
|
"Noxious liquid, NF, (5) n.o.s. / Trade Name (Nexbase 3050;3020;3030,3043) / Containscontains Iso- and cyclo-alkanes ";P;0;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Noxious liquid, NF(5) n.o.s. LI 220 HF contains White Spirit, low ;P;0;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Noxious liquid, NF(5) n.o.s.(Solvesso 100, contains Alkyl (C3-C4) benzenes) ;P;0;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Noxious liquid, NF, (7) n.o.s. (Exxsol D80 , contains iso-and cycloalkanes(C12+));P;0;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Noxious liquid, NF, (7) n.o.s. ((EXXSOL D60 und auch Nessol D60, contains iso-and cycloalkanes (C10-C11));P;0;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Noxious liquid, F, (8) n.o.s. (NESSOL D40 contains Iso- and cycloalkanes (C10-C11)) ;P;0;<60°C;2;ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
NPK Fertilizer / Ammonium Nitrate Based Fertilizer (Non Hazardous);;;;; ;;;;;;;;;;;;;;Keine Anmeldung
|
||||||
|
Nynas VR5000 / Bitumen;;;>60°C;1;;MARPOL;;;;;;;;;;x;;;
|
||||||
|
NYTRO TAURUS / Insulating Oil;;;;;;MARPOL;;;;;;;;;;x;;;
|
||||||
|
Octene;P;0;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Odourless Kerosene D70 ;;;;;;MARPOL;;;;;;;;;;x;;;
|
||||||
|
Olivines / Mineralgemisch gehört Mineralklasse der „Silikate und Germanate“ ;;;;;;;;;;;;;;;;;;;Keine Anmeldung
|
||||||
|
Olive Stones (crushed) / Seed Cake / Oil Cake;;;;; ;IMSBC;x;;;B;1;1386;4.2;;;;;;
|
||||||
|
ORTHO-XYLENE ;P;0;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Palm fatty acid distillate / PFAD;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Palmkernexpellers / pulverisierte Kernschalen;;;;;;;;;;;;;;;;;;;Keine Anmeldung lt. J.Müller Brake - siehe aber auch SEED CAKE
|
||||||
|
PALM KERNEL OIL / CPKO / Crude Palm Kernel Oil;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
PALM KERNEL STEARIN ;P;0;>60°C;1;Ja;;;;;;;;;;;;;;
|
||||||
|
PALM MID-FRACTION ;P;0;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
PALM OIL ;P;0;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
PALM OLEINE ;P;0;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Palm stearin ;P;0;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Palmitic Acid ;;;;; ;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
n-Paraffins (C10-C20) / N-ALKANES (C10+);P;0;>60°C;1; ;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Paraffin wax, highly-refined ;P;0;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Paraffin wax, semi-refined ;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (X);0;;;;
|
||||||
|
PARA XYLENE ;P;0;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Pea Coke;;;;; ;;;;;;;;;;;;;;Keine Anmeldung
|
||||||
|
PEAT MOSS / Torf;;;;; ;IMSBC;x;y;;A/B;2;;;;;;;;Für den Kielkanal nicht anmelden lt. Rücksprache UCA+Herrn Langbein/01.02.2016 => gültig für UCA/S+B
|
||||||
|
Peat (milled);;;;; ;;;;;;;;;;;;;;Keine Anmeldung lt. Herrn Schütte für NOK nicht anmelden/09.02.2021
|
||||||
|
Pentadiene / 1,3-Pentadiene;P;0;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Perchloroethylene ;S/P;2;NF;0;;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
PETROLEUM COKE / calcined or uncalcined oder Calcined Coke / Petcoke;;;;; ;IMSBC;x;y;;B;1;;;;;;;;
|
||||||
|
PGI / Propylene Glycol Industrial;S/P;2;>60°C;1;?;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
Phenol;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Phosphoric Acid ;S/P;2;NF;0;Ja;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
PITCH / Pech;;;;; ;IMSBC;x;y;;B;1;;;;;;;;In Bulk/Pitch Verpackt (MSDS = Material Safetey Data Sheet anfordern)
|
||||||
|
PME / Biodiesel;;;;; ;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Polymethylene Polyphenyl Isocyanate ;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Y) ;;;;;
|
||||||
|
Polyolefin (molecular weight 300+) ;P;0;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Potash / Pottasche;;;;; ;;;;;;;;;;;;;;Keine Anmeldung
|
||||||
|
Potassium Hydroxide Solution / Caustic Potash / Kaliumhydroxidlösung;S/P;2;NF;0;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Propylbenzene / all isomers;P;0;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Propylene;;;;; ;IGC;;;;;;1077;2.2;;;;x;;
|
||||||
|
Propylene Dichloride / 1,2-DICHLOROPROPANE;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Y) ;;;;;
|
||||||
|
Propylene Glycol Monoalkyl Ether / DOWANOL PM;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
Propylene Oxide; ;; ;; ;IBC;;;;;;1280;3; ;;;x;;
|
||||||
|
Propylene Tetramer ;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (X);0;;;;
|
||||||
|
Propylene Trimer ;P;0;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Pyrolysis Fuel Oil;;;;; ;IBC;;;;;;;;?;;?;;;
|
||||||
|
Pyrolysis Gasoline containing benzene / Pygas /Aromatic hydrocarbons / C6-8 / Naphtha-Raffinate Pyrolyzate-derived ;S/P;2;<60°C;2;Ja;IBC;;;;;;;; x (Y) ;;;;;
|
||||||
|
Pyrite;;;;;;;;;;;;;;;;;;;"Achtung! Kann ""IMSBC: Gruppe C"" (also nicht anmeldepflichig sein) oder auch ""Gruppe: A"" bzw. ""Gruppe: A/B"" (somit Anmeldepflichtig)- beim Kunden nachfragen und ""Shippers declaration for solid bulk cargos"" oder es nennt sich auch ""Cargo information for solid bulk cargos"" anfordern"
|
||||||
|
Quicklime / Kalk ungelöscht / Lime / Burnt Lime / Un-slaked Lime / Building Lime / Calcia / Fat Lime / Chemical Lime / Fluxing Lime / Hard Burnt Lime / Soft Burnt Lime / Pebble Lime / Calcium Oxide / Calcium Monoxide / Calcined Limestone / Calcium oxide / CaO;;;;;;IMSBC;x;Y;;B;1;;;;;;;;
|
||||||
|
Rapeseed oil / Rapsöl;P;0;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Rape seed oil fatty acid methyl esters ;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
BALED RDF;;;;;;IMSBC;x;y;;B;1;;;;;;;;beim KD/Schiff nach Blatt „Shipper's Declaration for Solid Bulk Cargos“ oder „Cargo Information for solid bulk cargos“„ fragen - 13.12.2021
|
||||||
|
Refinery NexTAME / Noxious liquid, F, (4) n.o.s. (trade name ...., contains ....);P;0;<60°C;2;Ja.;IBC;;;;;;;;x (y);1;;;;
|
||||||
|
Reformate / Naphtha / Gas Oil / UMS / Unleaded mo gas / Motor Gas;;;;;;MARPOL;;;;;;;;;;x;;;
|
||||||
|
RDF pellets / Refuse Derived Fuel;;;;; ;;;;;;;;;;;;;;Keine Anmeldung
|
||||||
|
Resin Oil / Distilled ;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
RME 0,4MG/11 / FAME;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Sawn Timber / Schnittholz / Sägeholz;;;;; ;IMSBC;x;;;;;;;;;;;;nur wenn als Bulk (also keine Verpackung jeglicher Art (Drahtseile, Kunststoffbänder) und unter Deck
|
||||||
|
SEED Cake mit einem Ölgehalt von höchstens 1,5% und einem Feuchtigkeitsgehalt von höchstens 11% ///with not more than 1.5% oil and not more than 11% moisture.;;;;;;IMSBC;x;;;B;1;2217;4.2;;;;;;
|
||||||
|
SEED Cake containing vegetable oil a) durch mechanisches Pressen gewonnene Ölsaatenrückstände, die mehr als 10% Öl oder mehr als 20% Öl und Feuchtigkeit zusammen enthalten / (a) mechanically expelled seeds, containing more than 10% of oil or more than 20% of oil and moisture combined.);;;;;;IMSBC;x;;;B;1;1386;4.2;;;;;;
|
||||||
|
Shale Oil;;;;; ;MARPOL;;;;;;;;;;x;;;
|
||||||
|
Slack Wax / Petroleum / Hydrocarbon Wax;S/P;2;>60°C;1; ;IBC;;;;;;;;x (X);0;;;;
|
||||||
|
Slop Water;;;;; ;;;;;;;;;;;;;;Keine Anmeldung lt. Johann/16.12.12
|
||||||
|
Slops;;;;; ;;;;;;;;;;;;;;
|
||||||
|
Slurry / Residues / Petroleum;;;;; ;MARPOL;;;;;;;;;;x ;;;
|
||||||
|
Small Arms = Waffen zur Schiffsausrüstung gehörig;;;;; ;;;;;;;;;;;;;;Keine Anmeldung lt. Aussage von Fr. Kauschmann/16.05.2013 (09:50 Uhr)
|
||||||
|
Solvent ;;;;;;;;;;;;;;;;;;;Sicherheitsdatenblatt anfordern!!!
|
||||||
|
Sodium hydroxide solution / Caustic soda / Natronlauge;S/P;2;NF;0;Ja;IBC;;;;;;;;x (Y);;;;;
|
||||||
|
Sodium Sulphate in Bulk;;;;; ;;;;;;;;;;;;;;Keine Anmeldung lt. Aussage von Herrn Illing Gefahrgutauskunfststelle Hamburg/14.02.14-10.25 Uhr
|
||||||
|
Soyabean meal / SBM / Sojabohnenmehl;;;;; ;IMSBC;x;y;;;;;;;;;;;"Kann Cat. A, B oder C sein (abhängig von der Zusammensetzung),
|
||||||
|
wenn keine genaue Angabe => Anfragen, ob anmledepflichtig oder nicht,
|
||||||
|
Wenn Port of Loading = Brake oder Hamburg => Cat. C und damit nicht anmeldepflichtig"
|
||||||
|
Soyabean Oil ,;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Soja protein concentrat / SPC;;;;;;;;;;;;;;;;;;;Keine Anmeldung
|
||||||
|
Steel Turnings;;;;; ;IMSBC;x;;;B;1;2793;4.2;;;;;;
|
||||||
|
Styrene Monomer ,;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Sulphur (molten) ;S;1;>60°C;1;Nein;IMSBC; ;;;;;;;x (Z);2;;;;
|
||||||
|
Sulphuric Acid;S/P;2;NF;0;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Sunflower Husk Pellets in bulk;;;;;;;;;;;;;;;;;;;Keine Anmeldung, Gruppe C - tel Aussage Hr. Meiners (J.Müller)
|
||||||
|
Sunflower Seed Oil ;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Y) ;;;;;
|
||||||
|
Tall oil fatty acid / TOFA (resin acids less than 20%) ;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Tall oil pitch ;P;0;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Tallow fatty acid;P;0;>60°C;1;Ja;IMSBC; ;;;;;;;x (Y);1;;;;
|
||||||
|
tert-Amyl ethyl ether / TAEE ;P;0;<60°C;2;Ja;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
tert-Amyl methyl ether / TAME;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (X);0;;;;
|
||||||
|
Toasted meals / geröstete Mehle;;;;; ;IMSBC;x;;;;;;;;;;;;Group: B oder C - beim KD nach Blatt „Shipper's Declaration for Solid Bulk Cargos“ oder „Cargo Information for solid bulk cargos“„ fragen
|
||||||
|
Toluene ;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Transformer oil / Insulating oil (z.B. NS8);;;;; ;MARPOL;;;;;;;;;;x;;;
|
||||||
|
Turpentine (z. B. LI200) ;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (X);0;;;;
|
||||||
|
UMS / Gasoline;;;;;;MARPOL;;;;;;;;;;x;;;
|
||||||
|
Nynas Naphthenic / Tyre Oils;;;;; ;MARPOL;;;;;;;;;;x;;;
|
||||||
|
Ultra-Low Sulphur Fuel Oil / ULSFO;;;;;;MARPOL;;;;;;;;;;x;;;
|
||||||
|
Urea Grain in bulk ;;;;; ;;;;;;;;;;;;;;Keine Anmeldung, IMSBC Gruppe C
|
||||||
|
Urea Ammonium Nitrate solution / UAN (containing less than 1% free ammonia) ;S/P;2;NF;0;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Urea solution ;S/P;2;<60°C;2;Nein;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
Urea Grain in bulk;;;;;;;;;;;;;;;;;;;Keine Anmeldung, IMSBC Gruppe C
|
||||||
|
VGO / Vakuum Gas Öl / Schweres Vakuumgasöl / HVGO;;;<60°C;2; ;MARPOL;;;;;;3082;9;;;x;;;
|
||||||
|
Vegetable acid oils;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (Y) ;;;;;
|
||||||
|
Versene 100 / ETHYLENEDIAMINETETRAACETIC ACID NA4-SALT;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
|
||||||
|
Versenex 80 / Diethylenetriaminepentaacetic acid / pentasodium salt solution;P;0;>60°C;1;Nein;IBC;;;;;;;;x (Z);2;;;;
|
||||||
|
Vinyl Acetate monomer;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Y) ;;;;;
|
||||||
|
VISTAR HS / Distillates Petroleum;;;;;;MARPOL;;;;;;;;;;x;;;
|
||||||
|
Wash Oil / Creosote oil / METHYLNAPHTHALENE acenaphthene fraction;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (X);0;;;;
|
||||||
|
Washed Waelz Oxide / Zink / zinkhaltiger Staub;;;;;;IMSBC;x;;;A;0;;;;;;;;lt. Rhenus Midgard/Hr. Janssen
|
||||||
|
Wilfarin PA1698 RSPO (siehe Fatty acids, (C16+) );P;0;>60°C;1;Ja;;;;;;;;;;;;;;
|
||||||
|
WOOD PELLETS ;;;;; ;IMSBC;x;y;;B;1;;;;;;;;
|
||||||
|
Wood pulp;;;;;;;;;;;;;;;;;;;nicht anmelden = Aussage J.Müller, kein DG
|
||||||
|
Wood pulp pellets ;;;;; ;IMSBC;x;y;;B;1;;;;;;;;
|
||||||
|
WOODCHIPS ;;;;; ;IMSBC;x;y;;B;1;;;;;;;;
|
||||||
|
Wooden poles / Holzstämme;;;;; ;IMSBC;x;y;;B;1;;;;;;;;NUR UNTER DECK (in Luken) anzumeldem - DECKSLADUNG NICHT! (außer für Baltic Lloyd, Rostock - ALLES anmelden!) lt. Herrn Ronneberger
|
||||||
|
Xylenes / Ortho-Xylene / Para Xylene;P;0;<60°C;2;Ja;IBC;;;;;;;;x (Y);1; ;;;
|
||||||
|
Zellulose / Cellulose / Wood pulp;;;;; ;;;;;;;;;;;;;;"Keine Anmeldung,
|
||||||
|
Nur falls Bulk-Ladung"
|
||||||
|
Zinc Concentrates / MRM BULK CONCENTRATES / Mineral Concentrates;;;;; ;IMSBC;x;;;A;0;3077;9;;;;;;"Nachfragen ob als Mineral Concentrates (3077/9) oder METAL SULPHIDE CONCENTRATES (MHB) (""Shippers declaration for solid bulk cargos"" anfordern oder auch ""Cargo information for solid bulk cargos"""
|
||||||
|
Zinc Concentrates / MRM BULK CONCENTRATES / METAL SULPHIDE CONCENTRATES;;;;; ;IMSBC;x;y;;A/B;2;;;;;;;;"Nachfragen ob als Mineral Concentrates (3077/9) oder METAL SULPHIDE CONCENTRATES (MHB) (""Shippers declaration for solid bulk cargos"" anfordern oder auch ""Cargo information for solid bulk cargos"""
|
||||||
|
BIN
misc/GEFAHRGUTLISTE.xlsx
Normal file
BIN
misc/GEFAHRGUTLISTE.xlsx
Normal file
Binary file not shown.
BIN
misc/SSN LOCODES_2022.xlsx
Normal file
BIN
misc/SSN LOCODES_2022.xlsx
Normal file
Binary file not shown.
BIN
misc/db.sqlite
BIN
misc/db.sqlite
Binary file not shown.
17
misc/import_sqlite.py
Normal file
17
misc/import_sqlite.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import sqlite3
|
||||||
|
import pandas as pd
|
||||||
|
import os
|
||||||
|
|
||||||
|
abspath = os.path.abspath(__file__)
|
||||||
|
dname = os.path.dirname(abspath)
|
||||||
|
os.chdir(dname)
|
||||||
|
|
||||||
|
con = sqlite3.connect('cps.db')
|
||||||
|
wb = pd.read_excel('GEFAHRGUTLISTE.xlsx',sheet_name = None)
|
||||||
|
|
||||||
|
for sheet in wb:
|
||||||
|
wb[sheet].to_sql(sheet,con,index=False)
|
||||||
|
|
||||||
|
con.commit()
|
||||||
|
con.close()
|
||||||
|
print('done')
|
||||||
19
misc/info_SSN_Locodes.txt
Normal file
19
misc/info_SSN_Locodes.txt
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
Neue SSN Locode Liste?
|
||||||
|
|
||||||
|
.xslx in CSV umwandeln
|
||||||
|
|
||||||
|
direkt in SQLite importieren (als neue Tabelle). Ich habe die alte Liste gelöscht und
|
||||||
|
die neue umbenannt.
|
||||||
|
|
||||||
|
Die neuen Einträge anzeigen lassen:
|
||||||
|
|
||||||
|
select SSN_2022.* from SSN_2022
|
||||||
|
left outer join SSN_LOCODES on SSN_2022.LocationCode = SSN_LOCODES.LocationCode
|
||||||
|
where SSN_LOCODES.LocationCode is null
|
||||||
|
order by SSN_2022.LocationCode
|
||||||
|
|
||||||
|
"Gemeinsame" Einträge anzeigen lassen:
|
||||||
|
|
||||||
|
SELECT * FROM SSN_LOCODES
|
||||||
|
INTERSECT
|
||||||
|
SELECT * FROM SSN_2022
|
||||||
@ -2,8 +2,11 @@
|
|||||||
2) Prüfen ob das ENI App logo richtig ist
|
2) Prüfen ob das ENI App logo richtig ist
|
||||||
3) VS: Publish: Folder Location und Url richtig auswählen
|
3) VS: Publish: Folder Location und Url richtig auswählen
|
||||||
4) Signing: "Sign the ClickOnce manifests": Hier für Prod das Zertifikat
|
4) Signing: "Sign the ClickOnce manifests": Hier für Prod das Zertifikat
|
||||||
auswählen, das am 15.7.22 abläuft. Das Test Zertifikat läuft am 12.11.22 ab.
|
auswählen, das am 10.5.23 abläuft. Das Test Zertifikat läuft am 12.11.22 ab.
|
||||||
Auswahl über "Select from Store.."
|
Auswahl über "Select from Store.."
|
||||||
5) komplett neu bauen (clean!)
|
5) Release build einstellen
|
||||||
6) In Description bei Product name "ENI" statt "ENI Testversion"
|
6) komplett neu bauen (clean!)
|
||||||
7) Build-Typ auf "Release"
|
7) In Publish -> Options -> Description bei Product name "ENI" statt "ENI Testversion"
|
||||||
|
8) Publish now
|
||||||
|
9) Upload
|
||||||
|
10) last/next Version.txt pflegen
|
||||||
|
|||||||
10
misc/info_gefahrgutliste.txt
Normal file
10
misc/info_gefahrgutliste.txt
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# Procedere um Gefahrgut zu aktualisieren
|
||||||
|
|
||||||
|
____
|
||||||
|
|
||||||
|
Wird verwendet in Dangerous Goods, wenn der Button NewDGItem gedrückt Wird.
|
||||||
|
|
||||||
|
1) bei geliefertem Excel unnötige Spalten entfernen
|
||||||
|
2) als CSV speichern
|
||||||
|
3) beim Import in DB Browser für SQLite ("Import CSV into Table") darauf achten, dass UTF-8 ausgewählt ist
|
||||||
|
4) Im DB Browser die relevanten Spalten von TEXT auf NUMERIC stellen
|
||||||
Loading…
Reference in New Issue
Block a user