diff --git a/ENI-2/ENI2/ENI2/Controls/ENIDataGrid.cs b/ENI-2/ENI2/ENI2/Controls/ENIDataGrid.cs
new file mode 100644
index 00000000..a58d347d
--- /dev/null
+++ b/ENI-2/ENI2/ENI2/Controls/ENIDataGrid.cs
@@ -0,0 +1,122 @@
+// Copyright (c) 2017 schick Informatik
+// Description: DataGrid mit etwas "verbesserten" Funktionen
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+using bsmd.database;
+
+
+namespace ENI2.Controls
+{
+ ///
+ /// Follow steps 1a or 1b and then 2 to use this custom control in a XAML file.
+ ///
+ /// Step 1a) Using this custom control in a XAML file that exists in the current project.
+ /// Add this XmlNamespace attribute to the root element of the markup file where it is
+ /// to be used:
+ ///
+ /// xmlns:enictrl="clr-namespace:ENI2.Controls"
+ ///
+ ///
+ /// Step 1b) Using this custom control in a XAML file that exists in a different project.
+ /// Add this XmlNamespace attribute to the root element of the markup file where it is
+ /// to be used:
+ ///
+ /// xmlns:enictrl="clr-namespace:ENI2.Controls;assembly=ENI2.Controls"
+ ///
+ /// You will also need to add a project reference from the project where the XAML file lives
+ /// to this project and Rebuild to avoid compilation errors:
+ ///
+ /// Right click on the target project in the Solution Explorer and
+ /// "Add Reference"->"Projects"->[Browse to and select this project]
+ ///
+ ///
+ /// Step 2)
+ /// Go ahead and use your control in the XAML file.
+ ///
+ ///
+ ///
+ ///
+ public class ENIDataGrid : DataGrid
+ {
+ /*
+ static ENIDataGrid()
+ {
+ DefaultStyleKeyProperty.OverrideMetadata(typeof(ENIDataGrid), new FrameworkPropertyMetadata(typeof(ENIDataGrid)));
+ }
+ */
+
+ public event Action EditRequested;
+ public event Action DeleteRequested;
+ public event Action CreateRequested;
+
+ public void Initialize()
+ {
+ this.ContextMenu = new ContextMenu();
+
+ MenuItem addItem = new MenuItem();
+ addItem.Header = "_Add";
+ addItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/add.png")) };
+ addItem.Click += new RoutedEventHandler(this.addItem);
+ this.ContextMenu.Items.Add(addItem);
+
+ MenuItem deleteItem = new MenuItem();
+ deleteItem.Header = "_Delete";
+ deleteItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/delete.png")) };
+ deleteItem.Click += this.deleteItem;
+ this.ContextMenu.Items.Add(deleteItem);
+
+ MenuItem editItem = new MenuItem();
+ editItem.Header = "_Edit";
+ editItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/edit.png")) };
+ editItem.Click += this.editItem;
+ this.ContextMenu.Items.Add(editItem);
+
+ }
+
+ protected void addItem(object sender, RoutedEventArgs e)
+ {
+ this.CreateRequested?.Invoke();
+ }
+
+ protected void deleteItem(object sender, RoutedEventArgs e)
+ {
+ if((this.SelectedItems != null) && (this.SelectedItems.Count > 0))
+ {
+ // TODO: ask confirmation message box
+
+ foreach(object deleteItem in this.SelectedItems)
+ {
+ if (deleteItem is DatabaseEntity) {
+ this.DeleteRequested?.Invoke(deleteItem as DatabaseEntity);
+ }
+ }
+ }
+ }
+
+ protected void editItem(object sender, RoutedEventArgs e)
+ {
+ if((this.SelectedItems != null) && (this.SelectedItems.Count == 1))
+ {
+ DatabaseEntity selectedEntity = this.SelectedItems[0] as DatabaseEntity;
+ if (selectedEntity != null)
+ this.EditRequested?.Invoke(selectedEntity);
+ }
+ }
+
+ }
+}
diff --git a/ENI-2/ENI2/ENI2/Controls/LocodeControl.xaml b/ENI-2/ENI2/ENI2/Controls/LocodeControl.xaml
new file mode 100644
index 00000000..45676795
--- /dev/null
+++ b/ENI-2/ENI2/ENI2/Controls/LocodeControl.xaml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ENI-2/ENI2/ENI2/Controls/LocodeControl.xaml.cs b/ENI-2/ENI2/ENI2/Controls/LocodeControl.xaml.cs
new file mode 100644
index 00000000..522ab672
--- /dev/null
+++ b/ENI-2/ENI2/ENI2/Controls/LocodeControl.xaml.cs
@@ -0,0 +1,158 @@
+// Copyright (c) 2017 schick Informatik
+// Description: Kapselt den Locode - Lookup
+//
+
+using System;
+using System.Collections.Generic;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media.Imaging;
+
+using bsmd.database;
+using bsmd.ExcelReadService;
+using System.ComponentModel;
+
+namespace ENI2.Controls
+{
+ ///
+ /// Interaction logic for LocodeControl.xaml
+ ///
+ public partial class LocodeControl : UserControl, INotifyPropertyChanged
+ {
+ private List _locodeList = new List();
+ // private string _selectedLocode;
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ public LocodeControl()
+ {
+ InitializeComponent();
+ }
+
+ protected enum LocodeState
+ {
+ UNKNOWN,
+ INVALID,
+ OK,
+ AMBIGUOUS
+ }
+
+ ///
+ /// used internally to load up drop down
+ ///
+ public List LocodeList
+ {
+ get { return this._locodeList; }
+ set { this._locodeList = value; }
+ }
+
+ public static readonly DependencyProperty LocodeValueProperty = DependencyProperty.Register("LocodeValue", typeof(string), typeof(LocodeControl),
+ new UIPropertyMetadata(LocodeValueChangedHandler));
+ //new FrameworkPropertyMetadata(default(string), FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
+
+
+ public static void LocodeValueChangedHandler(DependencyObject sender, DependencyPropertyChangedEventArgs e)
+ {
+ // Get instance of current control from sender
+ // and property value from e.NewValue
+
+ // Set public property on TaregtCatalogControl, e.g.
+ if(e.NewValue != null)
+ ((LocodeControl)sender).SelectedItem = e.NewValue.ToString();
+ }
+
+
+ public string SelectedItem
+ {
+ get { return this.comboBoxLocode.SelectedItem as string; }
+ set {
+ this._locodeList.Clear();
+ this._locodeList.Add(value);
+ this.comboBoxLocode.ItemsSource = this.LocodeList;
+ LocodeState locodeState = LocodeDB.PortNameFromLocode(value).IsNullOrEmpty() ? LocodeState.INVALID : LocodeState.OK;
+ this.SetLocodeStateImage(this.imageLocodeState, locodeState);
+ this.comboBoxLocode.SelectedItem = value;
+ }
+ }
+
+
+
+ ///
+ /// Actual value for DataBinding
+ ///
+ public string LocodeValue
+ {
+ get { return (string)GetValue(LocodeValueProperty); }
+ set { SetValue(LocodeValueProperty, value); }
+ }
+
+ #region event handler
+
+ private void ComboBox_TextChanged(object sender, RoutedEventArgs e)
+ {
+ if (this.comboBoxLocode.Text.Length > 3)
+ {
+ // check if actual locode
+ bool isLocode = !LocodeDB.PortNameFromLocode(this.comboBoxLocode.Text).IsNullOrEmpty();
+ if (isLocode)
+ {
+ this.SetLocodeStateImage(this.imageLocodeState, LocodeState.OK);
+ return;
+ }
+
+ // assume this is a harbour name typed out..
+ this.LocodeList = LocodeDB.AllLocodesForCityName(this.comboBoxLocode.Text + "%");
+
+ if (this.LocodeList.Count == 1)
+ {
+ this.comboBoxLocode.SelectedItem = this.LocodeList[0];
+ this.SetLocodeStateImage(this.imageLocodeState, LocodeState.OK);
+ }
+ else if (this.LocodeList.Count == 0)
+ {
+ this.SetLocodeStateImage(this.imageLocodeState, LocodeState.INVALID);
+ }
+ else
+ {
+ this.SetLocodeStateImage(this.imageLocodeState, LocodeState.AMBIGUOUS);
+ }
+
+ this.comboBoxLocode.ItemsSource = this.LocodeList;
+
+ }
+
+ this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("LocodeList"));
+ }
+
+ private void comboBoxLocode_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ this.LocodeValue = this.SelectedItem;
+ }
+
+ #endregion
+
+ #region private/protected methods
+
+ protected void SetLocodeStateImage(Image stateImage, LocodeState state)
+ {
+ switch (state)
+ {
+ case LocodeState.AMBIGUOUS:
+ stateImage.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/bullet_ball_yellow.png"));
+ break;
+ case LocodeState.INVALID:
+ stateImage.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/bullet_ball_red.png"));
+ break;
+ case LocodeState.OK:
+ stateImage.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/bullet_ball_green.png"));
+ break;
+ case LocodeState.UNKNOWN:
+ default:
+ stateImage.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/bullet_ball_grey.png"));
+ break;
+ }
+ }
+
+ #endregion
+
+ }
+}
diff --git a/ENI-2/ENI2/ENI2/DetailBaseControl.cs b/ENI-2/ENI2/ENI2/DetailBaseControl.cs
index fb503abb..e77c22c0 100644
--- a/ENI-2/ENI2/ENI2/DetailBaseControl.cs
+++ b/ENI-2/ENI2/ENI2/DetailBaseControl.cs
@@ -17,6 +17,8 @@ namespace ENI2
public class DetailBaseControl : UserControl
{
+ protected bool _initialized = false;
+
protected enum LocodeState
{
UNKNOWN,
diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml b/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml
index 76c9d6a0..bf2a8a15 100644
--- a/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml
+++ b/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml
@@ -32,7 +32,6 @@
-
@@ -43,8 +42,8 @@
-
-
+
+
diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs
index 3a217a8a..c550be00 100644
--- a/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs
+++ b/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs
@@ -29,8 +29,7 @@ namespace ENI2.DetailViewControls
public partial class OverViewDetailControl : DetailBaseControl, INotifyPropertyChanged
{
private Message _message = null;
- private List _locodePoCList = new List();
- private bool _initialized = false;
+ private List _locodePoCList = new List();
public event PropertyChangedEventHandler PropertyChanged;
@@ -66,7 +65,7 @@ namespace ENI2.DetailViewControls
if (!this.Core.PoC.IsNullOrEmpty())
{
this._locodePoCList.Add(this.Core.PoC);
- LocodeState locodeState = LocodeDB.PortNameFromLocode(this.Core.PoC).IsNullOrEmpty() ? LocodeState.INVALID : LocodeState.OK;
+ // LocodeState locodeState = LocodeDB.PortNameFromLocode(this.Core.PoC).IsNullOrEmpty() ? LocodeState.INVALID : LocodeState.OK;
}
Binding vtBinding = new Binding();
diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml b/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml
index b4933b40..f6be5f4a 100644
--- a/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml
+++ b/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml
@@ -5,9 +5,105 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ENI2.DetailViewControls"
+ xmlns:enictrl="clr-namespace:ENI2.Controls"
+ xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
- d:DesignHeight="300" d:DesignWidth="300">
-
-
-
+ d:DesignHeight="600" d:DesignWidth="800">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml.cs
index 763196b1..437ccea3 100644
--- a/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml.cs
+++ b/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml.cs
@@ -18,6 +18,7 @@ using System.Windows.Navigation;
using System.Windows.Shapes;
using bsmd.database;
+using bsmd.ExcelReadService;
using ENI2;
namespace ENI2.DetailViewControls
@@ -27,9 +28,60 @@ namespace ENI2.DetailViewControls
///
public partial class PortCallDetailControl : DetailBaseControl
{
+ private NOA_NOD _noa_nod;
+ private AGNT _agnt;
+
public PortCallDetailControl()
{
InitializeComponent();
}
+
+ public override void Initialize()
+ {
+ base.Initialize();
+
+ foreach (Message aMessage in this.Messages)
+ {
+ if (aMessage.MessageNotificationClass == Message.NotificationClass.NOA_NOD)
+ {
+ if (aMessage.Elements.Count > 0)
+ _noa_nod = aMessage.Elements[0] as NOA_NOD;
+ else
+ _noa_nod = new NOA_NOD(); // TODO
+ }
+
+ if(aMessage.MessageNotificationClass == Message.NotificationClass.AGNT)
+ {
+ if (aMessage.Elements.Count > 0)
+ _agnt = aMessage.Elements[0] as AGNT;
+ else
+ _agnt = new AGNT();
+ }
+ }
+
+ this.dateTimePicker_ETAToKielCanal.IsEnabled = this.Core.IsTransit;
+ this.dateTimePicker_ETDFromKielCanal.IsEnabled = this.Core.IsTransit;
+ this.dateTimePicker_ETAToPortOfCall.IsEnabled = !this.Core.IsTransit;
+ this.dateTimePicker_ETDFromPortOfCall.IsEnabled = !this.Core.IsTransit;
+
+ this.noaNodGroupBox.DataContext = _noa_nod;
+ this.locodeControl_LastPort.DataContext = _noa_nod;
+ this.locodeControl_NextPort.DataContext = _noa_nod;
+
+ this.dataGridCallPurposes.Initialize();
+ this.dataGridCallPurposes.ItemsSource = _noa_nod.CallPurposes;
+
+ this.agentGroupBox.DataContext = _agnt;
+
+ this.dateTimePicker_ETAToKielCanal.DataContext = _noa_nod;
+ this.dateTimePicker_ETAToNextPort.DataContext = _noa_nod;
+ this.dateTimePicker_ETAToPortOfCall.DataContext = _noa_nod;
+ this.dateTimePicker_ETDFromKielCanal.DataContext = _noa_nod;
+ this.dateTimePicker_ETDFromLastPort.DataContext = _noa_nod;
+ this.dateTimePicker_ETDFromPortOfCall.DataContext = _noa_nod;
+
+
+ }
+
}
}
diff --git a/ENI-2/ENI2/ENI2/ENI2.csproj b/ENI-2/ENI2/ENI2/ENI2.csproj
index 60abf26c..53091cb0 100644
--- a/ENI-2/ENI2/ENI2/ENI2.csproj
+++ b/ENI-2/ENI2/ENI2/ENI2.csproj
@@ -35,8 +35,8 @@
3.5.1.0
true
publish.html
- 5
- 3.5.3.%2a
+ 3
+ 3.5.6.%2a
false
true
true
@@ -157,6 +157,10 @@
Locode\LocodeDB.cs
+
+
+ LocodeControl.xaml
+
DetailRootControl.xaml
@@ -211,6 +215,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
@@ -286,6 +294,10 @@
Designer
MSBuild:Compile
+
+ MSBuild:Compile
+ Designer
+
Designer
MSBuild:Compile
@@ -305,6 +317,9 @@
Settings.settings
True
+
+
+
ResXFileCodeGenerator
Resources.Designer.cs
diff --git a/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs b/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs
index 4f2f4283..65ae817b 100644
--- a/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs
+++ b/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs
@@ -60,6 +60,16 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap add {
+ get {
+ object obj = ResourceManager.GetObject("add", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
@@ -160,6 +170,16 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap delete {
+ get {
+ object obj = ResourceManager.GetObject("delete", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
@@ -170,6 +190,16 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap edit {
+ get {
+ object obj = ResourceManager.GetObject("edit", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
diff --git a/ENI-2/ENI2/ENI2/Properties/Resources.resx b/ENI-2/ENI2/ENI2/Properties/Resources.resx
index fd7c94ac..f00f4382 100644
--- a/ENI-2/ENI2/ENI2/Properties/Resources.resx
+++ b/ENI-2/ENI2/ENI2/Properties/Resources.resx
@@ -181,4 +181,13 @@
..\Resources\bullet_ball_yellow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\add.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\delete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\edit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
\ No newline at end of file
diff --git a/ENI-2/ENI2/ENI2/Resources/add.png b/ENI-2/ENI2/ENI2/Resources/add.png
new file mode 100644
index 00000000..9c97e77e
Binary files /dev/null and b/ENI-2/ENI2/ENI2/Resources/add.png differ
diff --git a/ENI-2/ENI2/ENI2/Resources/delete.png b/ENI-2/ENI2/ENI2/Resources/delete.png
new file mode 100644
index 00000000..23d04fbf
Binary files /dev/null and b/ENI-2/ENI2/ENI2/Resources/delete.png differ
diff --git a/ENI-2/ENI2/ENI2/Resources/edit.png b/ENI-2/ENI2/ENI2/Resources/edit.png
new file mode 100644
index 00000000..9a43d581
Binary files /dev/null and b/ENI-2/ENI2/ENI2/Resources/edit.png differ
diff --git a/ENI-2/ENI2/ENI2/SucheControl.xaml b/ENI-2/ENI2/ENI2/SucheControl.xaml
index 06f5c76e..452ced6c 100644
--- a/ENI-2/ENI2/ENI2/SucheControl.xaml
+++ b/ENI-2/ENI2/ENI2/SucheControl.xaml
@@ -9,7 +9,7 @@
d:DesignHeight="600" d:DesignWidth="800">
-
+
@@ -26,7 +26,9 @@
+
+
@@ -34,7 +36,7 @@
-
+
@@ -45,15 +47,16 @@
-
+
-
+
-
+
+
diff --git a/ENI-2/ENI2/ENI2/SucheControl.xaml.cs b/ENI-2/ENI2/ENI2/SucheControl.xaml.cs
index 9f3ce426..13112076 100644
--- a/ENI-2/ENI2/ENI2/SucheControl.xaml.cs
+++ b/ENI-2/ENI2/ENI2/SucheControl.xaml.cs
@@ -75,7 +75,8 @@ namespace ENI2
}
if(!this.dateTimePickerETATo.Text.IsNullOrEmpty())
{
- to = this.dateTimePickerETATo.Value.Value.ToUnixTimeStamp();
+ DateTime toTime = this.dateTimePickerETATo.Value.Value.Add(new TimeSpan(23, 59, 59)); // search till the end of the "to" day (no time selection)
+ to = toTime.ToUnixTimeStamp();
}
if (from.HasValue || to.HasValue)
@@ -86,6 +87,19 @@ namespace ENI2
// ergebnis anzeigen
this.dataGrid.ItemsSource = this.anmeldungen;
+ this.searchResultLabel.Content = (this.anmeldungen.Count > 0) ? string.Format("{0} results found.", this.anmeldungen.Count) : "no results";
+
+ }
+
+ private void etaValueChanged(object sender, EventArgs args)
+ {
+ bool valid = true;
+ if ((this.dateTimePickerETAFrom.Value != null) && (this.dateTimePickerETATo.Value != null) &&
+ this.dateTimePickerETATo.Value.Value < this.dateTimePickerETAFrom.Value.Value)
+ valid = false;
+
+ this.dateTimePickerETAFrom.Background = valid ? SystemColors.ControlBrush : Brushes.Red;
+ this.dateTimePickerETATo.Background = valid ? SystemColors.ControlBrush : Brushes.Red;
}
#endregion
diff --git a/ENI-2/ENI2/ENI2/Themes/Generic.xaml b/ENI-2/ENI2/ENI2/Themes/Generic.xaml
new file mode 100644
index 00000000..a46d033a
--- /dev/null
+++ b/ENI-2/ENI2/ENI2/Themes/Generic.xaml
@@ -0,0 +1,20 @@
+
+
+
+
+
diff --git a/Stundensheet.xlsx b/Stundensheet.xlsx
index 5806f15a..9c138600 100644
Binary files a/Stundensheet.xlsx and b/Stundensheet.xlsx differ
diff --git a/nsw/Source/bsmd.ExcelReadService/Util.cs b/nsw/Source/bsmd.ExcelReadService/Util.cs
index 00e7badf..21ccd5e7 100644
--- a/nsw/Source/bsmd.ExcelReadService/Util.cs
+++ b/nsw/Source/bsmd.ExcelReadService/Util.cs
@@ -281,6 +281,8 @@ namespace bsmd.ExcelReadService
bpol.StowawaysOnBoard = (poba.TotalStowawaysOnBoardUponArrival ?? 0) > 0;
}
+ bpol.DeleteElements();
+
// PortOfItinerary
for (int i = 1; i <= 10; i++)
{
@@ -382,6 +384,7 @@ namespace bsmd.ExcelReadService
hazaMessage.Elements.Add(newHaza);
}
HAZ haza = hazaMessage.Elements[0] as HAZ;
+ haza.DeleteElements();
haza.NoDPGOnBoardOnArrival = !reader.ReadBoolean("HAZA.DGOnBoard");
haza.DPGManifestOnBoardOnArrival = reader.ReadBoolean("HAZA.DPGManifestOnBoardOnArrival");
@@ -681,6 +684,7 @@ namespace bsmd.ExcelReadService
hazdMessage.Elements.Add(newHazd);
}
HAZ hazd = hazdMessage.Elements[0] as HAZ;
+ hazd.DeleteElements();
hazd.NoDPGOnBoardOnArrival = !reader.ReadBoolean("HAZD.DGOnBoard");
hazd.DPGManifestOnBoardOnArrival = reader.ReadBoolean("HAZD.DPGManifestOnBoardOnDeparture");
@@ -1197,6 +1201,7 @@ namespace bsmd.ExcelReadService
wasMessage.Elements.Add(newWAS);
}
WAS was = wasMessage.Elements[0] as WAS;
+ was.DeleteElements();
Util.ScanMessage(was, reader);
was.WasteDisposalDelivery = reader.ReadDelivery("WAS.WasteDisposalDelivery");
if ((was.LastWasteDisposalPort != null) && (was.LastWasteDisposalPort.Length > 5))
@@ -1394,6 +1399,7 @@ namespace bsmd.ExcelReadService
mdhMessage.Elements.Add(newMDH);
}
MDH mdh = mdhMessage.Elements[0] as MDH;
+ mdh.DeleteElements();
Util.ScanMessage(mdh, reader);
// lt. Mail von Christin am 28.9.2016
@@ -1616,7 +1622,7 @@ namespace bsmd.ExcelReadService
newSEC.MessageHeader = secMessage;
secMessage.Elements.Add(newSEC);
}
- SEC sec = secMessage.Elements[0] as SEC;
+ SEC sec = secMessage.Elements[0] as SEC;
Util.ScanMessage(sec, reader);
reader.ReadBoolean("SEC.AreMatterToReport"); // das berücksichtigen wir derzeit nicht in der DB (implizit)
@@ -1788,6 +1794,7 @@ namespace bsmd.ExcelReadService
static void ScanBKRA(List messages, MessageCore messageCore, ExcelReader reader)
{
Message bkraMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.BKRA);
+ bkraMessage.DeleteElements();
for (int i = 1; i <= bkraMessage.NumberOfExcelRows; i++)
{
string lnQuantity = string.Format("BKRA.BunkerFuelQuantity_TNE_{0}", i);
@@ -1829,6 +1836,7 @@ namespace bsmd.ExcelReadService
static void ScanBKRD(List messages, MessageCore messageCore, ExcelReader reader)
{
Message bkrdMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.BKRD);
+ bkrdMessage.DeleteElements();
for (int i = 1; i <= bkrdMessage.NumberOfExcelRows; i++)
{
string lnQuantity = string.Format("BKRD.BunkerFuelQuantity_TNE_{0}", i);
@@ -1869,6 +1877,7 @@ namespace bsmd.ExcelReadService
static void ScanTOWA(List messages, MessageCore messageCore, ExcelReader reader)
{
Message towaMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.TOWA);
+ towaMessage.DeleteElements();
for (int i = 1; i <= towaMessage.NumberOfExcelRows; i++)
{
string tName = string.Format("TOWA.TowageOnArrivalName_{0}", i);
@@ -1914,6 +1923,7 @@ namespace bsmd.ExcelReadService
static void ScanTOWD(List messages, MessageCore messageCore, ExcelReader reader)
{
Message towdMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.TOWD);
+ towdMessage.DeleteElements();
for (int i = 1; i <= towdMessage.NumberOfExcelRows; i++)
{
@@ -2001,6 +2011,8 @@ namespace bsmd.ExcelReadService
static void ScanSTO(List messages, MessageCore messageCore, ExcelReader reader)
{
Message stoMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.STO);
+ stoMessage.DeleteElements();
+
for(int i=0;i messages, MessageCore messageCore, ExcelReader reader)
{
Message ladgMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.LADG);
+ ladgMessage.DeleteElements();
+
for (int i = 0; i < ladgMessage.NumberOfExcelRows; i++)
{
string lnCHT = string.Format("LADG.CargoHandlingType_{0}", i + 1);
@@ -2143,6 +2157,8 @@ namespace bsmd.ExcelReadService
static void ScanCREW(List messages, MessageCore messageCore, ExcelReader reader)
{
Message crewMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.CREW);
+ crewMessage.DeleteElements();
+
for (int i = 0; i < crewMessage.NumberOfExcelRows; i++)
{
string crewLastName = string.Format("CREW.CrewMemberLastName_{0}", i + 1);
@@ -2254,6 +2270,8 @@ namespace bsmd.ExcelReadService
static void ScanPAS(List messages, MessageCore messageCore, ExcelReader reader)
{
Message pasMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.PAS);
+ pasMessage.DeleteElements();
+
for (int i = 0; i < pasMessage.NumberOfExcelRows; i++)
{
string pasLastName = string.Format("PAS.PassengerLastName_{0}", i + 1);
diff --git a/nsw/Source/bsmd.database/Extensions.cs b/nsw/Source/bsmd.database/Extensions.cs
index e36893d2..6c75b927 100644
--- a/nsw/Source/bsmd.database/Extensions.cs
+++ b/nsw/Source/bsmd.database/Extensions.cs
@@ -22,6 +22,7 @@ namespace bsmd.database
{
private static ILog _log = LogManager.GetLogger(typeof(Extensions));
private static Regex splitRegex = new Regex(@"(""((\\"")|([^""]))*"")|('((\\')|([^']))*')|(\S+)");
+ private static char[] splitDelimiter = new[] { ',', ';', ' ' };
public static bool IsNullOrEmpty(this String str)
{
@@ -114,11 +115,17 @@ namespace bsmd.database
foreach(Match match in splitRegex.Matches(source))
{
- result.Add(match.Value);
+ result.Add(match.Value.Trim());
}
return result;
}
+ public static List SimpleSplit(this string source)
+ {
+ List result = new List(source.Split(splitDelimiter, StringSplitOptions.RemoveEmptyEntries));
+ return result;
+ }
+
}
}
diff --git a/nsw/Source/bsmd.database/MessageCore.cs b/nsw/Source/bsmd.database/MessageCore.cs
index 8566049d..a7c3fd9a 100644
--- a/nsw/Source/bsmd.database/MessageCore.cs
+++ b/nsw/Source/bsmd.database/MessageCore.cs
@@ -2,9 +2,7 @@
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
-using System.Linq;
using System.Text;
-using System.Threading.Tasks;
namespace bsmd.database
{
@@ -276,7 +274,7 @@ namespace bsmd.database
}
case Message.LoadFilter.BSMDSTATUS:
{
- sb.Append("WHERE BSMDStatus = @STATUS ORDER BY Created DESC");
+ sb.Append("WHERE BSMDStatus = @STATUS ORDER BY ETA");
((SqlCommand)cmd).Parameters.AddWithValue("@STATUS", criteria[0]);
break;
}
@@ -374,7 +372,7 @@ namespace bsmd.database
{
sb.Append("( ");
int paramCnt = 0;
- foreach (string param in searchDict[key].RegexSplit())
+ foreach (string param in searchDict[key].SimpleSplit())
{
string paramName = string.Format("@SEARCH_PORT{0}", paramCnt);
if (paramCnt > 0) sb.Append(" OR ");
@@ -397,12 +395,14 @@ namespace bsmd.database
break;
}
if (!moreThanOne) moreThanOne = true;
- }
+ }
}
+ sb.Append(" ORDER BY ETA");
break;
}
case Message.LoadFilter.ALL:
default:
+ sb.Append(" ORDER BY ETA");
break;
}
diff --git a/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs b/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs
index 6edebe84..63a12537 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.5.5")]
+[assembly: AssemblyInformationalVersion("3.5.6")]
[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 f1758dcf..c8d0063e 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.5.5.*")]
+[assembly: AssemblyVersion("3.5.6.*")]