diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/DangerousGoodsDetailControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailViewControls/DangerousGoodsDetailControl.xaml.cs
index 94e33b18..897eaddb 100644
--- a/ENI-2/ENI2/ENI2/DetailViewControls/DangerousGoodsDetailControl.xaml.cs
+++ b/ENI-2/ENI2/ENI2/DetailViewControls/DangerousGoodsDetailControl.xaml.cs
@@ -7,6 +7,9 @@ using System.Windows;
using bsmd.database;
using ENI2.EditControls;
using ENI2.Util;
+using System.Windows.Controls;
+using System.Windows.Media.Imaging;
+using System;
namespace ENI2.DetailViewControls
{
@@ -18,6 +21,7 @@ namespace ENI2.DetailViewControls
private Message _hazMessage;
private HAZ haz;
+ private HAZ hazd; // referenz auf HAZD, falls das hier HAZA ist und wir Positionen kopieren wollen
public DangerousGoodsDetailControl()
{
@@ -30,8 +34,8 @@ namespace ENI2.DetailViewControls
this.RegisterCheckboxChange(this.checkBoxDangerousGoodsOnBoard, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
this.RegisterCheckboxChange(this.checkBoxDGManifestOnBoard, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
this.RegisterCheckboxChange(this.checkBoxMoUBaltic, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
- this.RegisterComboboxIndexChange(this.comboBoxVesselClass, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
- }
+ this.RegisterComboboxIndexChange(this.comboBoxVesselClass, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
+ }
public bool IsDeparture { get; set; }
@@ -47,7 +51,28 @@ namespace ENI2.DetailViewControls
}
else
{
- if (aMessage.MessageNotificationClass == Message.NotificationClass.HAZA) { this._hazMessage = aMessage; this.ControlMessages.Add(aMessage); }
+ if (aMessage.MessageNotificationClass == Message.NotificationClass.HAZA)
+ {
+ this._hazMessage = aMessage;
+ this.ControlMessages.Add(aMessage);
+ }
+ if (aMessage.MessageNotificationClass == Message.NotificationClass.HAZD)
+ {
+ if(aMessage != null)
+ {
+ if (aMessage.Elements.Count > 0)
+ this.hazd = aMessage.Elements[0] as HAZ;
+ if (this.hazd == null)
+ {
+ this.hazd = new HAZ();
+ this.hazd.MessageCore = this.Core;
+ this.hazd.MessageHeader = aMessage;
+ aMessage.Elements.Add(this.hazd);
+ SublistElementChanged(Message.NotificationClass.HAZD);
+ }
+ this.ControlMessages.Add(aMessage);
+ }
+ }
}
}
@@ -113,8 +138,151 @@ namespace ENI2.DetailViewControls
#endregion
+ if (!this.haz.IsDeparture)
+ {
+ #region Extra Menüpunkte um Positionen nach HAZD zu kopieren
+
+ this.dataGridIBCItems.ContextMenu.Items.Add(new Separator());
+ MenuItem copyIBCItem = new MenuItem();
+ copyIBCItem.Header = Properties.Resources.textCopyToHAZD;
+ copyIBCItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
+ copyIBCItem.Click += new RoutedEventHandler(this.copyIBC);
+ this.dataGridIBCItems.ContextMenu.Items.Add(copyIBCItem);
+
+ this.dataGridIGCItems.ContextMenu.Items.Add(new Separator());
+ MenuItem copyItemIGC = new MenuItem();
+ copyItemIGC.Header = Properties.Resources.textCopyToHAZD;
+ copyItemIGC.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
+ copyItemIGC.Click += new RoutedEventHandler(this.copyIGC);
+ this.dataGridIGCItems.ContextMenu.Items.Add(copyItemIGC);
+
+ this.dataGridIMDGItems.ContextMenu.Items.Add(new Separator());
+ MenuItem copyItemIMDG = new MenuItem();
+ copyItemIMDG.Header = Properties.Resources.textCopyToHAZD;
+ copyItemIMDG.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
+ copyItemIMDG.Click += new RoutedEventHandler(this.copyIMDG);
+ this.dataGridIMDGItems.ContextMenu.Items.Add(copyItemIMDG);
+
+ this.dataGridIMSBCItems.ContextMenu.Items.Add(new Separator());
+ MenuItem copyItemIMSBC = new MenuItem();
+ copyItemIMSBC.Header = Properties.Resources.textCopyToHAZD;
+ copyItemIMSBC.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
+ copyItemIMSBC.Click += new RoutedEventHandler(this.copyIMSBC);
+ this.dataGridIMSBCItems.ContextMenu.Items.Add(copyItemIMSBC);
+
+ this.dataGridMARPOLItems.ContextMenu.Items.Add(new Separator());
+ MenuItem copyItemMARPOL = new MenuItem();
+ copyItemMARPOL.Header = Properties.Resources.textCopyToHAZD;
+ copyItemMARPOL.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
+ copyItemMARPOL.Click += new RoutedEventHandler(this.copyMARPOL);
+ this.dataGridMARPOLItems.ContextMenu.Items.Add(copyItemMARPOL);
+
+ #endregion
+
+ }
+
+ this._initialized = true;
}
+ #region Copy event handler
+
+ private void copyMARPOL(object sender, RoutedEventArgs e)
+ {
+ // aus dem aktuell selektierten MARPOL Element ein neues MARPOL Element machen und nach HAZD kopieren
+ if ((this.dataGridMARPOLItems.SelectedItems != null) && (this.dataGridMARPOLItems.SelectedItems.Count == 1))
+ {
+ MARPOL_Annex_I_Position selectedMARPOL = this.dataGridMARPOLItems.SelectedItems[0] as MARPOL_Annex_I_Position;
+ if (selectedMARPOL != null)
+ {
+ MARPOL_Annex_I_Position copyMARPOL = new MARPOL_Annex_I_Position();
+ copyMARPOL.MessageHeader = this.hazd.MessageHeader;
+ copyMARPOL.HAZ = this.hazd;
+ copyMARPOL.CopyFromMARPOL(selectedMARPOL);
+ copyMARPOL.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.MARPOLPositions);
+ this.hazd.MARPOLPositions.Add(copyMARPOL);
+ this.SublistElementChanged(Message.NotificationClass.HAZD);
+ }
+ }
+ }
+
+ private void copyIMSBC(object sender, RoutedEventArgs e)
+ {
+ // aus dem aktuell selektierten IMBSC Element ein neues IMBSC Element machen und nach HAZD kopieren
+ if ((this.dataGridIMSBCItems.SelectedItems != null) && (this.dataGridIMSBCItems.SelectedItems.Count == 1))
+ {
+ IMSBCPosition selectedIMSBC = this.dataGridIMSBCItems.SelectedItems[0] as IMSBCPosition;
+ if (selectedIMSBC != null)
+ {
+ IMSBCPosition copyIMSBC = new IMSBCPosition();
+ copyIMSBC.MessageHeader = this.hazd.MessageHeader;
+ copyIMSBC.HAZ = this.hazd;
+ copyIMSBC.CopyFromIMSBC(selectedIMSBC);
+ copyIMSBC.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.IMSBCPositions);
+ this.hazd.IMSBCPositions.Add(copyIMSBC);
+ this.SublistElementChanged(Message.NotificationClass.HAZD);
+ }
+ }
+ }
+
+ private void copyIMDG(object sender, RoutedEventArgs e)
+ {
+ // aus dem aktuell selektierten IMDG Element ein neues IMDG Element machen und nach HAZD kopieren
+ if ((this.dataGridIMDGItems.SelectedItems != null) && (this.dataGridIMDGItems.SelectedItems.Count == 1))
+ {
+ IMDGPosition selectedIMDG = this.dataGridIMDGItems.SelectedItems[0] as IMDGPosition;
+ if (selectedIMDG != null)
+ {
+ IMDGPosition copyIMDG = new IMDGPosition();
+ copyIMDG.MessageHeader = this.hazd.MessageHeader;
+ copyIMDG.HAZ = this.hazd;
+ copyIMDG.CopyFromIMDG(selectedIMDG);
+ copyIMDG.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.IMDGPositions);
+ this.hazd.IMDGPositions.Add(copyIMDG);
+ this.SublistElementChanged(Message.NotificationClass.HAZD);
+ }
+ }
+ }
+
+ private void copyIGC(object sender, RoutedEventArgs e)
+ {
+ // aus dem aktuell selektierten IGC Element ein neues IGC Element machen und nach HAZD kopieren
+ if ((this.dataGridIGCItems.SelectedItems != null) && (this.dataGridIGCItems.SelectedItems.Count == 1))
+ {
+ IGCPosition selectedIGC = this.dataGridIGCItems.SelectedItems[0] as IGCPosition;
+ if (selectedIGC != null)
+ {
+ IGCPosition copyIGC = new IGCPosition();
+ copyIGC.MessageHeader = this.hazd.MessageHeader;
+ copyIGC.HAZ = this.hazd;
+ copyIGC.CopyFromIGC(selectedIGC);
+ copyIGC.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.IGCPositions);
+ this.hazd.IGCPositions.Add(copyIGC);
+ this.SublistElementChanged(Message.NotificationClass.HAZD);
+ }
+ }
+ }
+
+ private void copyIBC(object sender, RoutedEventArgs e)
+ {
+ // aus dem aktuell selektierten IBC Element ein neues IBC Element machen und nach HAZD kopieren
+ if ((this.dataGridIBCItems.SelectedItems != null) && (this.dataGridIBCItems.SelectedItems.Count == 1))
+ {
+ IBCPosition selectedIBC = this.dataGridIBCItems.SelectedItems[0] as IBCPosition;
+ if (selectedIBC != null)
+ {
+ IBCPosition copyIBC = new IBCPosition();
+ copyIBC.MessageHeader = this.hazd.MessageHeader;
+ copyIBC.HAZ = this.hazd;
+ copyIBC.CopyFromIBC(selectedIBC);
+ copyIBC.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.IBCPositions);
+ this.hazd.IBCPositions.Add(copyIBC);
+ this.SublistElementChanged(Message.NotificationClass.HAZD);
+ }
+ }
+ }
+
+ #endregion
+
#region MARPOL datagrid handlers
private void DataGridMARPOLItems_DeleteRequested(DatabaseEntity obj)
diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml b/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml
index 561ead12..40416b17 100644
--- a/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml
+++ b/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml
@@ -124,7 +124,7 @@
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
-
+
@@ -146,7 +146,7 @@
-
+
diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/PSC72hDetailControl.xaml b/ENI-2/ENI2/ENI2/DetailViewControls/PSC72hDetailControl.xaml
index 28ce3b37..863a8528 100644
--- a/ENI-2/ENI2/ENI2/DetailViewControls/PSC72hDetailControl.xaml
+++ b/ENI-2/ENI2/ENI2/DetailViewControls/PSC72hDetailControl.xaml
@@ -39,7 +39,7 @@
-
+
diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml.cs
index 978e4120..10a1cb00 100644
--- a/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml.cs
+++ b/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml.cs
@@ -100,7 +100,8 @@ namespace ENI2.DetailViewControls
this.dateTimePicker_ETDFromKielCanal.DataContext = _noa_nod;
this.dateTimePicker_ETDFromLastPort.DataContext = _noa_nod;
this.dateTimePicker_ETDFromPortOfCall.DataContext = _noa_nod;
-
+
+ this.checkBox_IsAnchored.IsEnabled = this.Core.IsDK;
}
private void DataGridCallPurposes_DeleteRequested(DatabaseEntity obj)
diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/PortNotificationDetailControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailViewControls/PortNotificationDetailControl.xaml.cs
index e6394884..02f5cd35 100644
--- a/ENI-2/ENI2/ENI2/DetailViewControls/PortNotificationDetailControl.xaml.cs
+++ b/ENI-2/ENI2/ENI2/DetailViewControls/PortNotificationDetailControl.xaml.cs
@@ -152,14 +152,25 @@ namespace ENI2.DetailViewControls
}
private void DataGridLADG_CreateRequested()
- {
- LADG ladg = new LADG();
+ {
EditLADGDialog eld = new EditLADGDialog();
- eld.LADG = ladg;
+ eld.LADG = new LADG();
+ eld.Core = this.Core;
+
+ eld.AddClicked += () =>
+ {
+ eld.CopyValuesToEntity();
+ this._ladgMessage.Elements.Add(eld.LADG);
+ eld.LADG.MessageHeader = _ladgMessage;
+ this.dataGridLADG.Items.Refresh();
+ eld.LADG = new LADG();
+ this.SublistElementChanged(Message.NotificationClass.LADG);
+ };
+
if (eld.ShowDialog() ?? false)
{
- ladg.MessageHeader = _ladgMessage;
- _ladgMessage.Elements.Add(ladg);
+ eld.LADG.MessageHeader = _ladgMessage;
+ _ladgMessage.Elements.Add(eld.LADG);
this.dataGridLADG.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.LADG);
}
@@ -183,10 +194,23 @@ namespace ENI2.DetailViewControls
if(ladg != null)
{
EditLADGDialog eld = new EditLADGDialog();
+ eld.Core = this.Core;
eld.LADG = ladg;
+
+ eld.AddClicked += () =>
+ {
+ eld.CopyValuesToEntity();
+ eld.LADG = new LADG();
+ _ladgMessage.Elements.Add(eld.LADG);
+ eld.LADG.MessageHeader = _ladgMessage;
+ this.SublistElementChanged(Message.NotificationClass.LADG);
+ };
+
if (eld.ShowDialog() ?? false)
+ {
this.dataGridLADG.Items.Refresh();
- this.SublistElementChanged(Message.NotificationClass.LADG);
+ this.SublistElementChanged(Message.NotificationClass.LADG);
+ }
}
}
@@ -196,14 +220,24 @@ namespace ENI2.DetailViewControls
}
private void DataGridSERV_CreateRequested()
- {
- SERV serv = new SERV();
+ {
EditSERVDialog esd = new EditSERVDialog();
- esd.SERV = serv;
+ esd.SERV = new SERV();
+
+ esd.AddClicked += () =>
+ {
+ esd.CopyValuesToEntity();
+ _servMessage.Elements.Add(esd.SERV);
+ esd.SERV.MessageHeader = _servMessage;
+ this.dataGridSERV.Items.Refresh();
+ esd.SERV = new SERV();
+ this.SublistElementChanged(Message.NotificationClass.SERV);
+ };
+
if(esd.ShowDialog() ?? false)
{
- serv.MessageHeader = _servMessage;
- _servMessage.Elements.Add(serv);
+ esd.SERV.MessageHeader = _servMessage;
+ _servMessage.Elements.Add(esd.SERV);
this.dataGridSERV.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.SERV);
}
@@ -228,6 +262,16 @@ namespace ENI2.DetailViewControls
{
EditSERVDialog esd = new EditSERVDialog();
esd.SERV = serv;
+
+ esd.AddClicked += () =>
+ {
+ esd.CopyValuesToEntity();
+ esd.SERV = new SERV();
+ _servMessage.Elements.Add(esd.SERV);
+ esd.SERV.MessageHeader = _servMessage;
+ this.SublistElementChanged(Message.NotificationClass.SERV);
+ };
+
if (esd.ShowDialog() ?? false)
{
this.dataGridSERV.Items.Refresh();
diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/TowageDetailControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailViewControls/TowageDetailControl.xaml.cs
index 41b6e277..51489bb1 100644
--- a/ENI-2/ENI2/ENI2/DetailViewControls/TowageDetailControl.xaml.cs
+++ b/ENI-2/ENI2/ENI2/DetailViewControls/TowageDetailControl.xaml.cs
@@ -7,6 +7,9 @@ using System.Windows;
using bsmd.database;
using ENI2.EditControls;
using ENI2.Util;
+using System.Windows.Controls;
+using System;
+using System.Windows.Media.Imaging;
namespace ENI2.DetailViewControls
{
@@ -27,7 +30,30 @@ namespace ENI2.DetailViewControls
private void TowageDetailControl_Loaded(object sender, RoutedEventArgs e)
{
+ this.dataGridTowageOnArrival.ContextMenu.Items.Add(new Separator());
+ MenuItem copyItem = new MenuItem();
+ copyItem.Header = Properties.Resources.textCopyTOWATOWD;
+ copyItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
+ copyItem.Click += new RoutedEventHandler(this.copyItem);
+ this.dataGridTowageOnArrival.ContextMenu.Items.Add(copyItem);
+ }
+ private void copyItem(object sender, RoutedEventArgs e)
+ {
+ // aus dem aktuell selektierten TOWA Element ein neues TOWD Element machen
+ if ((this.dataGridTowageOnArrival.SelectedItems != null) && (this.dataGridTowageOnArrival.SelectedItems.Count == 1))
+ {
+ TOWA selectedTOWA = this.dataGridTowageOnArrival.SelectedItems[0] as TOWA;
+ if (selectedTOWA != null)
+ {
+ TOWD copyTOWD = new TOWD();
+ copyTOWD.MessageHeader = _towdMessage;
+ copyTOWD.CopyFromTOWA(selectedTOWA);
+ this._towdMessage.Elements.Add(copyTOWD);
+ this.dataGridTowageOnDeparture.Items.Refresh();
+ this.SublistElementChanged(Message.NotificationClass.TOWD);
+ }
+ }
}
public override void Initialize()
@@ -95,8 +121,9 @@ namespace ENI2.DetailViewControls
if (ebd.ShowDialog() ?? false)
{
- towd.MessageHeader = _towdMessage;
- _towdMessage.Elements.Add(towd);
+ ebd.CopyValuesToEntity();
+ ebd.TOWD.MessageHeader = _towdMessage;
+ _towdMessage.Elements.Add(ebd.TOWD);
this.dataGridTowageOnDeparture.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.TOWD);
}
@@ -125,16 +152,16 @@ namespace ENI2.DetailViewControls
eld.AddClicked += () =>
{
- eld.CopyValuesToEntity();
- _towdMessage.Elements.Add(eld.TOWD);
- this.dataGridTowageOnDeparture.Items.Refresh();
+ eld.CopyValuesToEntity();
eld.TOWD = new TOWD();
+ _towdMessage.Elements.Add(eld.TOWD);
eld.TOWD.MessageHeader = _towdMessage;
this.SublistElementChanged(Message.NotificationClass.TOWD);
};
if (eld.ShowDialog() ?? false)
{
+ eld.CopyValuesToEntity();
this.dataGridTowageOnDeparture.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.TOWD);
}
@@ -162,13 +189,14 @@ namespace ENI2.DetailViewControls
ebd.TOWA.MessageHeader = _towaMessage;
this.dataGridTowageOnArrival.Items.Refresh();
ebd.TOWA = new TOWA();
- this.SublistElementChanged(Message.NotificationClass.TOWA);
+ this.SublistElementChanged(Message.NotificationClass.TOWA);
};
if (ebd.ShowDialog() ?? false)
{
- towa.MessageHeader = _towaMessage;
- _towaMessage.Elements.Add(towa);
+ ebd.CopyValuesToEntity();
+ ebd.TOWA.MessageHeader = _towaMessage;
+ _towaMessage.Elements.Add(ebd.TOWA);
this.dataGridTowageOnArrival.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.TOWA);
}
@@ -197,16 +225,16 @@ namespace ENI2.DetailViewControls
eld.AddClicked += () =>
{
- eld.CopyValuesToEntity();
- _towaMessage.Elements.Add(eld.TOWA);
- this.dataGridTowageOnArrival.Items.Refresh();
+ eld.CopyValuesToEntity();
eld.TOWA = new TOWA();
+ _towaMessage.Elements.Add(eld.TOWA);
eld.TOWA.MessageHeader = _towaMessage;
- this.SublistElementChanged(Message.NotificationClass.TOWA);
+ this.SublistElementChanged(Message.NotificationClass.TOWA);
};
if (eld.ShowDialog() ?? false)
{
+ eld.CopyValuesToEntity();
this.dataGridTowageOnArrival.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.TOWA);
}
diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/WasteDetailControl.xaml b/ENI-2/ENI2/ENI2/DetailViewControls/WasteDetailControl.xaml
index d5999b1c..3f11e8ee 100644
--- a/ENI-2/ENI2/ENI2/DetailViewControls/WasteDetailControl.xaml
+++ b/ENI-2/ENI2/ENI2/DetailViewControls/WasteDetailControl.xaml
@@ -59,7 +59,7 @@
-
+
@@ -71,7 +71,7 @@
-
+
@@ -83,7 +83,7 @@
-
+
@@ -107,7 +107,7 @@
-
+
@@ -119,7 +119,7 @@
-
+
diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/WasteDetailControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailViewControls/WasteDetailControl.xaml.cs
index 2c8d9f9c..855b3ecb 100644
--- a/ENI-2/ENI2/ENI2/DetailViewControls/WasteDetailControl.xaml.cs
+++ b/ENI-2/ENI2/ENI2/DetailViewControls/WasteDetailControl.xaml.cs
@@ -41,6 +41,19 @@ namespace ENI2.DetailViewControls
this.RegisterDatePickerChange(this.datePickerDateLastDisposal, Message.NotificationClass.WAS);
this.RegisterComboboxIndexChange(this.comboBoxWasteDisposal, Message.NotificationClass.WAS);
this.RegisterTextboxChange(this.textBoxWasteDisposalServiceProviders, Message.NotificationClass.WAS);
+ this.checkBoxValidExemption.Checked += CheckBoxValidExemption_Checked;
+ this.checkBoxValidExemption.Unchecked += CheckBoxValidExemption_Checked;
+ }
+
+ private void CheckBoxValidExemption_Checked(object sender, RoutedEventArgs e)
+ {
+ bool on = !(this.checkBoxValidExemption.IsChecked ?? false);
+ this.checkBoxAccurateCorrectDetails.IsEnabled = on;
+ this.comboBoxWasteDisposal.IsEnabled = on;
+ this.textBoxWasteDisposalServiceProviders.IsEnabled = on;
+ this.dataGridWaste.IsEnabled = on;
+ this.locodeCtrlLastWastePort.IsEnabled = on;
+ this.datePickerDateLastDisposal.IsEnabled = on;
}
public override void Initialize()
diff --git a/ENI-2/ENI2/ENI2/ENI2.csproj b/ENI-2/ENI2/ENI2/ENI2.csproj
index 354b1a91..536fb8ab 100644
--- a/ENI-2/ENI2/ENI2/ENI2.csproj
+++ b/ENI-2/ENI2/ENI2/ENI2.csproj
@@ -35,7 +35,7 @@
3.5.1.0
true
publish.html
- 1
+ 4
3.6.13.%2a
false
true
diff --git a/ENI-2/ENI2/ENI2/EditControls/EditCREWDialog.xaml b/ENI-2/ENI2/ENI2/EditControls/EditCREWDialog.xaml
index 0260209b..0d80c2a9 100644
--- a/ENI-2/ENI2/ENI2/EditControls/EditCREWDialog.xaml
+++ b/ENI-2/ENI2/ENI2/EditControls/EditCREWDialog.xaml
@@ -34,15 +34,15 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
+
diff --git a/ENI-2/ENI2/ENI2/EditControls/EditCREWDialog.xaml.cs b/ENI-2/ENI2/ENI2/EditControls/EditCREWDialog.xaml.cs
index a06dc2dd..b7751fdd 100644
--- a/ENI-2/ENI2/ENI2/EditControls/EditCREWDialog.xaml.cs
+++ b/ENI-2/ENI2/ENI2/EditControls/EditCREWDialog.xaml.cs
@@ -31,7 +31,7 @@ namespace ENI2.EditControls
this.textBoxLastName.Text = this.CREW.CrewMemberLastName;
this.textBoxFirstName.Text = this.CREW.CrewMemberFirstName;
this.comboBoxGender.ItemsSource = GlobalStructures.GenderList;
- this.comboBoxGender.KeyUp += ComboBox_KeyUp;
+ //this.comboBoxGender.KeyUp += ComboBox_KeyUp;
this.comboBoxGender.SelectedIndex = this.CREW.CrewMemberGender.HasValue ? this.CREW.CrewMemberGender.Value : -1;
this.textBoxPlaceOfBirth.Text = this.CREW.CrewMemberPlaceOfBirth;
this.comboBoxNationality.ItemsSource = bsmd.database.CREW.NationalityDict;
diff --git a/ENI-2/ENI2/ENI2/EditControls/EditIBCDialog.xaml b/ENI-2/ENI2/ENI2/EditControls/EditIBCDialog.xaml
index bc72283f..540af1d3 100644
--- a/ENI-2/ENI2/ENI2/EditControls/EditIBCDialog.xaml
+++ b/ENI-2/ENI2/ENI2/EditControls/EditIBCDialog.xaml
@@ -43,22 +43,20 @@
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
diff --git a/ENI-2/ENI2/ENI2/EditControls/EditIGCDialog.xaml b/ENI-2/ENI2/ENI2/EditControls/EditIGCDialog.xaml
index ab3107c5..9c359d8f 100644
--- a/ENI-2/ENI2/ENI2/EditControls/EditIGCDialog.xaml
+++ b/ENI-2/ENI2/ENI2/EditControls/EditIGCDialog.xaml
@@ -37,19 +37,15 @@
-
-
-
-
-
-
-
+
+
+
+
-
+
-
-
+
diff --git a/ENI-2/ENI2/ENI2/EditControls/EditIMDGDialog.xaml b/ENI-2/ENI2/ENI2/EditControls/EditIMDGDialog.xaml
index a916afd2..4e88b3ef 100644
--- a/ENI-2/ENI2/ENI2/EditControls/EditIMDGDialog.xaml
+++ b/ENI-2/ENI2/ENI2/EditControls/EditIMDGDialog.xaml
@@ -78,51 +78,49 @@ Copyright (c) 2017 schick Informatik
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ENI-2/ENI2/ENI2/EditControls/EditIMSBCDialog.xaml b/ENI-2/ENI2/ENI2/EditControls/EditIMSBCDialog.xaml
index 8a3b4b2a..32fb4e3f 100644
--- a/ENI-2/ENI2/ENI2/EditControls/EditIMSBCDialog.xaml
+++ b/ENI-2/ENI2/ENI2/EditControls/EditIMSBCDialog.xaml
@@ -40,20 +40,16 @@
-
+
-
-
-
-
-
+
+
-
+
-
-
+
diff --git a/ENI-2/ENI2/ENI2/EditControls/EditLADGDialog.xaml.cs b/ENI-2/ENI2/ENI2/EditControls/EditLADGDialog.xaml.cs
index 88a8a4c1..908b4dbc 100644
--- a/ENI-2/ENI2/ENI2/EditControls/EditLADGDialog.xaml.cs
+++ b/ENI-2/ENI2/ENI2/EditControls/EditLADGDialog.xaml.cs
@@ -24,6 +24,11 @@ namespace ENI2.EditControls
Properties.Resources.textTransit
};
+ private static string[] handlinTypeListDE =
+ {
+ Properties.Resources.textLoading,
+ Properties.Resources.textDischarge
+ };
public EditLADGDialog()
{
@@ -33,13 +38,19 @@ namespace ENI2.EditControls
public LADG LADG { get; set; }
+ public MessageCore Core { get; set; }
+
#region event handler
private void EditLADGDialog_Loaded(object sender, RoutedEventArgs e)
{
this.OKClicked += EditLADGDialog_OKClicked;
- this.comboBoxHandlingType.ItemsSource = handlingTypeList;
+ if (this.Core.IsDK)
+ this.comboBoxHandlingType.ItemsSource = handlingTypeList;
+ else
+ this.comboBoxHandlingType.ItemsSource = handlinTypeListDE;
+
this.comboBoxHandlingType.KeyUp += ComboBox_KeyUp;
if (this.LADG.CargoHandlingType.HasValue)
this.comboBoxHandlingType.SelectedIndex = this.LADG.CargoHandlingType.Value;
@@ -63,6 +74,22 @@ namespace ENI2.EditControls
this.comboBoxNST3Code.ItemsSource = LADG.CargoCodesNST3;
this.comboBoxNST3Code.KeyUp += ComboBox_KeyUp;
this.comboBoxNST3Code.SelectedValue = this.LADG.CargoCodeNST_3;
+
+ this.AddVisible = true;
+
+ }
+
+
+ public void CopyValuesToEntity()
+ {
+ this.LADG.CargoHandlingType = (this.comboBoxHandlingType.SelectedIndex < 0) ? null : (byte?)this.comboBoxHandlingType.SelectedIndex;
+ this.LADG.CargoNumberOfItems = this.integerUpDownNumberOfItems.Value;
+ this.LADG.CargoGrossQuantity_TNE = this.doubleUpDownGrossQuantity.Value;
+ this.LADG.PortOfLoading = this.locodeControl_PortOfLoading.LocodeValue;
+ this.LADG.PortOfDischarge = this.locodeControl_PortOfDischarge.LocodeValue;
+ this.LADG.CargoLACode = (this.comboBoxLACodes.SelectedValue == null) ? null : ((int?)this.comboBoxLACodes.SelectedValue);
+ this.LADG.CargoCodeNST = (string)this.comboBoxNSTCode.SelectedValue;
+ this.LADG.CargoCodeNST_3 = (string)this.comboBoxNST3Code.SelectedValue;
}
private void ComboBoxNSTCode_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
@@ -83,14 +110,7 @@ namespace ENI2.EditControls
private void EditLADGDialog_OKClicked()
{
- this.LADG.CargoHandlingType = (this.comboBoxHandlingType.SelectedIndex < 0) ? null : (byte?) this.comboBoxHandlingType.SelectedIndex;
- this.LADG.CargoNumberOfItems = this.integerUpDownNumberOfItems.Value;
- this.LADG.CargoGrossQuantity_TNE = this.doubleUpDownGrossQuantity.Value;
- this.LADG.PortOfLoading = this.locodeControl_PortOfLoading.LocodeValue;
- this.LADG.PortOfDischarge = this.locodeControl_PortOfDischarge.LocodeValue;
- this.LADG.CargoLACode = (this.comboBoxLACodes.SelectedValue == null) ? null : ((int?)this.comboBoxLACodes.SelectedValue);
- this.LADG.CargoCodeNST = (string) this.comboBoxNSTCode.SelectedValue;
- this.LADG.CargoCodeNST_3 = (string)this.comboBoxNST3Code.SelectedValue;
+ this.CopyValuesToEntity();
}
#endregion
diff --git a/ENI-2/ENI2/ENI2/EditControls/EditMarpolDialog.xaml b/ENI-2/ENI2/ENI2/EditControls/EditMarpolDialog.xaml
index a25d6e6c..9132c311 100644
--- a/ENI-2/ENI2/ENI2/EditControls/EditMarpolDialog.xaml
+++ b/ENI-2/ENI2/ENI2/EditControls/EditMarpolDialog.xaml
@@ -45,9 +45,8 @@
-
-
+
diff --git a/ENI-2/ENI2/ENI2/EditControls/EditPasDialog.xaml b/ENI-2/ENI2/ENI2/EditControls/EditPasDialog.xaml
index 6f742f25..7330f814 100644
--- a/ENI-2/ENI2/ENI2/EditControls/EditPasDialog.xaml
+++ b/ENI-2/ENI2/ENI2/EditControls/EditPasDialog.xaml
@@ -37,17 +37,17 @@
-
-
+
+
-
+
-
-
-
-
+
+
+
+
diff --git a/ENI-2/ENI2/ENI2/EditControls/EditPasDialog.xaml.cs b/ENI-2/ENI2/ENI2/EditControls/EditPasDialog.xaml.cs
index 68a33fa8..e57b0cf8 100644
--- a/ENI-2/ENI2/ENI2/EditControls/EditPasDialog.xaml.cs
+++ b/ENI-2/ENI2/ENI2/EditControls/EditPasDialog.xaml.cs
@@ -42,8 +42,8 @@ namespace ENI2.EditControls
this.comboBoxIdDocType.SelectedIndex = this.PAS.PassengerIdentityDocumentType.HasValue ? this.PAS.PassengerIdentityDocumentType.Value : -1;
this.textBoxIdDocNumber.Text = this.PAS.PassengerIdentityDocumentId;
this.textBoxVisaNumber.Text = this.PAS.PassengerVisaNumber;
- this.textBoxPortOfEmbarkation.Text = this.PAS.PassengerPortOfEmbarkation;
- this.textBoxPortOfDisEmbarkation.Text = this.PAS.PassengerPortOfDisembarkation;
+ this.locodePortOfEmbarkation.LocodeValue = this.PAS.PassengerPortOfEmbarkation;
+ this.locodePortOfDisembarkation.LocodeValue = this.PAS.PassengerPortOfDisembarkation;
this.checkBoxTransitPassenger.IsChecked = this.PAS.PassengerInTransit;
this.OKClicked += EditPasDialog_OKClicked;
this.AddVisible = true;
@@ -61,8 +61,8 @@ namespace ENI2.EditControls
this.PAS.PassengerIdentityDocumentType = (this.comboBoxIdDocType.SelectedIndex == -1) ? null : (byte?)this.comboBoxIdDocType.SelectedIndex;
this.PAS.PassengerIdentityDocumentId = this.textBoxIdDocNumber.Text.Trim();
this.PAS.PassengerVisaNumber = this.textBoxVisaNumber.Text.Trim();
- this.PAS.PassengerPortOfEmbarkation = this.textBoxPortOfEmbarkation.Text.Trim();
- this.PAS.PassengerPortOfDisembarkation = this.textBoxPortOfDisEmbarkation.Text.Trim();
+ this.PAS.PassengerPortOfEmbarkation = this.locodePortOfEmbarkation.LocodeValue;
+ this.PAS.PassengerPortOfDisembarkation = this.locodePortOfDisembarkation.LocodeValue;
this.PAS.PassengerInTransit = this.checkBoxTransitPassenger.IsChecked;
}
diff --git a/ENI-2/ENI2/ENI2/EditControls/EditPortOfItineraryDialog.xaml b/ENI-2/ENI2/ENI2/EditControls/EditPortOfItineraryDialog.xaml
index bb62844c..38a23d45 100644
--- a/ENI-2/ENI2/ENI2/EditControls/EditPortOfItineraryDialog.xaml
+++ b/ENI-2/ENI2/ENI2/EditControls/EditPortOfItineraryDialog.xaml
@@ -21,7 +21,7 @@
-
+
diff --git a/ENI-2/ENI2/ENI2/EditControls/EditSERVDialog.xaml.cs b/ENI-2/ENI2/ENI2/EditControls/EditSERVDialog.xaml.cs
index f91e8b07..c2284d7f 100644
--- a/ENI-2/ENI2/ENI2/EditControls/EditSERVDialog.xaml.cs
+++ b/ENI-2/ENI2/ENI2/EditControls/EditSERVDialog.xaml.cs
@@ -28,14 +28,20 @@ namespace ENI2.EditControls
this.textBoxServiceName.Text = this.SERV.ServiceName;
this.textBoxServiceBeneficiary.Text = this.SERV.ServiceBeneficiary;
this.textBoxServiceInvoiceRecipient.Text = this.SERV.ServiceInvoiceRecipient;
+ this.AddVisible = true;
}
- private void EditSERVDialog_OKClicked()
+ public void CopyValuesToEntity()
{
// copy back
this.SERV.ServiceName = this.textBoxServiceName.Text.Trim();
this.SERV.ServiceBeneficiary = this.textBoxServiceBeneficiary.Text.Trim();
- this.SERV.ServiceInvoiceRecipient = this.textBoxServiceInvoiceRecipient.Text.Trim();
+ this.SERV.ServiceInvoiceRecipient = this.textBoxServiceInvoiceRecipient.Text.Trim();
+ }
+
+ private void EditSERVDialog_OKClicked()
+ {
+ this.CopyValuesToEntity();
}
public SERV SERV { get; set; }
diff --git a/ENI-2/ENI2/ENI2/EditControls/EditTOWDialog.xaml b/ENI-2/ENI2/ENI2/EditControls/EditTOWDialog.xaml
index 7673109a..f3857226 100644
--- a/ENI-2/ENI2/ENI2/EditControls/EditTOWDialog.xaml
+++ b/ENI-2/ENI2/ENI2/EditControls/EditTOWDialog.xaml
@@ -45,16 +45,16 @@
-
-
-
-
-
+
+
+
+
+
-
+
@@ -65,14 +65,15 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/ENI-2/ENI2/ENI2/EditControls/EditWasteDialog.xaml b/ENI-2/ENI2/ENI2/EditControls/EditWasteDialog.xaml
index 8de61fde..80a0fd23 100644
--- a/ENI-2/ENI2/ENI2/EditControls/EditWasteDialog.xaml
+++ b/ENI-2/ENI2/ENI2/EditControls/EditWasteDialog.xaml
@@ -39,12 +39,12 @@
-
-
-
-
+
+
+
+
-
+
diff --git a/ENI-2/ENI2/ENI2/LocalizedLookup.cs b/ENI-2/ENI2/ENI2/LocalizedLookup.cs
index ce4c02bd..3aeafbbb 100644
--- a/ENI-2/ENI2/ENI2/LocalizedLookup.cs
+++ b/ENI-2/ENI2/ENI2/LocalizedLookup.cs
@@ -166,6 +166,10 @@ namespace ENI2
string description = null;
if (!reader.IsDBNull(0)) code = reader.GetString(0);
if (!reader.IsDBNull(1)) description = reader.GetString(1);
+
+ if ((code != null) && (code.Length == 1))
+ code = string.Format("0{0}", code); // bei einstelligen Werten 0 voranstellen
+
if ((code != null) && (description != null))
result[code] = string.Format("{0} {1}", code, description);
}
diff --git a/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs b/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs
index f06959ee..9716e053 100644
--- a/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs
+++ b/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs
@@ -1163,6 +1163,24 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Copy to HAZD.
+ ///
+ public static string textCopyToHAZD {
+ get {
+ return ResourceManager.GetString("textCopyToHAZD", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Copy TOWA to TOWD.
+ ///
+ public static string textCopyTOWATOWD {
+ get {
+ return ResourceManager.GetString("textCopyTOWATOWD", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Country.
///
diff --git a/ENI-2/ENI2/ENI2/Properties/Resources.resx b/ENI-2/ENI2/ENI2/Properties/Resources.resx
index a8eeba7a..d6215b7e 100644
--- a/ENI-2/ENI2/ENI2/Properties/Resources.resx
+++ b/ENI-2/ENI2/ENI2/Properties/Resources.resx
@@ -1426,4 +1426,10 @@
Status info
+
+ Copy TOWA to TOWD
+
+
+ Copy to HAZD
+
\ No newline at end of file
diff --git a/Stundensheet.xlsx b/Stundensheet.xlsx
index 7a5b80d0..3226b8d1 100644
Binary files a/Stundensheet.xlsx and b/Stundensheet.xlsx differ
diff --git a/nsw/Source/bsmd.ExcelReadService/ExcelReader.cs b/nsw/Source/bsmd.ExcelReadService/ExcelReader.cs
index 1010f5a5..f3fe7167 100644
--- a/nsw/Source/bsmd.ExcelReadService/ExcelReader.cs
+++ b/nsw/Source/bsmd.ExcelReadService/ExcelReader.cs
@@ -147,7 +147,7 @@ namespace bsmd.ExcelReadService
string portName = LocodeDB.PortNameFromLocode(val);
if(portName == null)
{
- this.Conf.ConfirmText(lookup, null, ReadState.WARN);
+ this.Conf.ConfirmText(lookup, val, ReadState.WARN);
}
else
{
diff --git a/nsw/Source/bsmd.ExcelReadService/Util.cs b/nsw/Source/bsmd.ExcelReadService/Util.cs
index 0327fd1f..c4988510 100644
--- a/nsw/Source/bsmd.ExcelReadService/Util.cs
+++ b/nsw/Source/bsmd.ExcelReadService/Util.cs
@@ -134,12 +134,18 @@ namespace bsmd.ExcelReadService
// save all messages now
- foreach(Message message in messages)
- {
- message.CreatedBy = "EXCEL";
- DBManager.Instance.Save(message);
- message.SaveElements();
- }
+ //if (!(messageCore.ExcelImportComplete ?? false))
+ //{
+ // messageCore.ExcelImportComplete = true;
+ // DBManager.Instance.Save(messageCore);
+
+ foreach (Message message in messages)
+ {
+ message.CreatedBy = "EXCEL";
+ DBManager.Instance.Save(message);
+ message.SaveElements();
+ }
+ //}
return true;
}
diff --git a/nsw/Source/bsmd.database/DBManager.cs b/nsw/Source/bsmd.database/DBManager.cs
index 0470777d..4abcaa35 100644
--- a/nsw/Source/bsmd.database/DBManager.cs
+++ b/nsw/Source/bsmd.database/DBManager.cs
@@ -309,6 +309,27 @@ namespace bsmd.database
return messageList;
}
+ public Message GetMessage(MessageCore core, Message.NotificationClass notificationClass)
+ {
+ Message aMessage = new Message();
+ SqlCommand cmd = new SqlCommand();
+ aMessage.PrepareLoadCommand(cmd, Message.LoadFilter.BY_CORE_AND_CLASS, core.Id, notificationClass);
+ IDataReader reader = this.PerformCommand(cmd);
+ List messages = aMessage.LoadList(reader);
+
+ Message result = null;
+ if(!messages.IsNullOrEmpty())
+ {
+ result = (Message) messages[0]; // es kann nur eine sein
+ result.MessageCore = core;
+ // TODO: abhängige Listen laden?
+ }
+
+ if (this._closeConnectionAfterUse) this.Disconnect();
+ return result;
+ }
+
+
public string GetShipNameFromCore(MessageCore core)
{
foreach(Message message in this.GetMessagesForCore(core, MessageLoad.ALL))
diff --git a/nsw/Source/bsmd.database/IBCPosition.cs b/nsw/Source/bsmd.database/IBCPosition.cs
index d04ae444..227af60b 100644
--- a/nsw/Source/bsmd.database/IBCPosition.cs
+++ b/nsw/Source/bsmd.database/IBCPosition.cs
@@ -236,5 +236,27 @@ namespace bsmd.database
#endregion
+ #region public methods
+
+ public void CopyFromIBC(IBCPosition selectedIBC)
+ {
+ if (selectedIBC == null) return;
+
+ this.FlashpointInformation = selectedIBC.FlashpointInformation;
+ this.Flashpoint_CEL = selectedIBC.Flashpoint_CEL;
+ this.Hazards = selectedIBC.Hazards;
+ this.PollutionCategory = selectedIBC.PollutionCategory;
+ this.PortOfDischarge = selectedIBC.PortOfDischarge;
+ this.PortOfLoading = selectedIBC.PortOfLoading;
+ this.ProductName = selectedIBC.ProductName;
+ this.Quantity_KGM = selectedIBC.Quantity_KGM;
+ this.Remarks = selectedIBC.Remarks;
+ this.SpecRef15_19 = selectedIBC.SpecRef15_19;
+ this.StowagePosition = selectedIBC.StowagePosition;
+
+ }
+
+ #endregion
+
}
}
diff --git a/nsw/Source/bsmd.database/IGCPosition.cs b/nsw/Source/bsmd.database/IGCPosition.cs
index 4cd86344..05b78d46 100644
--- a/nsw/Source/bsmd.database/IGCPosition.cs
+++ b/nsw/Source/bsmd.database/IGCPosition.cs
@@ -145,5 +145,24 @@ namespace bsmd.database
#endregion
+ #region public methods
+
+ public void CopyFromIGC(IGCPosition selectedIGC)
+ {
+ if (selectedIGC == null) return;
+ this.IMOClass = selectedIGC.IMOClass;
+ this.PortOfDischarge = selectedIGC.PortOfDischarge;
+ this.PortOfLoading = selectedIGC.PortOfLoading;
+ this.ProductName = selectedIGC.ProductName;
+ this.Quantity_KGM = selectedIGC.Quantity_KGM;
+ this.Remarks = selectedIGC.Remarks;
+ this.StowagePosition = selectedIGC.StowagePosition;
+ this.UNNumber = selectedIGC.UNNumber;
+
+ }
+
+ #endregion
+
+
}
}
diff --git a/nsw/Source/bsmd.database/IMDGPosition.cs b/nsw/Source/bsmd.database/IMDGPosition.cs
index 6d5732fb..11dbe2b0 100644
--- a/nsw/Source/bsmd.database/IMDGPosition.cs
+++ b/nsw/Source/bsmd.database/IMDGPosition.cs
@@ -296,7 +296,7 @@ namespace bsmd.database
"Identifier = @P32, Bay = @P33, [Row] = @P34, Tier = @P35 WHERE Id = @ID", this.Tablename);
}
- }
+ }
public override void PrepareLoadCommand(IDbCommand cmd, Message.LoadFilter filter, params object[] criteria)
{
@@ -408,5 +408,49 @@ namespace bsmd.database
#endregion
+ #region public methods
+
+ public void CopyFromIMDG(IMDGPosition selectedIMDG)
+ {
+ if (selectedIMDG == null) return;
+ this.Bay = selectedIMDG.Bay;
+ this.Class7Category = selectedIMDG.Class7Category;
+ this.Class7CSI = selectedIMDG.Class7CSI;
+ this.Class7MaxActivity_BQL = selectedIMDG.Class7MaxActivity_BQL;
+ this.Class7NuclideName = selectedIMDG.Class7NuclideName;
+ this.Class7TransportIndex = selectedIMDG.Class7TransportIndex;
+ this.CompatibilityGroup = selectedIMDG.CompatibilityGroup;
+ this.ContainerNumber = selectedIMDG.ContainerNumber;
+ this.ControlTemperature_CEL = selectedIMDG.ControlTemperature_CEL;
+ this.EmergencyTemperature_CEL = selectedIMDG.EmergencyTemperature_CEL;
+ this.ExceptedQuantities = selectedIMDG.ExceptedQuantities;
+ this.Flashpoint_CEL = selectedIMDG.Flashpoint_CEL;
+ this.GeneralCargoIBC = selectedIMDG.GeneralCargoIBC;
+ this.GrossQuantity_KGM = selectedIMDG.GrossQuantity_KGM;
+ this.IMOClass = selectedIMDG.IMOClass;
+ this.LimitedQuantities = selectedIMDG.LimitedQuantities;
+ this.MarinePollutant = selectedIMDG.MarinePollutant;
+ this.NetExplosiveMass_KGM = selectedIMDG.NetExplosiveMass_KGM;
+ this.NetQuantity_KGM = selectedIMDG.NetQuantity_KGM;
+ this.NumberOfPackages = selectedIMDG.NumberOfPackages;
+ this.PackageType = selectedIMDG.PackageType;
+ this.PackingGroup = selectedIMDG.PackingGroup;
+ this.PortOfDischarge = selectedIMDG.PortOfDischarge;
+ this.PortOfLoading = selectedIMDG.PortOfLoading;
+ this.ProperShippingName = selectedIMDG.ProperShippingName;
+ this.Remarks = selectedIMDG.Remarks;
+ this.Row = selectedIMDG.Row;
+ this.StowagePosition = selectedIMDG.StowagePosition;
+ this.SubsidiaryRiskText = selectedIMDG.SubsidiaryRiskText;
+ this.TechnicalName = selectedIMDG.TechnicalName;
+ this.Tier = selectedIMDG.Tier;
+ this.UNNumber = selectedIMDG.UNNumber;
+ this.VehicleLicenseNumber = selectedIMDG.VehicleLicenseNumber;
+ this.Volume_MTQ = selectedIMDG.Volume_MTQ;
+
+ }
+
+ #endregion
+
}
}
diff --git a/nsw/Source/bsmd.database/IMSBCPosition.cs b/nsw/Source/bsmd.database/IMSBCPosition.cs
index 320bbbe1..21223e67 100644
--- a/nsw/Source/bsmd.database/IMSBCPosition.cs
+++ b/nsw/Source/bsmd.database/IMSBCPosition.cs
@@ -151,5 +151,25 @@ namespace bsmd.database
#endregion
+ #region public methods
+
+ public void CopyFromIMSBC(IMSBCPosition selectedIMSBC)
+ {
+ if (selectedIMSBC == null) return;
+
+ this.BulkCargoShippingName = selectedIMSBC.BulkCargoShippingName;
+ this.IMOClass = selectedIMSBC.IMOClass;
+ this.MHB = selectedIMSBC.MHB;
+ this.PortOfDischarge = selectedIMSBC.PortOfDischarge;
+ this.PortOfLoading = selectedIMSBC.PortOfLoading;
+ this.Quantity_KGM = selectedIMSBC.Quantity_KGM;
+ this.Remarks = selectedIMSBC.Remarks;
+ this.StowagePosition = selectedIMSBC.StowagePosition;
+ this.UNNumber = selectedIMSBC.UNNumber;
+
+ }
+
+ #endregion
+
}
}
diff --git a/nsw/Source/bsmd.database/ImportValue.cs b/nsw/Source/bsmd.database/ImportValue.cs
index 7d1ea2d2..3366adf1 100644
--- a/nsw/Source/bsmd.database/ImportValue.cs
+++ b/nsw/Source/bsmd.database/ImportValue.cs
@@ -11,11 +11,25 @@ namespace bsmd.database
{
public class ImportValue : DatabaseEntity
{
+
+ #region Construction
+
public ImportValue()
{
this.tablename = "[dbo].[ImportValue]";
}
+ #endregion
+
+ #region Enumeration
+
+ public enum ValueStatus
+ {
+ REJECTED,
+ CONFIRMED
+ };
+
+ #endregion
#region Properties
@@ -29,6 +43,8 @@ namespace bsmd.database
public int? Identifier { get; set; }
+ public ValueStatus? Status { get; set; }
+
#endregion
#region DatabaseEntity implementation
@@ -45,7 +61,8 @@ namespace bsmd.database
if (!reader.IsDBNull(2)) iv.NotificationClass = (Message.NotificationClass)Enum.ToObject(typeof(Message.NotificationClass), reader.GetByte(2));
if (!reader.IsDBNull(3)) iv.Name = reader.GetString(3);
if (!reader.IsDBNull(4)) iv.Value = reader.GetString(4);
- if (!reader.IsDBNull(5)) iv.Identifier = reader.GetInt32(5);
+ if (!reader.IsDBNull(5)) iv.Identifier = reader.GetInt32(5);
+ if (!reader.IsDBNull(6)) iv.Status = (ValueStatus)Enum.ToObject(typeof(ValueStatus), reader.GetByte(6));
result.Add(iv);
}
@@ -78,20 +95,21 @@ namespace bsmd.database
scmd.Parameters.AddWithNullableValue("@NCLASS", this.NotificationClass);
scmd.Parameters.AddWithNullableValue("@NAME", this.Name);
scmd.Parameters.AddWithNullableValue("@VALUE", this.Value);
- scmd.Parameters.AddWithNullableValue("@IDENTIFIER", this.Identifier);
+ scmd.Parameters.AddWithNullableValue("@IDENTIFIER", this.Identifier);
+ scmd.Parameters.AddWithNullableValue("@STATUS", this.Status);
if (this.IsNew)
{
this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
- scmd.CommandText = string.Format("INSERT INTO {0} (Id, ImportHeaderId, NotificationClass, Name, Value, Identifiert) VALUES " +
- "(@ID, @IHID, @NCLASS, @NAME, @VALUE, @IDENTIFIER)", this.Tablename);
+ scmd.CommandText = string.Format("INSERT INTO {0} (Id, ImportHeaderId, NotificationClass, Name, Value, Identifier, Status) VALUES " +
+ "(@ID, @IHID, @NCLASS, @NAME, @VALUE, @IDENTIFIER, @STATUS)", this.Tablename);
}
else
{
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("UPDATE {0} SET ImportHeaderId = @IHID, NotificationClass = @NCLASS, Name = @NAME, Value = @VALUE, " +
- "Identifier = @IDENTIFIER WHERE Id = @ID", this.Tablename);
+ "Identifier = @IDENTIFIER, Status = @STATUS WHERE Id = @ID", this.Tablename);
}
}
diff --git a/nsw/Source/bsmd.database/MARPOL_Annex_I_Position.cs b/nsw/Source/bsmd.database/MARPOL_Annex_I_Position.cs
index 80b43296..e779d3a7 100644
--- a/nsw/Source/bsmd.database/MARPOL_Annex_I_Position.cs
+++ b/nsw/Source/bsmd.database/MARPOL_Annex_I_Position.cs
@@ -167,5 +167,21 @@ namespace bsmd.database
#endregion
+ #region public methods
+
+ public void CopyFromMARPOL(MARPOL_Annex_I_Position selectedMARPOL)
+ {
+ this.FlashpointInformation = selectedMARPOL.FlashpointInformation;
+ this.Flashpoint_CEL = selectedMARPOL.Flashpoint_CEL;
+ this.Name = selectedMARPOL.Name;
+ this.PortOfDischarge = selectedMARPOL.PortOfDischarge;
+ this.PortOfLoading = selectedMARPOL.PortOfLoading;
+ this.Quantity_KGM = selectedMARPOL.Quantity_KGM;
+ this.Remarks = selectedMARPOL.Remarks;
+ this.StowagePosition = selectedMARPOL.StowagePosition;
+ }
+
+ #endregion
+
}
}
diff --git a/nsw/Source/bsmd.database/Message.cs b/nsw/Source/bsmd.database/Message.cs
index e91ae916..72b8582d 100644
--- a/nsw/Source/bsmd.database/Message.cs
+++ b/nsw/Source/bsmd.database/Message.cs
@@ -140,7 +140,8 @@ namespace bsmd.database
QUERY_NSW_STATUS,
NOT_DELETED,
DELETED,
- IMPORTHEADER_ID
+ IMPORTHEADER_ID,
+ BY_CORE_AND_CLASS
}
///
@@ -437,6 +438,13 @@ namespace bsmd.database
((SqlCommand)cmd).Parameters.AddWithValue("@COREID", criteria[0]);
break;
}
+ case LoadFilter.BY_CORE_AND_CLASS:
+ {
+ query += "WHERE MessageCoreId = @COREID AND NotificationClass = @CLASS";
+ ((SqlCommand)cmd).Parameters.AddWithValue("@COREID", criteria[0]);
+ ((SqlCommand)cmd).Parameters.AddWithValue("@CLASS", criteria[1]);
+ break;
+ }
case LoadFilter.ALL:
default:
break;
diff --git a/nsw/Source/bsmd.database/MessageCore.cs b/nsw/Source/bsmd.database/MessageCore.cs
index 583df07f..fd0f9d66 100644
--- a/nsw/Source/bsmd.database/MessageCore.cs
+++ b/nsw/Source/bsmd.database/MessageCore.cs
@@ -199,6 +199,12 @@ namespace bsmd.database
///
public bool? Locked { get; set; }
+ ///
+ /// Flag wird vom ExcelImportTool beim ersten Einlesen gesetzt. Weitere Einlesevorgänge werden nur in der
+ /// Update Tabelle gespeichert, um Änderungen durch den Mitarbeiter im ENI-2 nicht zu überschreiben
+ ///
+ public bool? ExcelImportComplete { get; set; }
+
#region Felder um NSW Statusinformationen zu speichern (abgefragte Daten!)
public bool? Cancelled { get; set; }
@@ -277,6 +283,7 @@ namespace bsmd.database
scmd.Parameters.AddWithNullableValue("@P34", this.StatusCheckErrorCode);
scmd.Parameters.AddWithNullableValue("@P35", this.StatusCheckErrorMessage);
scmd.Parameters.AddWithNullableValue("@P36", this.QueryNSWStatus);
+ scmd.Parameters.AddWithNullableValue("@P37", this.ExcelImportComplete);
if (this.IsNew)
{
@@ -287,9 +294,9 @@ namespace bsmd.database
"HerbergFormTemplateGuid, HerbergReportType, HerbergEmailcontactReportingVessel, HerbergEmail24HrsContact, " +
"ETAKielCanal, HerbergRevDate, ReportStatus, SietasSheetVersion, Incoming, DefaultReportingPartyId, CreateExcel, " +
"EditedBy, TicketNo, Cancelled, VisitIdOrTransitIdCancellable, BlockedNotificationClasses, FreeNotificationClasses, " +
- "OwnNotificationClasses, StatusCheckErrorCode, StatusCheckErrorMessage, QueryNSWStatus) VALUES " +
+ "OwnNotificationClasses, StatusCheckErrorCode, StatusCheckErrorMessage, QueryNSWStatus, ExcelImportComplete) VALUES " +
"(@ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, @P12, @P13, @P14, @P15, @P16, @P17, " +
- "@P18, @P19, @P20, @P21, @P22, @P23, @P24, @P25, @P26, @P27, @P28, @P29, @P30, @P31, @P32, @P33, @P34, @P35, @P36)",
+ "@P18, @P19, @P20, @P21, @P22, @P23, @P24, @P25, @P26, @P27, @P28, @P29, @P30, @P31, @P32, @P33, @P34, @P35, @P36, @P37)",
this.Tablename);
scmd.CommandText = query;
}
@@ -304,7 +311,7 @@ namespace bsmd.database
"SietasSheetVersion = @P23, Incoming = @P24, DefaultReportingPartyId = @P25, CreateExcel = @P26, EditedBy = @P27, " +
"TicketNo = @P28, Cancelled = @P29, VisitIdOrTransitIdCancellable = @P30, BlockedNotificationClasses = @P31, " +
"FreeNotificationClasses = @P32, OwnNotificationClasses = @P33, StatusCheckErrorCode = @P34, StatusCheckErrorMessage = @P35, " +
- "QueryNSWStatus = @P36 WHERE Id = @ID", this.Tablename);
+ "QueryNSWStatus = @P36, ExcelImportComplete = @P37 WHERE Id = @ID", this.Tablename);
scmd.CommandText = query;
}
}
@@ -323,7 +330,8 @@ namespace bsmd.database
"[{0}].[HerbergEmail24HrsContact], [{0}].[ETAKielCanal], [{0}].[HerbergRevDate], [{0}].[ReportStatus], [{0}].[SietasSheetVersion], [{0}].[Incoming], " +
"[{0}].[DefaultReportingPartyId], [{0}].[Created], [{0}].[Changed], [{0}].[CreateExcel], [{0}].[EditedBy], [{0}].[TicketNo], " +
"[{0}].[Cancelled], [{0}].[VisitIdOrTransitIdCancellable], [{0}].[BlockedNotificationClasses], [{0}].[FreeNotificationClasses], " +
- "[{0}].[OwnNotificationClasses], [{0}].[StatusCheckErrorCode], [{0}].[StatusCheckErrorMessage], [{0}].[QueryNSWStatus] FROM {0} ",
+ "[{0}].[OwnNotificationClasses], [{0}].[StatusCheckErrorCode], [{0}].[StatusCheckErrorMessage], [{0}].[QueryNSWStatus], " +
+ "[{0}].[ExcelImportComplete] FROM {0} ",
this.Tablename));
this.SetFilters(sb, cmd, filter, criteria);
@@ -544,6 +552,7 @@ namespace bsmd.database
if (!reader.IsDBNull(36)) core.StatusCheckErrorCode = reader.GetString(36);
if (!reader.IsDBNull(37)) core.StatusCheckErrorMessage = reader.GetString(37);
if (!reader.IsDBNull(38)) core.QueryNSWStatus = reader.GetBoolean(38);
+ if (!reader.IsDBNull(39)) core.ExcelImportComplete = reader.GetBoolean(39);
result.Add(core);
}
diff --git a/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs b/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs
index 61055e9f..dbde6ac7 100644
--- a/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs
+++ b/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs
@@ -2,6 +2,6 @@
[assembly: AssemblyCompany("Informatikbüro Daniel Schick")]
[assembly: AssemblyProduct("BSMD NSW interface")]
-[assembly: AssemblyInformationalVersion("3.6.13")]
+[assembly: AssemblyInformationalVersion("3.6.14")]
[assembly: AssemblyCopyright("Copyright © 2014-2017 Informatikbüro Daniel Schick. All rights reserved.")]
[assembly: AssemblyTrademark("")]
\ No newline at end of file
diff --git a/nsw/Source/bsmd.database/Properties/AssemblyProjectInfo.cs b/nsw/Source/bsmd.database/Properties/AssemblyProjectInfo.cs
index 16da04e1..c7570efc 100644
--- a/nsw/Source/bsmd.database/Properties/AssemblyProjectInfo.cs
+++ b/nsw/Source/bsmd.database/Properties/AssemblyProjectInfo.cs
@@ -1,4 +1,4 @@
using System.Reflection;
-[assembly: AssemblyVersion("3.6.13.*")]
+[assembly: AssemblyVersion("3.6.14.*")]
diff --git a/nsw/Source/bsmd.database/TOWD.cs b/nsw/Source/bsmd.database/TOWD.cs
index 2fcbf393..58c4330a 100644
--- a/nsw/Source/bsmd.database/TOWD.cs
+++ b/nsw/Source/bsmd.database/TOWD.cs
@@ -63,7 +63,7 @@ namespace bsmd.database
[ShowReport]
[MaxLength(100)]
- public string TowageOnDepartureOperatorEmail { get; set; }
+ public string TowageOnDepartureOperatorEmail { get; set; }
[ShowReport]
public double? TowageOnDepartureLengthOverall_MTR { get; set; }
@@ -195,6 +195,31 @@ namespace bsmd.database
#endregion
+ #region public methods
+
+ public void CopyFromTOWA(TOWA copyTOWA)
+ {
+ if(copyTOWA != null)
+ {
+ this.TowageOnDepartureBeam_MTR = copyTOWA.TowageOnArrivalBeam_MTR;
+ this.TowageOnDepartureDraught_DMT = copyTOWA.TowageOnArrivalDraught_DMT;
+ this.TowageOnDepartureFlag = copyTOWA.TowageOnArrivalFlag;
+ this.TowageOnDepartureLengthOverall_MTR = copyTOWA.TowageOnArrivalLengthOverall_MTR;
+ this.TowageOnDepartureName = copyTOWA.TowageOnArrivalName;
+ this.TowageOnDepartureOperatorCity = copyTOWA.TowageOnArrivalOperatorCity;
+ this.TowageOnDepartureOperatorCompanyName = copyTOWA.TowageOnArrivalOperatorCompanyName;
+ this.TowageOnDepartureOperatorCountry = copyTOWA.TowageOnArrivalOperatorCountry;
+ this.TowageOnDepartureOperatorEmail = copyTOWA.TowageOnArrivalOperatorEmail;
+ this.TowageOnDepartureOperatorFax = copyTOWA.TowageOnArrivalOperatorFax;
+ this.TowageOnDepartureOperatorPhone = copyTOWA.TowageOnArrivalOperatorPhone;
+ this.TowageOnDepartureOperatorPostalCode = copyTOWA.TowageOnArrivalOperatorPostalCode;
+ this.TowageOnDepartureOperatorStreetNameAndNumber = copyTOWA.TowageOnArrivalOperatorStreetNameAndNumber;
+ this.TowageOnDepartureRemarks = copyTOWA.TowageOnArrivalRemarks;
+ }
+ }
+
+ #endregion
+
}
}
diff --git a/nsw/Source/bsmd.hisnord/Request.cs b/nsw/Source/bsmd.hisnord/Request.cs
index 9f6dfa6e..3a41f087 100644
--- a/nsw/Source/bsmd.hisnord/Request.cs
+++ b/nsw/Source/bsmd.hisnord/Request.cs
@@ -96,6 +96,7 @@ namespace bsmd.hisnord
{
_log.DebugFormat("preparing {0}", noteMessageDict[notificationClass].MessageNotificationClassDisplay);
noteMessageDict[notificationClass].InternalStatus = Message.BSMDStatus.SENT;
+ noteMessageDict[notificationClass].SentAt = DateTime.Now;
result = noteMessageDict[notificationClass];
}
DBManager.Instance.Save(noteMessageDict[notificationClass]);
@@ -1039,7 +1040,7 @@ namespace bsmd.hisnord
if (mdh.NonAccidentalDeathsDuringVoyage ?? false)
{
- mdh_items.Add(mdh.NonAccidentalDeathsDuringVoyageCount ?? 0);
+ mdh_items.Add((mdh.NonAccidentalDeathsDuringVoyageCount ?? 0).ToString());
mdh_types.Add(ItemsChoiceType5.NonAccidentialDeathsDuringVoyageCount);
}
@@ -1051,7 +1052,7 @@ namespace bsmd.hisnord
if (mdh.NumberOfIllPersonsHigherThanExpected ?? false)
{
- mdh_items.Add(mdh.NumberOfIllPersons ?? 0);
+ mdh_items.Add((mdh.NumberOfIllPersons ?? 0).ToString());
mdh_types.Add(ItemsChoiceType5.NumberOfIllPersons);
}
@@ -1141,13 +1142,16 @@ namespace bsmd.hisnord
pocs.PortOfCallLast30Days[j].PortOfCallLast30DaysDateOfDeparture = mdh.PortOfCallLast30Days[j].PortOfCallLast30DaysDateOfDeparture.Value;
pocs.PortOfCallLast30Days[j].PortOfCallLast30DaysCrewMembersJoined = (mdh.PortOfCallLast30Days[j].PortOfCallLast30DaysCrewMembersJoined ?? false) ? yorntype.Y : yorntype.N;
- List crewJoinedShipList = new List();
- for (int k = 0; k < mdh.PortOfCallLast30Days[j].CrewJoinedShip.Count; k++)
+ if (mdh.PortOfCallLast30Days[j].CrewJoinedShip.Count > 0)
{
- if (!mdh.PortOfCallLast30Days[j].CrewJoinedShip[k].PortOfCallLast30DaysCrewJoinedShipName.IsNullOrEmpty())
- crewJoinedShipList.Add(mdh.PortOfCallLast30Days[j].CrewJoinedShip[k].PortOfCallLast30DaysCrewJoinedShipName);
+ List crewJoinedShipList = new List();
+ for (int k = 0; k < mdh.PortOfCallLast30Days[j].CrewJoinedShip.Count; k++)
+ {
+ if (!mdh.PortOfCallLast30Days[j].CrewJoinedShip[k].PortOfCallLast30DaysCrewJoinedShipName.IsNullOrEmpty())
+ crewJoinedShipList.Add(mdh.PortOfCallLast30Days[j].CrewJoinedShip[k].PortOfCallLast30DaysCrewJoinedShipName);
+ }
+ pocs.PortOfCallLast30Days[j].PortOfCallLast30DaysCrewJoinedShip = crewJoinedShipList.ToArray();
}
- pocs.PortOfCallLast30Days[j].PortOfCallLast30DaysCrewJoinedShip = crewJoinedShipList.ToArray();
}
mdh_items.Add(pocs);
@@ -1418,23 +1422,36 @@ namespace bsmd.hisnord
hn_arrival.TowageOnArrivalBeam_MTR = (float)towa.TowageOnArrivalBeam_MTR.Value;
if (towa.TowageOnArrivalDraught_DMT.HasValue)
hn_arrival.TowageOnArrivalDraught_DMT = (float)towa.TowageOnArrivalDraught_DMT.Value;
- hn_arrival.TowageOnArrivalFlag = towa.TowageOnArrivalFlag;
+ if(!towa.TowageOnArrivalFlag.IsNullOrEmpty())
+ hn_arrival.TowageOnArrivalFlag = towa.TowageOnArrivalFlag;
if (towa.TowageOnArrivalGrossTonnage.HasValue)
hn_arrival.TowageOnArrivalGrossTonnage = towa.TowageOnArrivalGrossTonnage.Value.ToString();
if (towa.TowageOnArrivalLengthOverall_MTR.HasValue)
hn_arrival.TowageOnArrivalLengthOverall_MTR = (float)towa.TowageOnArrivalLengthOverall_MTR.Value;
- hn_arrival.TowageOnArrivalName = towa.TowageOnArrivalName;
+ if(!towa.TowageOnArrivalName.IsNullOrEmpty())
+ hn_arrival.TowageOnArrivalName = towa.TowageOnArrivalName;
+
hn_arrival.TowageOnArrivalOperator = new arrivaloperator();
- hn_arrival.TowageOnArrivalOperator.TowageOnArrivalOperatorCity = towa.TowageOnArrivalOperatorCity;
- hn_arrival.TowageOnArrivalOperator.TowageOnArrivalOperatorCountry = towa.TowageOnArrivalOperatorCountry;
- hn_arrival.TowageOnArrivalOperator.TowageOnArrivalOperatorPostalCode = towa.TowageOnArrivalOperatorPostalCode;
- hn_arrival.TowageOnArrivalOperator.TowageOnArrivalOperatorStreetAndNumber = towa.TowageOnArrivalOperatorStreetNameAndNumber;
- hn_arrival.TowageOnArrivalOperator.TowageOnArrivalOperatorFax = towa.TowageOnArrivalOperatorFax;
- hn_arrival.TowageOnArrivalOperator.TowageOnArrivalOperatorPhone = towa.TowageOnArrivalOperatorPhone;
- hn_arrival.TowageOnArrivalOperator.TowageOnArrivalOperatorEMail = towa.TowageOnArrivalOperatorEmail;
- hn_arrival.TowageOnArrivalOperator.TowageOnArrivalOperatorCompanyName = towa.TowageOnArrivalOperatorCompanyName;
- hn_arrival.TowageOnArrivalPurposeOfCall = towa.TowageOnArrivalPurposeOfCall;
- hn_arrival.TowageOnArrivalRemarks = towa.TowageOnArrivalRemarks;
+ if(!towa.TowageOnArrivalOperatorCity.IsNullOrEmpty())
+ hn_arrival.TowageOnArrivalOperator.TowageOnArrivalOperatorCity = towa.TowageOnArrivalOperatorCity;
+ if(!towa.TowageOnArrivalOperatorCountry.IsNullOrEmpty())
+ hn_arrival.TowageOnArrivalOperator.TowageOnArrivalOperatorCountry = towa.TowageOnArrivalOperatorCountry;
+ if(!towa.TowageOnArrivalOperatorPostalCode.IsNullOrEmpty())
+ hn_arrival.TowageOnArrivalOperator.TowageOnArrivalOperatorPostalCode = towa.TowageOnArrivalOperatorPostalCode;
+ if(!towa.TowageOnArrivalOperatorStreetNameAndNumber.IsNullOrEmpty())
+ hn_arrival.TowageOnArrivalOperator.TowageOnArrivalOperatorStreetAndNumber = towa.TowageOnArrivalOperatorStreetNameAndNumber;
+ if(!towa.TowageOnArrivalOperatorFax.IsNullOrEmpty())
+ hn_arrival.TowageOnArrivalOperator.TowageOnArrivalOperatorFax = towa.TowageOnArrivalOperatorFax;
+ if(!towa.TowageOnArrivalOperatorPhone.IsNullOrEmpty())
+ hn_arrival.TowageOnArrivalOperator.TowageOnArrivalOperatorPhone = towa.TowageOnArrivalOperatorPhone;
+ if(!towa.TowageOnArrivalOperatorEmail.IsNullOrEmpty())
+ hn_arrival.TowageOnArrivalOperator.TowageOnArrivalOperatorEMail = towa.TowageOnArrivalOperatorEmail;
+ if(!towa.TowageOnArrivalOperatorCompanyName.IsNullOrEmpty())
+ hn_arrival.TowageOnArrivalOperator.TowageOnArrivalOperatorCompanyName = towa.TowageOnArrivalOperatorCompanyName;
+ if(!towa.TowageOnArrivalPurposeOfCall.IsNullOrEmpty())
+ hn_arrival.TowageOnArrivalPurposeOfCall = towa.TowageOnArrivalPurposeOfCall;
+ if(!towa.TowageOnArrivalRemarks.IsNullOrEmpty())
+ hn_arrival.TowageOnArrivalRemarks = towa.TowageOnArrivalRemarks;
}
items1ChoiceType.Add(Items1ChoiceType.TOWA);
@@ -1469,23 +1486,33 @@ namespace bsmd.hisnord
hn_departure.TowageOnDepartureBeam_MTR = (float)towd.TowageOnDepartureBeam_MTR.Value;
if (towd.TowageOnDepartureDraught_DMT.HasValue)
hn_departure.TowageOnDepartureDraught_DMT = (float)towd.TowageOnDepartureDraught_DMT.Value;
- hn_departure.TowageOnDepartureFlag = towd.TowageOnDepartureFlag;
- hn_departure.TowageOnDepartureName = towd.TowageOnDepartureName;
+ if(!towd.TowageOnDepartureFlag.IsNullOrEmpty())
+ hn_departure.TowageOnDepartureFlag = towd.TowageOnDepartureFlag;
+ if(!towd.TowageOnDepartureName.IsNullOrEmpty())
+ hn_departure.TowageOnDepartureName = towd.TowageOnDepartureName;
hn_departure.TowageOnDepartureOperator = new departureoperator();
-
- hn_departure.TowageOnDepartureOperator.TowageOnDepartureOperatorCity = towd.TowageOnDepartureOperatorCity;
- hn_departure.TowageOnDepartureOperator.TowageOnDepartureOperatorCountry = towd.TowageOnDepartureOperatorCountry;
- hn_departure.TowageOnDepartureOperator.TowageOnDepartureOperatorPostalCode = towd.TowageOnDepartureOperatorPostalCode;
- hn_departure.TowageOnDepartureOperator.TowageOnDepartureOperatorStreetAndNumber = towd.TowageOnDepartureOperatorStreetNameAndNumber;
- hn_departure.TowageOnDepartureOperator.TowageOnDepartureOperatorFax = towd.TowageOnDepartureOperatorFax;
- hn_departure.TowageOnDepartureOperator.TowageOnDepartureOperatorPhone = towd.TowageOnDepartureOperatorPhone;
- hn_departure.TowageOnDepartureOperator.TowageOnDepartureOperatorEMail = towd.TowageOnDepartureOperatorEmail;
- hn_departure.TowageOnDepartureOperator.TowageOnDepartureOperatorCompanyName = towd.TowageOnDepartureOperatorCompanyName;
+ if(!towd.TowageOnDepartureOperatorCity.IsNullOrEmpty())
+ hn_departure.TowageOnDepartureOperator.TowageOnDepartureOperatorCity = towd.TowageOnDepartureOperatorCity;
+ if(!towd.TowageOnDepartureOperatorCountry.IsNullOrEmpty())
+ hn_departure.TowageOnDepartureOperator.TowageOnDepartureOperatorCountry = towd.TowageOnDepartureOperatorCountry;
+ if(!towd.TowageOnDepartureOperatorPostalCode.IsNullOrEmpty())
+ hn_departure.TowageOnDepartureOperator.TowageOnDepartureOperatorPostalCode = towd.TowageOnDepartureOperatorPostalCode;
+ if(!towd.TowageOnDepartureOperatorStreetNameAndNumber.IsNullOrEmpty())
+ hn_departure.TowageOnDepartureOperator.TowageOnDepartureOperatorStreetAndNumber = towd.TowageOnDepartureOperatorStreetNameAndNumber;
+ if(!towd.TowageOnDepartureOperatorFax.IsNullOrEmpty())
+ hn_departure.TowageOnDepartureOperator.TowageOnDepartureOperatorFax = towd.TowageOnDepartureOperatorFax;
+ if(!towd.TowageOnDepartureOperatorPhone.IsNullOrEmpty())
+ hn_departure.TowageOnDepartureOperator.TowageOnDepartureOperatorPhone = towd.TowageOnDepartureOperatorPhone;
+ if(!towd.TowageOnDepartureOperatorEmail.IsNullOrEmpty())
+ hn_departure.TowageOnDepartureOperator.TowageOnDepartureOperatorEMail = towd.TowageOnDepartureOperatorEmail;
+ if(!towd.TowageOnDepartureOperatorCompanyName.IsNullOrEmpty())
+ hn_departure.TowageOnDepartureOperator.TowageOnDepartureOperatorCompanyName = towd.TowageOnDepartureOperatorCompanyName;
hn_departure.TowageOnDepartureLengthOverall_MTRSpecified = towd.TowageOnDepartureLengthOverall_MTR.HasValue;
if (hn_departure.TowageOnDepartureLengthOverall_MTRSpecified)
hn_departure.TowageOnDepartureLengthOverall_MTR = (float)towd.TowageOnDepartureLengthOverall_MTR.Value;
- hn_departure.TowageOnDepartureRemarks = towd.TowageOnDepartureRemarks;
+ if(!towd.TowageOnDepartureRemarks.IsNullOrEmpty())
+ hn_departure.TowageOnDepartureRemarks = towd.TowageOnDepartureRemarks;
}
items1ChoiceType.Add(Items1ChoiceType.TOWD);
diff --git a/nsw/Source/bsmd.hisnord/Response.cs b/nsw/Source/bsmd.hisnord/Response.cs
index 367aa7db..d82d0489 100644
--- a/nsw/Source/bsmd.hisnord/Response.cs
+++ b/nsw/Source/bsmd.hisnord/Response.cs
@@ -71,12 +71,24 @@ namespace bsmd.hisnord
if (xml.Name == "SystemError")
{
// Fehlernachricht
- SystemError systemError = SystemError.createFromXml(xml);
+ SystemError systemError = SystemError.createFromXml(xml);
+
if (systemError != null)
- {
+ {
MessageCore aCore = DBManager.Instance.GetMessageCoreById(systemError.MessageCoreId);
if (aCore != null)
{
+ Message.NotificationClass notificationClass;
+ if (Enum.TryParse(systemError.Meldetype, out notificationClass))
+ {
+ Message refMessage = DBManager.Instance.GetMessage(aCore, notificationClass);
+ if(refMessage != null)
+ {
+ refMessage.InternalStatus = Message.BSMDStatus.SEND_FAILED;
+ DBManager.Instance.Save(refMessage);
+ }
+ }
+
_log.InfoFormat("SystemError received for Core [{0}], IMO {1} ETA {2}: {3}", aCore.Id, aCore.IMO, aCore.ETADisplay, systemError.ErrorMessage);
}
else
@@ -124,6 +136,8 @@ namespace bsmd.hisnord
if (nswResponse.Status != null)
{
+ aMessage.ReceivedAt = nswResponse.ReceiveAt;
+
bool isAccepted = (nswResponse.Status == "ACCEPTED");
if(isAccepted)
{
@@ -133,33 +147,28 @@ namespace bsmd.hisnord
{
aMessage.InternalStatus = Message.BSMDStatus.VIOLATION;
aMessage.StatusInfo = "Violations reported";
- }
- aMessage.ReceivedAt = nswResponse.ReceiveAt;
+ }
}
else
{
aMessage.Status = Message.MessageStatus.REJECTED;
aMessage.InternalStatus = Message.BSMDStatus.ERROR;
aMessage.StatusInfo = "Errors reported";
- }
-
- DBManager.Instance.Save(aMessage);
+ }
}
#region Error / Violation handling
+ // "alte" Meldungen entfernen
+
foreach (MessageError existingError in aMessage.ErrorList)
DBManager.Instance.Delete(existingError);
foreach (MessageViolation existingViolation in aMessage.ViolationList)
DBManager.Instance.Delete(existingViolation);
- foreach (MessageError messageError in nswResponse.Errors)
- {
- messageError.MessageHeaderId = aMessage.Id.Value;
- messageError.MessageHeader = aMessage;
- DBManager.Instance.Save(messageError);
- }
+ if (!nswResponse.Violations.IsNullOrEmpty())
+ aMessage.InternalStatus = Message.BSMDStatus.VIOLATION;
foreach (MessageViolation messageViolation in nswResponse.Violations)
{
@@ -168,6 +177,21 @@ namespace bsmd.hisnord
DBManager.Instance.Save(messageViolation);
}
+ if (!nswResponse.Errors.IsNullOrEmpty())
+ aMessage.InternalStatus = Message.BSMDStatus.ERROR;
+
+ foreach (MessageError messageError in nswResponse.Errors)
+ {
+ messageError.MessageHeaderId = aMessage.Id.Value;
+ messageError.MessageHeader = aMessage;
+ DBManager.Instance.Save(messageError);
+ }
+
+ _log.InfoFormat("Saving Message {0} Status {1} InternalStatus {2}",
+ aMessage.Id, aMessage.Status, aMessage.InternalStatus);
+
+ DBManager.Instance.Save(aMessage);
+
#endregion
}