diff --git a/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs b/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs
index 907fb9b1..38f60a94 100644
--- a/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs
+++ b/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs
@@ -144,6 +144,7 @@ namespace ENI2.DetailViewControls
vioItem.Click += this.buttonWarnings_Click;
this.dataGridMessages.ContextMenu.Items.Add(vioItem);
+ /*
MenuItem pdfItem = new MenuItem
{
Header = Properties.Resources.textCreatePDF,
@@ -151,6 +152,7 @@ namespace ENI2.DetailViewControls
};
pdfItem.Click += this.buttonCreatePDF_Click;
this.dataGridMessages.ContextMenu.Items.Add(pdfItem);
+ */
MenuItem historyItem = new MenuItem
{
@@ -540,13 +542,16 @@ namespace ENI2.DetailViewControls
private void buttonSendPDF_Click(object sender, RoutedEventArgs e)
{
SelectImportClassesDialog sicd = new SelectImportClassesDialog();
+ sicd.Messages = this.Messages;
sicd.IsTransit = this.Core.IsTransit;
if ((sicd.ShowDialog() ?? false) && (sicd.SelectedClasses.Count > 0))
{
+ string preferredFileName = string.Format("{0}_{1}.pdf", this.Core.Shipname, this.Core.DisplayId);
// get here if user selected some classes
SaveFileDialog sfd = new SaveFileDialog
{
- Filter = "PDF Files|*.pdf"
+ Filter = "PDF Files|*.pdf",
+ FileName = preferredFileName
};
if (sfd.ShowDialog() ?? false)
{
@@ -685,6 +690,8 @@ namespace ENI2.DetailViewControls
}
}
+ /* obsolete, da PDF jetzt lokal erzeugt werden können..
+ *
private void buttonCreatePDF_Click(object sender, RoutedEventArgs e)
{
bool cannotCreateReport = false;
@@ -727,6 +734,7 @@ namespace ENI2.DetailViewControls
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(this.Core);
this.dataGridMessages.Items.Refresh();
}
+ */
private void buttonSystemErrors_Click(object sender, RoutedEventArgs e)
{
@@ -750,6 +758,7 @@ namespace ENI2.DetailViewControls
{
SelectImportClassesDialog sicd = new SelectImportClassesDialog();
sicd.IsTransit = this.Core.IsTransit;
+ sicd.Messages = this.Messages;
if((sicd.ShowDialog() ?? false) && (sicd.SelectedClasses.Count > 0))
{
// get here if user selected some classes
diff --git a/ENI2/ENI2.csproj b/ENI2/ENI2.csproj
index 74b56cbb..ee8ae89e 100644
--- a/ENI2/ENI2.csproj
+++ b/ENI2/ENI2.csproj
@@ -37,7 +37,7 @@
true
publish.html
0
- 6.8.0.0
+ 6.8.1.0
false
true
true
diff --git a/ENI2/EditControls/SelectImportClassesDialog.xaml.cs b/ENI2/EditControls/SelectImportClassesDialog.xaml.cs
index c27833a1..2d8e566c 100644
--- a/ENI2/EditControls/SelectImportClassesDialog.xaml.cs
+++ b/ENI2/EditControls/SelectImportClassesDialog.xaml.cs
@@ -5,17 +5,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
-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 bsmd.database;
@@ -35,49 +25,53 @@ namespace ENI2.EditControls
this.Loaded += SelectImportClassesDialog_Loaded;
}
- public List SelectedClasses
+ public List SelectedClasses
{
get { return _selectedClasses; }
}
+ ///
+ /// These messages are needed to derive message classes from, already sorted in the right manner
+ ///
+ public List Messages { get; set; }
+
public bool IsTransit { get; set; }
private void SelectImportClassesDialog_Loaded(object sender, RoutedEventArgs e)
{
- foreach(bsmd.database.Message.NotificationClass notificationClass in Enum.GetValues(typeof(bsmd.database.Message.NotificationClass)))
+ foreach(Message aMessage in this.Messages)
{
- if ((notificationClass == Message.NotificationClass.VISIT) ||
- (notificationClass == Message.NotificationClass.TRANSIT) ||
- (notificationClass == Message.NotificationClass.ATA) ||
- (notificationClass == Message.NotificationClass.ATD) ||
- (notificationClass == Message.NotificationClass.CREWD) ||
- (notificationClass == Message.NotificationClass.STO) ||
- (notificationClass == Message.NotificationClass.PASD)
+ if ((aMessage.MessageNotificationClass == Message.NotificationClass.VISIT) ||
+ (aMessage.MessageNotificationClass == Message.NotificationClass.TRANSIT) ||
+ (aMessage.MessageNotificationClass == Message.NotificationClass.ATA) ||
+ (aMessage.MessageNotificationClass == Message.NotificationClass.ATD) ||
+ (aMessage.MessageNotificationClass == Message.NotificationClass.CREWD) ||
+ (aMessage.MessageNotificationClass == Message.NotificationClass.STO) ||
+ (aMessage.MessageNotificationClass == Message.NotificationClass.PASD)
) continue;
if (IsTransit &&
- ((notificationClass == Message.NotificationClass.BKRD) ||
- (notificationClass == Message.NotificationClass.BPOL) ||
- (notificationClass == Message.NotificationClass.HAZD) ||
- (notificationClass == Message.NotificationClass.INFO) ||
- (notificationClass == Message.NotificationClass.LADG) ||
- (notificationClass == Message.NotificationClass.NAME) ||
- //(notificationClass == Message.NotificationClass.POBD) ||
- (notificationClass == Message.NotificationClass.PRE72H) ||
- (notificationClass == Message.NotificationClass.SERV) ||
- (notificationClass == Message.NotificationClass.TIEFD) ||
- (notificationClass == Message.NotificationClass.TOWD) ||
- (notificationClass == Message.NotificationClass.WAS)
+ ((aMessage.MessageNotificationClass == Message.NotificationClass.BKRD) ||
+ (aMessage.MessageNotificationClass == Message.NotificationClass.BPOL) ||
+ (aMessage.MessageNotificationClass == Message.NotificationClass.HAZD) ||
+ (aMessage.MessageNotificationClass == Message.NotificationClass.INFO) ||
+ (aMessage.MessageNotificationClass == Message.NotificationClass.LADG) ||
+ (aMessage.MessageNotificationClass == Message.NotificationClass.NAME) ||
+ (aMessage.MessageNotificationClass == Message.NotificationClass.PRE72H) ||
+ (aMessage.MessageNotificationClass == Message.NotificationClass.SERV) ||
+ (aMessage.MessageNotificationClass == Message.NotificationClass.TIEFD) ||
+ (aMessage.MessageNotificationClass == Message.NotificationClass.TOWD) ||
+ (aMessage.MessageNotificationClass == Message.NotificationClass.WAS)
)) continue;
SelectClass sc = new SelectClass();
- sc.Name = Enum.GetName(typeof(bsmd.database.Message.NotificationClass), notificationClass);
- sc.Class = notificationClass;
+ sc.Name = Enum.GetName(typeof(bsmd.database.Message.NotificationClass), aMessage.MessageNotificationClass);
+ sc.Class = aMessage.MessageNotificationClass;
sc.IsSelected = false;
_selectClasses.Add(sc);
}
- _selectClasses.Sort();
+
this.checkListBoxClasses.ItemsSource = _selectClasses;
this.OKClicked += SelectImportClassesDialog_OKClicked;
}
@@ -90,11 +84,11 @@ namespace ENI2.EditControls
}
}
- class SelectClass : IComparable, INotifyPropertyChanged
+ class SelectClass : INotifyPropertyChanged
{
private bool _isSelected;
public string Name { get; set; }
- public bsmd.database.Message.NotificationClass Class { get; set; }
+ public Message.NotificationClass Class { get; set; }
public bool IsSelected
{
get { return _isSelected; }
@@ -109,12 +103,7 @@ namespace ENI2.EditControls
protected void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
-
- public int CompareTo(object obj)
- {
- return Name.CompareTo(((SelectClass)obj).Name);
- }
+ }
}
private void buttonAll_Click(object sender, RoutedEventArgs e)
diff --git a/bsmd.database/Properties/AssemblyProductInfo.cs b/bsmd.database/Properties/AssemblyProductInfo.cs
index fa9d662a..1c950252 100644
--- a/bsmd.database/Properties/AssemblyProductInfo.cs
+++ b/bsmd.database/Properties/AssemblyProductInfo.cs
@@ -2,6 +2,6 @@
[assembly: AssemblyCompany("schick Informatik")]
[assembly: AssemblyProduct("BSMD NSW interface")]
-[assembly: AssemblyInformationalVersion("6.8.0")]
+[assembly: AssemblyInformationalVersion("6.8.1")]
[assembly: AssemblyCopyright("Copyright © 2014-2021 schick Informatik")]
[assembly: AssemblyTrademark("")]
\ No newline at end of file
diff --git a/bsmd.database/Properties/AssemblyProjectInfo.cs b/bsmd.database/Properties/AssemblyProjectInfo.cs
index 661a294a..74799200 100644
--- a/bsmd.database/Properties/AssemblyProjectInfo.cs
+++ b/bsmd.database/Properties/AssemblyProjectInfo.cs
@@ -1,4 +1,4 @@
using System.Reflection;
-[assembly: AssemblyVersion("6.8.0.*")]
+[assembly: AssemblyVersion("6.8.1.*")]