diff --git a/ENI-2/ENI2/ENI2/Controls/ClosableTabItem.cs b/ENI-2/ENI2/ENI2/Controls/ClosableTabItem.cs
index 9fff4639..ebbf15f0 100644
--- a/ENI-2/ENI2/ENI2/Controls/ClosableTabItem.cs
+++ b/ENI-2/ENI2/ENI2/Controls/ClosableTabItem.cs
@@ -3,6 +3,7 @@
//
using System;
+using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
@@ -52,7 +53,7 @@ namespace ENI2.Controls
*/
private TextBlock textBlock;
- public event EventHandler TabClosing;
+ public event CancelEventHandler TabClosing;
protected Storyboard BlinkTextStoryboard
{
@@ -142,10 +143,18 @@ namespace ENI2.Controls
closeButton.Click +=
(sender, e) =>
{
- var tabControl = Parent as ItemsControl;
- tabControl.Items.Remove(this);
+ bool abort = false;
if (TabClosing != null)
- this.TabClosing(this, new EventArgs());
+ {
+ CancelEventArgs cancelEventArgs = new CancelEventArgs();
+ this.TabClosing(this, cancelEventArgs);
+ if (cancelEventArgs.Cancel) abort = true;
+ }
+ if (!abort)
+ {
+ var tabControl = Parent as ItemsControl;
+ tabControl.Items.Remove(this);
+ }
};
dockPanel.Children.Add(closeButton);
diff --git a/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs
index 0a4e8bf6..f6948c27 100644
--- a/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs
+++ b/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs
@@ -48,6 +48,11 @@ namespace ENI2
internal event DatabaseEntityWatchdog.DatabaseEntityChangedHandler HighlightReset;
+ public bool HasUnsavedChanges
+ {
+ get { return (this.buttonSave.Visibility == Visibility.Visible); } // schwach aber es wird's tun
+ }
+
#endregion
#region Construction
@@ -370,7 +375,6 @@ namespace ENI2
}
}
}
-
}
#endregion
diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml b/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml
index 07226377..73e594be 100644
--- a/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml
+++ b/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml
@@ -94,7 +94,7 @@
+ SelectionMode="Extended" AutoGenerateColumns="False" Margin="0,5,0,0">
diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml.cs
index 8c8258be..27dfa717 100644
--- a/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml.cs
+++ b/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml.cs
@@ -437,6 +437,7 @@ namespace ENI2.DetailViewControls
{
// are you sure dialog is in base class
_mdh.PortOfCallLast30Days.Remove(poc30d);
+ poc30d.DeleteElements();
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(poc30d);
DatabaseEntity.ResetIdentifiers(_mdh.PortOfCallLast30Days);
this.SublistElementChanged(Message.NotificationClass.MDH);
diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs
index 82684696..cc6495e4 100644
--- a/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs
+++ b/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs
@@ -392,6 +392,18 @@ namespace ENI2.DetailViewControls
MessageBoxResult result = MessageBox.Show(Properties.Resources.textConfirmSend, Properties.Resources.textConfirm, MessageBoxButton.YesNo, MessageBoxImage.Question);
if (result == MessageBoxResult.Yes)
{
+ bool somethingsNotSaved = false;
+ foreach (Message selectedMessage in this.dataGridMessages.SelectedItems)
+ {
+ if (selectedMessage.IsDirty) somethingsNotSaved = true;
+ }
+
+ if(somethingsNotSaved)
+ {
+ if (MessageBox.Show(Properties.Resources.textUnsavedChangesSendAnyWay, Properties.Resources.textConfirmation, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.No)
+ return;
+ }
+
foreach (Message selectedMessage in this.dataGridMessages.SelectedItems)
{
if (selectedMessage.Reset) selectedMessage.Reset = false; // "nochmal" Versenden ist möglich
diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml b/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml
index e197312e..edf525f8 100644
--- a/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml
+++ b/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml
@@ -46,12 +46,13 @@
-
-
-
+
-
+
+
+
+
-
-
+
+
diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/PortNotificationDetailControl.xaml b/ENI-2/ENI2/ENI2/DetailViewControls/PortNotificationDetailControl.xaml
index 8f08a998..920f720c 100644
--- a/ENI-2/ENI2/ENI2/DetailViewControls/PortNotificationDetailControl.xaml
+++ b/ENI-2/ENI2/ENI2/DetailViewControls/PortNotificationDetailControl.xaml
@@ -88,7 +88,7 @@
-
+
diff --git a/ENI-2/ENI2/ENI2/ENI2.csproj b/ENI-2/ENI2/ENI2/ENI2.csproj
index 7f7bcd1a..4b1ac374 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
- 0
+ 2
3.7.5.%2a
false
true
diff --git a/ENI-2/ENI2/ENI2/EditControls/EditLADGDialog.xaml b/ENI-2/ENI2/ENI2/EditControls/EditLADGDialog.xaml
index 4a845d57..d07ce171 100644
--- a/ENI-2/ENI2/ENI2/EditControls/EditLADGDialog.xaml
+++ b/ENI-2/ENI2/ENI2/EditControls/EditLADGDialog.xaml
@@ -41,7 +41,7 @@ Copyright (c) 2017 schick Informatik
-
+
diff --git a/ENI-2/ENI2/ENI2/LocalizedLookup.cs b/ENI-2/ENI2/ENI2/LocalizedLookup.cs
index 3aeafbbb..92226959 100644
--- a/ENI-2/ENI2/ENI2/LocalizedLookup.cs
+++ b/ENI-2/ENI2/ENI2/LocalizedLookup.cs
@@ -52,7 +52,7 @@ namespace ENI2
if (!reader.IsDBNull(1)) portarea = reader.GetString(1);
if((code != null) && (portarea != null))
{
- result[code] = portarea;
+ result[code] = string.Format("{0}-{1}", code, portarea);
}
}
reader.Close();
diff --git a/ENI-2/ENI2/ENI2/MainWindow.xaml.cs b/ENI-2/ENI2/ENI2/MainWindow.xaml.cs
index 7190016b..7e8d71c8 100644
--- a/ENI-2/ENI2/ENI2/MainWindow.xaml.cs
+++ b/ENI-2/ENI2/ENI2/MainWindow.xaml.cs
@@ -141,29 +141,40 @@ namespace ENI2
}
}
- private void SearchResultItem_TabClosing(object sender, EventArgs e)
+ private void SearchResultItem_TabClosing(object sender, CancelEventArgs e)
{
ClosableTabItem tabItem = sender as ClosableTabItem;
if(tabItem != null)
{
- if(lockedCores.ContainsKey(tabItem))
+ DetailRootControl drc = tabItem.Content as DetailRootControl;
+
+ // Test for unsaved changes
+ if(drc.HasUnsavedChanges)
{
- try
- {
- App.LockingServiceClient.Unlock(lockedCores[tabItem], this.userEntity.Id.Value);
- lockedCores.Remove(tabItem);
- }
- catch(Exception ex)
- {
- _log.ErrorFormat("LockingService.Unlock: {0}", ex.Message);
- }
+ if (MessageBox.Show(Properties.Resources.textConfirmWithoutSaving, Properties.Resources.textConfirmation, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.No)
+ e.Cancel = true;
}
- DetailRootControl drc = tabItem.Content as DetailRootControl;
- if (openTabs.ContainsKey(drc.Core.Id.Value))
+ if (!e.Cancel)
{
- this._dbWatchDog.UnRegister(drc.Core);
- openTabs.Remove(drc.Core.Id.Value);
+ if (lockedCores.ContainsKey(tabItem))
+ {
+ try
+ {
+ App.LockingServiceClient.Unlock(lockedCores[tabItem], this.userEntity.Id.Value);
+ lockedCores.Remove(tabItem);
+ }
+ catch (Exception ex)
+ {
+ _log.ErrorFormat("LockingService.Unlock: {0}", ex.Message);
+ }
+ }
+
+ if (openTabs.ContainsKey(drc.Core.Id.Value))
+ {
+ this._dbWatchDog.UnRegister(drc.Core);
+ openTabs.Remove(drc.Core.Id.Value);
+ }
}
}
}
diff --git a/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs b/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs
index 9b656679..6bcf79b3 100644
--- a/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs
+++ b/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs
@@ -1187,6 +1187,15 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Unsaved changes! Do you want to close anyway?.
+ ///
+ public static string textConfirmWithoutSaving {
+ get {
+ return ResourceManager.GetString("textConfirmWithoutSaving", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Construction characteristics.
///
@@ -4022,6 +4031,15 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Some messages have unsaved changes. Send anyway?.
+ ///
+ public static string textUnsavedChangesSendAnyWay {
+ get {
+ return ResourceManager.GetString("textUnsavedChangesSendAnyWay", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to User administration.
///
diff --git a/ENI-2/ENI2/ENI2/Properties/Resources.resx b/ENI-2/ENI2/ENI2/Properties/Resources.resx
index 6de3f785..99c75c3c 100644
--- a/ENI-2/ENI2/ENI2/Properties/Resources.resx
+++ b/ENI-2/ENI2/ENI2/Properties/Resources.resx
@@ -1522,4 +1522,10 @@
This only works if the grid is empty!
+
+ Unsaved changes! Do you want to close anyway?
+
+
+ Some messages have unsaved changes. Send anyway?
+
\ No newline at end of file
diff --git a/ENI-2/ENI2/ENI2/SucheControl.xaml b/ENI-2/ENI2/ENI2/SucheControl.xaml
index ab8d39c6..f7d0c840 100644
--- a/ENI-2/ENI2/ENI2/SucheControl.xaml
+++ b/ENI-2/ENI2/ENI2/SucheControl.xaml
@@ -71,15 +71,16 @@
-
-
+
+
+
+
-
-
+
diff --git a/nsw/Source/bsmd.ExcelReadService/LocodeDB.cs b/nsw/Source/bsmd.ExcelReadService/LocodeDB.cs
index 55f09ed5..8a9d2c9d 100644
--- a/nsw/Source/bsmd.ExcelReadService/LocodeDB.cs
+++ b/nsw/Source/bsmd.ExcelReadService/LocodeDB.cs
@@ -96,7 +96,7 @@ namespace bsmd.ExcelReadService
results.Add(entry);
}
}
- string query = "SELECT locodes.name, city_code, countries.code FROM locodes JOIN countries ON locodes.country_id = countries.ID WHERE locodes.port='t' AND (locodes.name like $PAR OR locodes.name_wo_diacritics like $PAR)";
+ string query = "SELECT locodes.name_wo_diacritics, city_code, countries.code FROM locodes JOIN countries ON locodes.country_id = countries.ID WHERE locodes.port='t' AND (locodes.name like $PAR OR locodes.name_wo_diacritics like $PAR)";
SQLiteCommand cmd = new SQLiteCommand(query, _con);
cmd.Parameters.AddWithValue("$PAR", city);
IDataReader reader = cmd.ExecuteReader();
@@ -143,7 +143,7 @@ namespace bsmd.ExcelReadService
if (locode.Length != 5) return null;
string result = null;
- string query = string.Format("SELECT locodes.name FROM locodes JOIN countries ON locodes.country_id = countries.ID WHERE locodes.port='t' AND locodes.city_code = '{0}' AND countries.code = '{1}'",
+ string query = string.Format("SELECT locodes.name_wo_diacritics FROM locodes JOIN countries ON locodes.country_id = countries.ID WHERE locodes.port='t' AND locodes.city_code = '{0}' AND countries.code = '{1}'",
locode.Substring(2), locode.Substring(0,2));
SQLiteCommand cmd = new SQLiteCommand(query, _con);
IDataReader reader = cmd.ExecuteReader();
diff --git a/nsw/Source/bsmd.database/DBManager.cs b/nsw/Source/bsmd.database/DBManager.cs
index 3d39e5f9..f764d5b8 100644
--- a/nsw/Source/bsmd.database/DBManager.cs
+++ b/nsw/Source/bsmd.database/DBManager.cs
@@ -78,6 +78,7 @@ namespace bsmd.database
{
_con = new SqlConnection(dbConnectionString);
_con.Open();
+ this.ConnectionString = dbConnectionString;
return true;
}
catch (Exception ex)
@@ -242,6 +243,9 @@ namespace bsmd.database
{
this.LoadCustomer(core);
this.LoadSTATShipName(core);
+ this.LoadETA_ETD(core);
+ this.LoadATA(core);
+ this.LoadATD(core);
result.Add(core);
}
@@ -1080,6 +1084,49 @@ namespace bsmd.database
reader.Close();
}
+ internal void LoadETA_ETD(MessageCore core)
+ {
+ if (core == null) return;
+ SqlCommand cmd = new SqlCommand();
+ cmd.CommandText = "SELECT NOA_NOD.ETAToPortOfCall, NOA_NOD.ETDFromPortOfCall FROM NOA_NOD JOIN MessageHeader ON NOA_NOD.MessageHeaderId = MessageHeader.Id WHERE MessageHeader.MessageCoreId = @ID";
+ cmd.Parameters.AddWithValue("@ID", core.Id);
+ SqlDataReader reader = this.PerformCommand(cmd);
+ if (reader.Read())
+ {
+ if (!reader.IsDBNull(0)) core.ETA_NOA_NOD = reader.GetDateTime(0);
+ if (!reader.IsDBNull(1)) core.ETD_NOA_NOD = reader.GetDateTime(1);
+ }
+ reader.Close();
+ }
+
+ internal void LoadATA(MessageCore core)
+ {
+ if (core == null) return;
+ SqlCommand cmd = new SqlCommand();
+ cmd.CommandText = "SELECT ATA.ATAPortOfCall FROM ATA JOIN MessageHeader ON ATA.MessageHeaderId = MessageHeader.Id WHERE MessageHeader.MessageCoreId = @ID";
+ cmd.Parameters.AddWithValue("@ID", core.Id);
+ SqlDataReader reader = this.PerformCommand(cmd);
+ if (reader.Read())
+ {
+ if (!reader.IsDBNull(0)) core.ATA = reader.GetDateTime(0);
+ }
+ reader.Close();
+ }
+
+ internal void LoadATD(MessageCore core)
+ {
+ if (core == null) return;
+ SqlCommand cmd = new SqlCommand();
+ cmd.CommandText = "SELECT ATD.ATDPortOfCall FROM ATD JOIN MessageHeader ON ATD.MessageHeaderId = MessageHeader.Id WHERE MessageHeader.MessageCoreId = @ID";
+ cmd.Parameters.AddWithValue("@ID", core.Id);
+ SqlDataReader reader = this.PerformCommand(cmd);
+ if (reader.Read())
+ {
+ if (!reader.IsDBNull(0)) core.ATD = reader.GetDateTime(0);
+ }
+ reader.Close();
+ }
+
internal Dictionary LoadErrorTexts()
{
SqlCommand cmd = new SqlCommand();
diff --git a/nsw/Source/bsmd.database/MessageCore.cs b/nsw/Source/bsmd.database/MessageCore.cs
index a59e3497..11243b48 100644
--- a/nsw/Source/bsmd.database/MessageCore.cs
+++ b/nsw/Source/bsmd.database/MessageCore.cs
@@ -190,9 +190,25 @@ namespace bsmd.database
public string EditedBy { get; set; }
///
- /// ENI-2
+ /// ENI-2 display prop
///
public string Shipname { get; set; }
+ ///
+ /// ENI-2 display prop
+ ///
+ public DateTime? ETA_NOA_NOD { get; set; }
+ ///
+ /// ENI-2 display prop
+ ///
+ public DateTime? ETD_NOA_NOD { get; set; }
+ ///
+ /// ENI-2 display prop
+ ///
+ public DateTime? ATA { get; set; }
+ ///
+ /// ENI-2 display prop
+ ///
+ public DateTime? ATD { get; set; }
///
/// Flag zeigt an ob ein Excelsheet erzeugt werden soll
diff --git a/nsw/Source/bsmd.database/PortOfCallLast30Days.cs b/nsw/Source/bsmd.database/PortOfCallLast30Days.cs
index 597f4633..7e3e529c 100644
--- a/nsw/Source/bsmd.database/PortOfCallLast30Days.cs
+++ b/nsw/Source/bsmd.database/PortOfCallLast30Days.cs
@@ -218,7 +218,7 @@ namespace bsmd.database
{
foreach (PortOfCallLast30DaysCrewJoinedShip cjs in this.CrewJoinedShip)
{
- DBManager.Instance.Delete(cjs);
+ DBManager.GetSingleCon(DBManager.Instance.ConnectionString).Delete(cjs);
}
this.CrewJoinedShip.Clear();
}
diff --git a/nsw/Source/bsmd.database/XtraSendLogic.cs b/nsw/Source/bsmd.database/XtraSendLogic.cs
index 81901355..70b8ed13 100644
--- a/nsw/Source/bsmd.database/XtraSendLogic.cs
+++ b/nsw/Source/bsmd.database/XtraSendLogic.cs
@@ -120,6 +120,38 @@ namespace bsmd.database
}
}
+ if (message.MessageNotificationClass == Message.NotificationClass.TIEFA)
+ {
+ if (message.Elements.Count > 0)
+ {
+ bsmd.database.TIEFA tiefa = message.Elements[0] as bsmd.database.TIEFA;
+ if (!tiefa.DraughtUponArrival_DMT.HasValue)
+ {
+ message.StatusInfo = "TIEFA without value";
+ return false;
+ }
+ }
+ }
+
+ if (message.MessageNotificationClass == Message.NotificationClass.TIEFD)
+ {
+ if (message.Elements.Count > 0)
+ {
+ bsmd.database.TIEFD tiefd = message.Elements[0] as bsmd.database.TIEFD;
+ if (!tiefd.DraughtUponDeparture_DMT.HasValue)
+ {
+ message.StatusInfo = "TIEFD without value";
+ return false;
+ }
+ }
+ }
+
+ if (Message.IsListClass(message.MessageNotificationClass) && (message.Elements.Count == 0))
+ {
+ message.StatusInfo = "empty list message type";
+ return false;
+ }
+
return true;
}
}
diff --git a/nsw/Source/bsmd.hisnord/Request.cs b/nsw/Source/bsmd.hisnord/Request.cs
index 147882f4..8f8677f9 100644
--- a/nsw/Source/bsmd.hisnord/Request.cs
+++ b/nsw/Source/bsmd.hisnord/Request.cs
@@ -193,14 +193,19 @@ namespace bsmd.hisnord
hn_stat.Flag = stat.Flag;
if (stat.GrossTonnage.HasValue)
hn_stat.GrossTonnage = stat.GrossTonnage.Value.ToString();
- hn_stat.InmarsatCallNumber = stat.InmarsatCallNumber;
+ if(!stat.InmarsatCallNumber.IsNullOrEmpty())
+ hn_stat.InmarsatCallNumber = stat.InmarsatCallNumber;
hn_stat.ISMCompany = new ismcompany();
- hn_stat.ISMCompany.ISMCompanyCity = stat.ISMCompanyCity;
- hn_stat.ISMCompany.ISMCompanyCountry = stat.ISMCompanyCountry;
+ if(!stat.ISMCompanyCity.IsNullOrEmpty())
+ hn_stat.ISMCompany.ISMCompanyCity = stat.ISMCompanyCity;
+ if(!stat.ISMCompanyCountry.IsNullOrEmpty())
+ hn_stat.ISMCompany.ISMCompanyCountry = stat.ISMCompanyCountry;
hn_stat.ISMCompany.ISMCompanyId = stat.ISMCompanyId;
hn_stat.ISMCompany.ISMCompanyName = stat.ISMCompanyName;
- hn_stat.ISMCompany.ISMCompanyPostalCode = stat.ISMCompanyPostalCode;
- hn_stat.ISMCompany.ISMCompanyStreetAndNumber = stat.ISMCompanyStreetAndNumber;
+ if(!stat.ISMCompanyPostalCode.IsNullOrEmpty())
+ hn_stat.ISMCompany.ISMCompanyPostalCode = stat.ISMCompanyPostalCode;
+ if(!stat.ISMCompanyStreetAndNumber.IsNullOrEmpty())
+ hn_stat.ISMCompany.ISMCompanyStreetAndNumber = stat.ISMCompanyStreetAndNumber;
if (stat.LengthOverall_MTR.HasValue)
hn_stat.LengthOverall_MTR = (float)stat.LengthOverall_MTR.Value;
hn_stat.MMSINumber = stat.MMSINumber;
@@ -832,14 +837,23 @@ namespace bsmd.hisnord
{
secItemNames.Add(ItemsChoiceType4.CSOLastName);
secItems.Add(sec.CSOLastName);
- secItemNames.Add(ItemsChoiceType4.CSOFirstName);
- secItems.Add(sec.CSOFirstName);
+ if (!sec.CSOFirstName.IsNullOrEmpty())
+ {
+ secItemNames.Add(ItemsChoiceType4.CSOFirstName);
+ secItems.Add(sec.CSOFirstName);
+ }
secItemNames.Add(ItemsChoiceType4.CSOPhone);
secItems.Add(sec.CSOPhone);
- secItemNames.Add(ItemsChoiceType4.CSOFax);
- secItems.Add(sec.CSOFax);
- secItemNames.Add(ItemsChoiceType4.CSOEMail);
- secItems.Add(sec.CSOEMail);
+ if (!sec.CSOFax.IsNullOrEmpty())
+ {
+ secItemNames.Add(ItemsChoiceType4.CSOFax);
+ secItems.Add(sec.CSOFax);
+ }
+ if (!sec.CSOEMail.IsNullOrEmpty())
+ {
+ secItemNames.Add(ItemsChoiceType4.CSOEMail);
+ secItems.Add(sec.CSOEMail);
+ }
secItemNames.Add(ItemsChoiceType4.ValidISSCOnBoard);
secItems.Add((sec.ValidISSCOnBoard ?? false) ? yorntype.Y : yorntype.N);
secItemNames.Add(ItemsChoiceType4.ReasonsForNoValidISSC);
@@ -866,8 +880,11 @@ namespace bsmd.hisnord
secItemNames.Add(ItemsChoiceType4.ApprovedSecurityPlanOnBoard);
secItems.Add(sec.ApprovedSecurityPlanOnBoard.Value ? yorntype.Y : yorntype.N);
}
- secItemNames.Add(ItemsChoiceType4.PortFacilityOfArrival);
- secItems.Add(sec.PortFacilityOfArrival);
+ if (!sec.PortFacilityOfArrival.IsNullOrEmpty())
+ {
+ secItemNames.Add(ItemsChoiceType4.PortFacilityOfArrival);
+ secItems.Add(sec.PortFacilityOfArrival);
+ }
if (sec.GeneralDescriptionOfCargo.HasValue)
{
secItemNames.Add(ItemsChoiceType4.GeneralDescriptionOfCargo);
@@ -877,16 +894,20 @@ namespace bsmd.hisnord
foreach (LastTenPortFacilitiesCalled l10Called in sec.LastTenPortFacilitesCalled)
{
last10port hn_last10port = new last10port();
- hn_last10port.PortFacilityPortName = l10Called.PortFacilityPortName;
- hn_last10port.PortFacilityPortCountry = l10Called.PortFacilityPortCountry;
- hn_last10port.PortFacilityPortLoCode = l10Called.PortFacilityPortLoCode;
+ if(!l10Called.PortFacilityPortName.IsNullOrEmpty())
+ hn_last10port.PortFacilityPortName = l10Called.PortFacilityPortName;
+ if(!l10Called.PortFacilityPortCountry.IsNullOrEmpty())
+ hn_last10port.PortFacilityPortCountry = l10Called.PortFacilityPortCountry;
+ if(!l10Called.PortFacilityPortLoCode.IsNullOrEmpty())
+ hn_last10port.PortFacilityPortLoCode = l10Called.PortFacilityPortLoCode;
if (l10Called.PortFacilityDateOfArrival.HasValue)
hn_last10port.PortFacilityDateOfArrival = l10Called.PortFacilityDateOfArrival.Value;
if (l10Called.PortFacilityDateOfDeparture.HasValue)
hn_last10port.PortFacilityDateOfDeparture = l10Called.PortFacilityDateOfDeparture.Value;
if (l10Called.PortFacilityShipSecurityLevel.HasValue)
hn_last10port.PortFacilityShipSecurityLevel = (posint13type)l10Called.PortFacilityShipSecurityLevel.Value;
- hn_last10port.PortFacilitySecurityMattersToReport = l10Called.PortFacilitySecurityMattersToReport;
+ if(!l10Called.PortFacilitySecurityMattersToReport.IsNullOrEmpty())
+ hn_last10port.PortFacilitySecurityMattersToReport = l10Called.PortFacilitySecurityMattersToReport;
hn_last10port.PortFacilityGISISCode = l10Called.PortFacilityGISISCode;
secItemNames.Add(ItemsChoiceType4.LastTenPortFacilitiesCalled);
@@ -1150,8 +1171,11 @@ namespace bsmd.hisnord
}
for (int i = 0; i < was.WasteDisposalServiceProvider.Count; i++)
{
- was_items.Add(was.WasteDisposalServiceProvider[i].WasteDisposalServiceProviderName);
- was_item_names.Add(ItemsChoiceType6.WasteDisposalServiceProviderName);
+ if (!was.WasteDisposalServiceProvider[i].WasteDisposalServiceProviderName.IsNullOrEmpty())
+ {
+ was_items.Add(was.WasteDisposalServiceProvider[i].WasteDisposalServiceProviderName);
+ was_item_names.Add(ItemsChoiceType6.WasteDisposalServiceProviderName);
+ }
}
if (was.WasteDisposalDelivery.HasValue)
{
@@ -1174,7 +1198,9 @@ namespace bsmd.hisnord
hn_waste.WasteType = new wastetyp();
if (waste.WasteType.HasValue)
hn_waste.WasteType.WasteCode = waste.WasteType.Value.ToString();
- hn_waste.WasteType.WasteDescription = waste.WasteDescription;
+
+ if(!waste.WasteDescription.IsNullOrEmpty())
+ hn_waste.WasteType.WasteDescription = waste.WasteDescription;
hn_waste.WasteDetails = new wastedetails();
@@ -1570,12 +1596,15 @@ namespace bsmd.hisnord
pi.PackingGroup = (packinggrouptype)imdgPosition.PackingGroup;
pi.ProperShippingName = imdgPosition.ProperShippingName;
pi.IMOClass = imdgPosition.IMOClass;
- pi.TechnicalName = imdgPosition.TechnicalName;
+ if(!imdgPosition.TechnicalName.IsNullOrEmpty())
+ pi.TechnicalName = imdgPosition.TechnicalName;
pi.NetExplosiveMass_KGMSpecified = imdgPosition.NetExplosiveMass_KGM.HasValue;
if (pi.NetExplosiveMass_KGMSpecified)
pi.NetExplosiveMass_KGM = (float)imdgPosition.NetExplosiveMass_KGM.Value;
- pi.Flashpoint_CEL = imdgPosition.Flashpoint_CEL;
- pi.Class7NuclideName = imdgPosition.Class7NuclideName;
+ if(!imdgPosition.Flashpoint_CEL.IsNullOrEmpty())
+ pi.Flashpoint_CEL = imdgPosition.Flashpoint_CEL;
+ if(!imdgPosition.Class7NuclideName.IsNullOrEmpty())
+ pi.Class7NuclideName = imdgPosition.Class7NuclideName;
pi.Class7MaxActivity_BQLSpecified = imdgPosition.Class7MaxActivity_BQL.HasValue;
if (pi.Class7MaxActivity_BQLSpecified)
pi.Class7MaxActivity_BQL = (float)imdgPosition.Class7MaxActivity_BQL.Value;
@@ -1617,7 +1646,8 @@ namespace bsmd.hisnord
pi.GeneralCargoIBCSpecified = imdgPosition.GeneralCargoIBC.HasValue;
if (pi.GeneralCargoIBCSpecified)
pi.GeneralCargoIBC = imdgPosition.GeneralCargoIBC.Value ? yorntype.Y : yorntype.N;
- pi.ContainerNumber = imdgPosition.ContainerNumber;
+ if(!imdgPosition.ContainerNumber.IsNullOrEmpty())
+ pi.ContainerNumber = imdgPosition.ContainerNumber;
if(!imdgPosition.VehicleLicenseNumber.IsNullOrEmpty())
pi.VehicleLicenseNumber = imdgPosition.VehicleLicenseNumber;
if(!imdgPosition.StowagePosition.IsNullOrEmpty())
@@ -1661,7 +1691,8 @@ namespace bsmd.hisnord
pi.Hazards = (hazardtype)ibcPosition.Hazards.Value;
if (ibcPosition.FlashpointInformation.HasValue)
pi.FlashpointInformation = (flashpointinfotype)ibcPosition.FlashpointInformation.Value;
- pi.Flashpoint_CEL = ibcPosition.Flashpoint_CEL;
+ if(!ibcPosition.Flashpoint_CEL.IsNullOrEmpty())
+ pi.Flashpoint_CEL = ibcPosition.Flashpoint_CEL;
if (ibcPosition.Quantity_KGM.HasValue)
pi.Quantity_KGM = (float)ibcPosition.Quantity_KGM.Value;
pi.StowagePosition = ibcPosition.StowagePosition;
@@ -1688,8 +1719,10 @@ namespace bsmd.hisnord
positionigc pi = new positionigc();
IGCPosition igcPosition = haz.IGCPositions[i] as IGCPosition;
- pi.UNNumber = igcPosition.UNNumber;
- pi.IMOClass = igcPosition.IMOClass;
+ if(!igcPosition.UNNumber.IsNullOrEmpty())
+ pi.UNNumber = igcPosition.UNNumber;
+ if(!igcPosition.IMOClass.IsNullOrEmpty())
+ pi.IMOClass = igcPosition.IMOClass;
pi.ProductName = igcPosition.ProductName;
if (igcPosition.Quantity_KGM.HasValue)
pi.Quantity_KGM = (float)igcPosition.Quantity_KGM.Value;
@@ -1716,8 +1749,10 @@ namespace bsmd.hisnord
pi.BulkCargoShippingName = imsbcPosition.BulkCargoShippingName;
pi.MHB = (imsbcPosition.MHB ?? false) ? yorntype.Y : yorntype.N;
- pi.UNNumber = imsbcPosition.UNNumber;
- pi.IMOClass = imsbcPosition.IMOClass;
+ if(!imsbcPosition.UNNumber.IsNullOrEmpty())
+ pi.UNNumber = imsbcPosition.UNNumber;
+ if(!imsbcPosition.IMOClass.IsNullOrEmpty())
+ pi.IMOClass = imsbcPosition.IMOClass;
if (imsbcPosition.Quantity_KGM.HasValue)
pi.Quantity_KGM = (float)imsbcPosition.Quantity_KGM.Value;
pi.StowagePosition = imsbcPosition.StowagePosition;
diff --git a/nsw/Source/misc/db.sqlite b/nsw/Source/misc/db.sqlite
index 61e83491..1acffee5 100644
Binary files a/nsw/Source/misc/db.sqlite and b/nsw/Source/misc/db.sqlite differ