Korrekturen / Erweiterungen für 6.8, PDF Export aus ENI2

This commit is contained in:
Daniel Schick 2021-12-23 08:01:48 +01:00
parent 04a086548a
commit 40dbb741ff
5 changed files with 44 additions and 46 deletions

View File

@ -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

View File

@ -37,7 +37,7 @@
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>6.8.0.0</ApplicationVersion>
<ApplicationVersion>6.8.1.0</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted>

View File

@ -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<bsmd.database.Message.NotificationClass> SelectedClasses
public List<Message.NotificationClass> SelectedClasses
{
get { return _selectedClasses; }
}
/// <summary>
/// These messages are needed to derive message classes from, already sorted in the right manner
/// </summary>
public List<Message> 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)

View File

@ -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("")]

View File

@ -1,4 +1,4 @@
using System.Reflection;
[assembly: AssemblyVersion("6.8.0.*")]
[assembly: AssemblyVersion("6.8.1.*")]