diff --git a/ENI-2/ENI2/ENI2/AnmeldungenControl.xaml b/ENI-2/ENI2/ENI2/AnmeldungenControl.xaml
index caec8fad..97614ea3 100644
--- a/ENI-2/ENI2/ENI2/AnmeldungenControl.xaml
+++ b/ENI-2/ENI2/ENI2/AnmeldungenControl.xaml
@@ -12,12 +12,12 @@
-
+
-
+
-
+
diff --git a/ENI-2/ENI2/ENI2/App.config b/ENI-2/ENI2/ENI2/App.config
index 85221ef7..b793453c 100644
--- a/ENI-2/ENI2/ENI2/App.config
+++ b/ENI-2/ENI2/ENI2/App.config
@@ -17,7 +17,7 @@ Sample license text.
- Data Source=(localdb)\Projects;Initial Catalog=nsw;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False
+ Data Source=192.168.2.12;Initial Catalog=nsw;Uid=dfuser;Pwd=dfpasswd;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False
diff --git a/ENI-2/ENI2/ENI2/App.xaml.cs b/ENI-2/ENI2/ENI2/App.xaml.cs
index fa179ea3..22f580d1 100644
--- a/ENI-2/ENI2/ENI2/App.xaml.cs
+++ b/ENI-2/ENI2/ENI2/App.xaml.cs
@@ -1,10 +1,5 @@
// Copyright (c) 2017 Informatibüro Daniel Schick
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Data;
-using System.Linq;
-using System.Threading.Tasks;
+
using System.Windows;
namespace ENI2
@@ -14,5 +9,17 @@ namespace ENI2
///
public partial class App : Application
{
+
+ public App() : base()
+ {
+ this.Dispatcher.UnhandledException += Dispatcher_UnhandledException;
+ }
+
+ private void Dispatcher_UnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
+ {
+ string errorMessage = string.Format("An unhandled exception occurred: {0}\r\n{1}", e.Exception.Message, e.Exception.StackTrace);
+ MessageBox.Show(errorMessage, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
+ e.Handled = true;
+ }
}
}
diff --git a/ENI-2/ENI2/ENI2/Controls/ENIDataGrid.cs b/ENI-2/ENI2/ENI2/Controls/ENIDataGrid.cs
index a58d347d..7d7267b0 100644
--- a/ENI-2/ENI2/ENI2/Controls/ENIDataGrid.cs
+++ b/ENI-2/ENI2/ENI2/Controls/ENIDataGrid.cs
@@ -60,12 +60,21 @@ namespace ENI2.Controls
}
*/
+ // das hier bildet 1:1 das Kontext-Menü des ANSW ab
+
public event Action EditRequested;
public event Action DeleteRequested;
public event Action CreateRequested;
+ public event Action PrintRequested;
+ public event Action ExportRequested;
+ public event Action ShowTextRequested;
+
public void Initialize()
{
+
+ this.MouseDoubleClick += dataGrid_MouseDoubleClick;
+
this.ContextMenu = new ContextMenu();
MenuItem addItem = new MenuItem();
@@ -86,6 +95,26 @@ namespace ENI2.Controls
editItem.Click += this.editItem;
this.ContextMenu.Items.Add(editItem);
+ this.ContextMenu.Items.Add(new Separator());
+
+ MenuItem printItem = new MenuItem();
+ printItem.Header = "_Print";
+ printItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/printer.png")) };
+ printItem.Click += this.printItem;
+ this.ContextMenu.Items.Add(printItem);
+
+ MenuItem exportItem = new MenuItem();
+ exportItem.Header = "_Export";
+ exportItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/floppy_disk_blue.png")) };
+ exportItem.Click += this.exportItem;
+ this.ContextMenu.Items.Add(exportItem);
+
+ MenuItem showTextItem = new MenuItem();
+ showTextItem.Header = "_Show data as text";
+ showTextItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/document_plain.png")) };
+ showTextItem.Click += this.showTextItem;
+ this.ContextMenu.Items.Add(showTextItem);
+
}
protected void addItem(object sender, RoutedEventArgs e)
@@ -118,5 +147,51 @@ namespace ENI2.Controls
}
}
+ protected void printItem(object sender, RoutedEventArgs e)
+ {
+ if ((this.SelectedItems != null) && (this.SelectedItems.Count == 1))
+ {
+ DatabaseEntity selectedEntity = this.SelectedItems[0] as DatabaseEntity;
+ if (selectedEntity != null)
+ this.PrintRequested?.Invoke(selectedEntity);
+ }
+ }
+
+ protected void exportItem(object sender, RoutedEventArgs e)
+ {
+ if ((this.SelectedItems != null) && (this.SelectedItems.Count == 1))
+ {
+ DatabaseEntity selectedEntity = this.SelectedItems[0] as DatabaseEntity;
+ if (selectedEntity != null)
+ this.ExportRequested?.Invoke(selectedEntity);
+ }
+ }
+
+ protected void showTextItem(object sender, RoutedEventArgs e)
+ {
+ if ((this.SelectedItems != null) && (this.SelectedItems.Count == 1))
+ {
+ DatabaseEntity selectedEntity = this.SelectedItems[0] as DatabaseEntity;
+ if (selectedEntity != null)
+ this.ShowTextRequested?.Invoke(selectedEntity);
+ }
+ }
+
+ private void dataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
+ {
+ if (sender != null)
+ {
+ DataGrid grid = sender as DataGrid;
+ if ((grid != null) && (grid.SelectedItems != null) && (grid.SelectedItems.Count == 1))
+ {
+ DataGridRow dgr = grid.ItemContainerGenerator.ContainerFromItem(grid.SelectedItem) as DataGridRow;
+ DatabaseEntity selectedEntity = grid.SelectedItem as DatabaseEntity;
+ if (selectedEntity != null)
+ this.EditRequested?.Invoke(selectedEntity);
+ }
+ }
+ }
+
+
}
}
diff --git a/ENI-2/ENI2/ENI2/Controls/EditWindowBase.cs b/ENI-2/ENI2/ENI2/Controls/EditWindowBase.cs
new file mode 100644
index 00000000..0ebc6f4e
--- /dev/null
+++ b/ENI-2/ENI2/ENI2/Controls/EditWindowBase.cs
@@ -0,0 +1,47 @@
+// Copyright (c) 2017 schick Informatik
+// Description: Basisklasse für Bearbeitungsfensterle
+// Position merken usw.
+
+using System;
+using System.Windows;
+using System.Windows.Controls;
+using System.ComponentModel;
+
+namespace ENI2.Controls
+{
+ ///
+ /// Basisklasse aller Bearbeitungsdialoge. OK/Cancel Buttons und Window Placement
+ ///
+ [TemplatePart(Name = "buttonOK",Type = typeof(Button))]
+ [TemplatePart(Name = "buttonCancel", Type = typeof(Button))]
+ public class EditWindowBase : Window
+ {
+ static EditWindowBase()
+ {
+ DefaultStyleKeyProperty.OverrideMetadata(typeof(EditWindowBase), new FrameworkPropertyMetadata(typeof(EditWindowBase)));
+ }
+
+ public EditWindowBase()
+ {
+ Loaded += (_, __) =>
+ {
+ var okButton = (Button)Template.FindName("buttonOK", this);
+ var cancelButton = (Button)Template.FindName("buttonCancel", this);
+ okButton.Click += (s, e) => DialogResult = true;
+ cancelButton.Click += (s, e) => DialogResult = false;
+ };
+ }
+
+ private void Window_Closing(object sender, CancelEventArgs e)
+ {
+ // ENI2.Properties.Settings.Default.M
+ }
+
+ protected override void OnSourceInitialized(EventArgs e)
+ {
+ base.OnSourceInitialized(e);
+ // this.SetPlacement(..)
+ }
+
+ }
+}
diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml.cs
index 437ccea3..3b6e15c4 100644
--- a/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml.cs
+++ b/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml.cs
@@ -20,6 +20,7 @@ using System.Windows.Shapes;
using bsmd.database;
using bsmd.ExcelReadService;
using ENI2;
+using ENI2.EditControls;
namespace ENI2.DetailViewControls
{
@@ -70,6 +71,10 @@ namespace ENI2.DetailViewControls
this.dataGridCallPurposes.Initialize();
this.dataGridCallPurposes.ItemsSource = _noa_nod.CallPurposes;
+ this.dataGridCallPurposes.EditRequested += DataGridCallPurposes_EditRequested;
+ this.dataGridCallPurposes.AddingNewItem += DataGridCallPurposes_AddingNewItem;
+ this.dataGridCallPurposes.CreateRequested += DataGridCallPurposes_CreateRequested;
+ this.dataGridCallPurposes.DeleteRequested += DataGridCallPurposes_DeleteRequested;
this.agentGroupBox.DataContext = _agnt;
@@ -81,7 +86,34 @@ namespace ENI2.DetailViewControls
this.dateTimePicker_ETDFromPortOfCall.DataContext = _noa_nod;
- }
+ }
+ private void DataGridCallPurposes_DeleteRequested(DatabaseEntity obj)
+ {
+ // throw new NotImplementedException();
+ }
+
+ private void DataGridCallPurposes_CreateRequested()
+ {
+ //throw new NotImplementedException();
+ }
+
+ private void DataGridCallPurposes_AddingNewItem(object sender, AddingNewItemEventArgs e)
+ {
+ //throw new NotImplementedException();
+ }
+
+ private void DataGridCallPurposes_EditRequested(DatabaseEntity obj)
+ {
+ EditCallPurposeDialog ecpd = new EditCallPurposeDialog();
+ if(ecpd.ShowDialog() ?? false)
+ {
+ // Edit successful
+ }
+ else
+ {
+ // cancelled out..
+ }
+ }
}
}
diff --git a/ENI-2/ENI2/ENI2/ENI2.csproj b/ENI-2/ENI2/ENI2/ENI2.csproj
index 53091cb0..d9a09cb3 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
- 3
+ 6
3.5.6.%2a
false
true
@@ -51,6 +51,7 @@
DEBUG;TRACE
prompt
4
+ false
AnyCPU
@@ -101,6 +102,7 @@
packages\System.Data.SQLite.Core.1.0.105.0\lib\net451\System.Data.SQLite.dll
True
+ False
@@ -157,6 +159,7 @@
Locode\LocodeDB.cs
+
LocodeControl.xaml
@@ -204,6 +207,9 @@
WasteDetailControl.xaml
+
+ EditCallPurposeDialog.xaml
+
SucheControl.xaml
@@ -275,6 +281,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
MSBuild:Compile
Designer
@@ -317,6 +327,15 @@
Settings.settings
True
+
+ Always
+
+
+ Always
+
+
+
+
@@ -431,6 +450,7 @@
+
diff --git a/ENI-2/ENI2/ENI2/EditControls/EditCallPurposeDialog.xaml b/ENI-2/ENI2/ENI2/EditControls/EditCallPurposeDialog.xaml
new file mode 100644
index 00000000..7f18ce7a
--- /dev/null
+++ b/ENI-2/ENI2/ENI2/EditControls/EditCallPurposeDialog.xaml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ENI-2/ENI2/ENI2/EditControls/EditCallPurposeDialog.xaml.cs b/ENI-2/ENI2/ENI2/EditControls/EditCallPurposeDialog.xaml.cs
new file mode 100644
index 00000000..07d99b0c
--- /dev/null
+++ b/ENI-2/ENI2/ENI2/EditControls/EditCallPurposeDialog.xaml.cs
@@ -0,0 +1,29 @@
+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.Shapes;
+
+using ENI2.Controls;
+
+namespace ENI2.EditControls
+{
+ ///
+ /// Interaction logic for EditCallPurposeDialog.xaml
+ ///
+ public partial class EditCallPurposeDialog : EditWindowBase
+ {
+ public EditCallPurposeDialog()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/ENI-2/ENI2/ENI2/MainWindow.xaml b/ENI-2/ENI2/ENI2/MainWindow.xaml
index e764aadf..cb39e3e1 100644
--- a/ENI-2/ENI2/ENI2/MainWindow.xaml
+++ b/ENI-2/ENI2/ENI2/MainWindow.xaml
@@ -5,13 +5,14 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ENI2"
mc:Ignorable="d"
- Title="ENI 2" Height="350" Width="525" Icon="Resources/logo_schwarz.ico" Loaded="Window_Loaded" Closing="Window_Closing" SourceInitialized="Window_SourceInitialized">
+ Title="ENI 2" Height="350" Width="525" Icon="Resources/logo_schwarz.ico" Loaded="Window_Loaded" Closing="Window_Closing"
+ SourceInitialized="Window_SourceInitialized">
-
-
-
+
+
+
diff --git a/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs b/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs
index 65ae817b..a1d8ec17 100644
--- a/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs
+++ b/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs
@@ -180,6 +180,16 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap document_plain {
+ get {
+ object obj = ResourceManager.GetObject("document_plain", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
@@ -230,6 +240,16 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap floppy_disk_blue {
+ get {
+ object obj = ResourceManager.GetObject("floppy_disk_blue", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
@@ -270,6 +290,16 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap printer {
+ get {
+ object obj = ResourceManager.GetObject("printer", 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 f00f4382..fe4073aa 100644
--- a/ENI-2/ENI2/ENI2/Properties/Resources.resx
+++ b/ENI-2/ENI2/ENI2/Properties/Resources.resx
@@ -190,4 +190,13 @@
..\Resources\edit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\document_plain.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\floppy_disk_blue.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\printer.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/document_plain.png b/ENI-2/ENI2/ENI2/Resources/document_plain.png
new file mode 100644
index 00000000..9f61bacf
Binary files /dev/null and b/ENI-2/ENI2/ENI2/Resources/document_plain.png differ
diff --git a/ENI-2/ENI2/ENI2/Resources/floppy_disk_blue.png b/ENI-2/ENI2/ENI2/Resources/floppy_disk_blue.png
new file mode 100644
index 00000000..d70e4fd2
Binary files /dev/null and b/ENI-2/ENI2/ENI2/Resources/floppy_disk_blue.png differ
diff --git a/ENI-2/ENI2/ENI2/Resources/printer.png b/ENI-2/ENI2/ENI2/Resources/printer.png
new file mode 100644
index 00000000..96567d35
Binary files /dev/null and b/ENI-2/ENI2/ENI2/Resources/printer.png differ
diff --git a/ENI-2/ENI2/ENI2/SucheControl.xaml b/ENI-2/ENI2/ENI2/SucheControl.xaml
index 452ced6c..fdaa3b98 100644
--- a/ENI-2/ENI2/ENI2/SucheControl.xaml
+++ b/ENI-2/ENI2/ENI2/SucheControl.xaml
@@ -30,11 +30,11 @@
-
-
-
+
+
+
-
+
@@ -46,15 +46,15 @@
-
+
-
+
-
-
+
+
-
+
diff --git a/ENI-2/ENI2/ENI2/SucheControl.xaml.cs b/ENI-2/ENI2/ENI2/SucheControl.xaml.cs
index 13112076..91b4d738 100644
--- a/ENI-2/ENI2/ENI2/SucheControl.xaml.cs
+++ b/ENI-2/ENI2/ENI2/SucheControl.xaml.cs
@@ -43,7 +43,7 @@ namespace ENI2
private void Button_Click(object sender, RoutedEventArgs e)
{
- // Eingabefelder löschen
+ // Eingabefelder und Ergebnis löschen
textBoxHafen.Text = string.Empty;
textBoxId.Text = string.Empty;
textBoxIMO.Text = string.Empty;
@@ -51,6 +51,7 @@ namespace ENI2
textBoxTicketNr.Text = string.Empty;
dateTimePickerETAFrom.Text = string.Empty;
dateTimePickerETATo.Text = string.Empty;
+ this.dataGrid.ItemsSource = null;
}
private void buttonSuche_Click(object sender, RoutedEventArgs e)
diff --git a/ENI-2/ENI2/ENI2/Themes/Generic.xaml b/ENI-2/ENI2/ENI2/Themes/Generic.xaml
index a46d033a..b3154b09 100644
--- a/ENI-2/ENI2/ENI2/Themes/Generic.xaml
+++ b/ENI-2/ENI2/ENI2/Themes/Generic.xaml
@@ -17,4 +17,30 @@
+
+
diff --git a/ENI-2/ENI2/ENI2/x64/SQLite.Interop.dll b/ENI-2/ENI2/ENI2/x64/SQLite.Interop.dll
new file mode 100644
index 00000000..0dfc57b1
Binary files /dev/null and b/ENI-2/ENI2/ENI2/x64/SQLite.Interop.dll differ
diff --git a/ENI-2/ENI2/ENI2/x86/SQLite.Interop.dll b/ENI-2/ENI2/ENI2/x86/SQLite.Interop.dll
new file mode 100644
index 00000000..e5b387cb
Binary files /dev/null and b/ENI-2/ENI2/ENI2/x86/SQLite.Interop.dll differ
diff --git a/Stundensheet.xlsx b/Stundensheet.xlsx
index 9c138600..b46fc104 100644
Binary files a/Stundensheet.xlsx and b/Stundensheet.xlsx differ
diff --git a/nsw/Source/bsmd.database/MessageCore.cs b/nsw/Source/bsmd.database/MessageCore.cs
index a7c3fd9a..f8db7b6d 100644
--- a/nsw/Source/bsmd.database/MessageCore.cs
+++ b/nsw/Source/bsmd.database/MessageCore.cs
@@ -274,7 +274,7 @@ namespace bsmd.database
}
case Message.LoadFilter.BSMDSTATUS:
{
- sb.Append("WHERE BSMDStatus = @STATUS ORDER BY ETA");
+ sb.Append("WHERE BSMDStatus = @STATUS ORDER BY ETA DESC");
((SqlCommand)cmd).Parameters.AddWithValue("@STATUS", criteria[0]);
break;
}
@@ -397,12 +397,12 @@ namespace bsmd.database
if (!moreThanOne) moreThanOne = true;
}
}
- sb.Append(" ORDER BY ETA");
+ sb.Append(" ORDER BY ETA DESC");
break;
}
case Message.LoadFilter.ALL:
default:
- sb.Append(" ORDER BY ETA");
+ sb.Append(" ORDER BY ETA DESC");
break;
}