diff --git a/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml b/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml
index 4057015d..0aca1249 100644
--- a/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml
+++ b/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml
@@ -7,6 +7,7 @@
xmlns:local="clr-namespace:ENI2.DetailViewControls"
xmlns:enictrl="clr-namespace:ENI2.Controls"
xmlns:p="clr-namespace:ENI2.Properties"
+ xmlns:util="clr-namespace:ENI2.Util"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="1024">
@@ -14,80 +15,80 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
@@ -105,26 +106,26 @@
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ENI2/DetailViewControls/OverViewDetailControl.xaml b/ENI2/DetailViewControls/OverViewDetailControl.xaml
index eb097996..bb384509 100644
--- a/ENI2/DetailViewControls/OverViewDetailControl.xaml
+++ b/ENI2/DetailViewControls/OverViewDetailControl.xaml
@@ -11,7 +11,7 @@
xmlns:local="clr-namespace:ENI2.DetailViewControls"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="800">
-
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ENI2/DetailViewControls/PSC72hDetailControl.xaml b/ENI2/DetailViewControls/PSC72hDetailControl.xaml
index 309cca1c..04a35a22 100644
--- a/ENI2/DetailViewControls/PSC72hDetailControl.xaml
+++ b/ENI2/DetailViewControls/PSC72hDetailControl.xaml
@@ -13,48 +13,48 @@
d:DesignHeight="800" d:DesignWidth="1024">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
diff --git a/ENI2/DetailViewControls/PortCallDetailControl.xaml b/ENI2/DetailViewControls/PortCallDetailControl.xaml
index cead6e4e..12abc521 100644
--- a/ENI2/DetailViewControls/PortCallDetailControl.xaml
+++ b/ENI2/DetailViewControls/PortCallDetailControl.xaml
@@ -98,16 +98,16 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/ENI2/DetailViewControls/PortNotificationDetailControl.xaml b/ENI2/DetailViewControls/PortNotificationDetailControl.xaml
index bde35ae3..f0fbd580 100644
--- a/ENI2/DetailViewControls/PortNotificationDetailControl.xaml
+++ b/ENI2/DetailViewControls/PortNotificationDetailControl.xaml
@@ -23,92 +23,92 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
diff --git a/ENI2/DetailViewControls/SecurityDetailControl.xaml b/ENI2/DetailViewControls/SecurityDetailControl.xaml
index 77fb860b..8a339466 100644
--- a/ENI2/DetailViewControls/SecurityDetailControl.xaml
+++ b/ENI2/DetailViewControls/SecurityDetailControl.xaml
@@ -15,74 +15,74 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -90,12 +90,12 @@
-
-
-
-
+
+
+
+
-
+
@@ -112,25 +112,25 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -144,9 +144,9 @@
-
-
-
+
+
+
@@ -162,18 +162,18 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ENI2/DetailViewControls/ShipDataDetailControl.xaml b/ENI2/DetailViewControls/ShipDataDetailControl.xaml
index dc6db395..38af2e76 100644
--- a/ENI2/DetailViewControls/ShipDataDetailControl.xaml
+++ b/ENI2/DetailViewControls/ShipDataDetailControl.xaml
@@ -5,6 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:enictrl="clr-namespace:ENI2.Controls"
+ xmlns:util="clr-namespace:ENI2.Util"
xmlns:p="clr-namespace:ENI2.Properties"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:local="clr-namespace:ENI2.DetailViewControls"
@@ -12,63 +13,63 @@
d:DesignHeight="600" d:DesignWidth="800">
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
@@ -93,12 +94,12 @@
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/ENI2/DetailViewControls/WasteDetailControl.xaml b/ENI2/DetailViewControls/WasteDetailControl.xaml
index bd8cbb7a..6e1b9950 100644
--- a/ENI2/DetailViewControls/WasteDetailControl.xaml
+++ b/ENI2/DetailViewControls/WasteDetailControl.xaml
@@ -53,7 +53,7 @@
-
+
diff --git a/ENI2/ENI2.csproj b/ENI2/ENI2.csproj
index d6cf6775..6e156068 100644
--- a/ENI2/ENI2.csproj
+++ b/ENI2/ENI2.csproj
@@ -36,8 +36,8 @@
5.4.0.0
true
publish.html
- 3
- 7.1.0.3
+ 0
+ 7.2.0.0
false
true
true
@@ -428,6 +428,7 @@
+
diff --git a/ENI2/Excel/DakosyUtil.cs b/ENI2/Excel/DakosyUtil.cs
index bb3c68cd..ffe341d4 100644
--- a/ENI2/Excel/DakosyUtil.cs
+++ b/ENI2/Excel/DakosyUtil.cs
@@ -1052,7 +1052,8 @@ namespace ENI2.Excel
}
ladg.CargoHandlingType = ladgOperation;
ladg.CargoLACode = (int?) reader.ReadCellAsDecimal("cargo", string.Format("C{0}", i + 9));
- ladg.CargoCodeNST = reader.ReadCellAsText("cargo", string.Format("D{0}", i + 9))?.Substring(0, 2);
+ ladg.CargoCodeNST = reader.ReadCellAsText("cargo", string.Format("D{0}", i + 9));
+ if(ladg.CargoCodeNST?.Length > 2) ladg.CargoCodeNST = ladg.CargoCodeNST.Substring(0, 2);
ladg.CargoCodeNST_3 = reader.ReadCellAsText("cargo", string.Format("E{0}", i + 9));
ladg.CargoNumberOfItems = (int?)reader.ReadCellAsDecimal("cargo", string.Format("F{0}", i + 9));
ladg.CargoGrossQuantity_TNE = reader.ReadCellAsDecimal("cargo", string.Format("G{0}", i + 9));
diff --git a/ENI2/Util/TrimStringConverter.cs b/ENI2/Util/TrimStringConverter.cs
new file mode 100644
index 00000000..dfca4cca
--- /dev/null
+++ b/ENI2/Util/TrimStringConverter.cs
@@ -0,0 +1,41 @@
+// Copyright (c) 2017-present schick Informatik
+// Description: Converter to create trimmed entries for plaintext input text fields
+//
+
+using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+using bsmd.database;
+
+namespace ENI2.Util
+{
+ [ValueConversion(typeof(string), typeof(string))]
+ public class TrimStringConverter : MarkupExtension, IValueConverter
+ {
+ private TrimStringConverter _converter;
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (!((string)value).IsNullOrEmpty())
+ {
+ return ((string)value).Trim();
+ }
+ return string.Empty;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return value;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ if (_converter == null)
+ {
+ _converter = new TrimStringConverter();
+ }
+ return _converter;
+ }
+ }
+}