From 3c3fa5e1bd873b108cbe5bc9baf8c413239fa8ce Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Wed, 22 Jan 2025 17:05:28 +0100 Subject: [PATCH] Added sample sheet control, made display type selectable through reporting party dialog, updated references --- ENI2/AnmeldungenControl.xaml.cs | 7 +- ENI2/App.config | 2 +- ENI2/App.xaml.cs | 2 +- ENI2/DetailRootControl.xaml.cs | 43 +++--- ENI2/ENI2.csproj | 39 +++-- .../EditReportingPartyDialog.xaml | 14 +- .../EditReportingPartyDialog.xaml.cs | 4 + ENI2/MainWindow.xaml.cs | 4 +- ENI2/Properties/Resources.Designer.cs | 144 ++++++++++++++++++ ENI2/Properties/Resources.resx | 48 ++++++ ENI2/SheetDisplayControls/VoyageControl.xaml | 85 +++++++++++ .../VoyageControl.xaml.cs | 39 +++++ ENI2/SucheControl.xaml.cs | 46 ++++-- ENI2/packages.config | 16 +- .../bsmd.LockingService.csproj | 4 +- .../bsmd.LockingService.csproj.user | 2 +- bsmd.LockingService/packages.config | 2 +- bsmd.database/MessageCore.cs | 2 +- bsmd.database/ReportingParty.cs | 30 +++- 19 files changed, 461 insertions(+), 72 deletions(-) create mode 100644 ENI2/SheetDisplayControls/VoyageControl.xaml create mode 100644 ENI2/SheetDisplayControls/VoyageControl.xaml.cs diff --git a/ENI2/AnmeldungenControl.xaml.cs b/ENI2/AnmeldungenControl.xaml.cs index 24e4d7a5..be34290f 100644 --- a/ENI2/AnmeldungenControl.xaml.cs +++ b/ENI2/AnmeldungenControl.xaml.cs @@ -43,10 +43,9 @@ namespace ENI2 { DataGrid grid = sender as DataGrid; if(grid?.SelectedItems?.Count == 1) - { - DataGridRow dgr = grid.ItemContainerGenerator.ContainerFromItem(grid.SelectedItem) as DataGridRow; - MessageCore selectedCore = grid.SelectedItem as MessageCore; - this.DisplayCore(selectedCore); + { + MessageCore selectedCore = grid.SelectedItem as MessageCore; + this.DisplayCore(selectedCore); } } } diff --git a/ENI2/App.config b/ENI2/App.config index ef47ee44..98e36de5 100644 --- a/ENI2/App.config +++ b/ENI2/App.config @@ -85,7 +85,7 @@ - + diff --git a/ENI2/App.xaml.cs b/ENI2/App.xaml.cs index d1335ca9..68e72e8f 100644 --- a/ENI2/App.xaml.cs +++ b/ENI2/App.xaml.cs @@ -35,7 +35,7 @@ namespace ENI2 private ManualResetEvent ResetSplashCreated; private Thread _splashThread; - private ILog _log = LogManager.GetLogger(typeof(App).Name); + private readonly ILog _log = LogManager.GetLogger(typeof(App).Name); public App() : base() { diff --git a/ENI2/DetailRootControl.xaml.cs b/ENI2/DetailRootControl.xaml.cs index 4f559589..330b66b1 100644 --- a/ENI2/DetailRootControl.xaml.cs +++ b/ENI2/DetailRootControl.xaml.cs @@ -17,6 +17,7 @@ using ENI2.EditControls; using System.Windows.Input; using Microsoft.Office.Interop.Excel; using System.Linq; +using ENI2.SheetDisplayControls; namespace ENI2 { @@ -43,7 +44,7 @@ namespace ENI2 #region Properties - public MessageCore Core { get; private set; } + public MessageCore Core { get; private set; } public bool LockedByOtherUser { get; set; } @@ -146,7 +147,7 @@ namespace ENI2 #region Construction - public DetailRootControl(MessageCore aCore) + public DetailRootControl(MessageCore aCore, ReportingParty.ShipcallDisplayModeEnum displayMode) { Core = aCore; InitializeComponent(); @@ -154,23 +155,29 @@ namespace ENI2 shipEMailLabel.Text = aCore.HerbergEmailContactReportingVessel; displayIdLabel.Text = aCore.DisplayId; + // TODO: Hier muss es eine Unterscheidung geben, in welchem Darstellungs-Mode der Anlauf dargestellt wird (Classic oder Formblatt) - // Listbox befüllen - this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textOverview, MessageGroupControlType = typeof(OverViewDetailControl), ImagePath = "Resources/documents.png" }); - this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textPortCall, MessageGroupControlType = typeof(PortCallDetailControl), ImagePath = "Resources/eye_blue.png" }); - this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textPortNotification, MessageGroupControlType = typeof(PortNotificationDetailControl), ImagePath = "Resources/anchor.png" }); - this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textWaste, MessageGroupControlType = typeof(WasteDetailControl), ImagePath = "Resources/garbage.png" }); - this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textArrivalNotification, MessageGroupControlType = typeof(ArrivalNotificationDetailControl), ImagePath = "Resources/arrow_down_right_red.png" }); - this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textSecurity, MessageGroupControlType = typeof(SecurityDetailControl), ImagePath = "Resources/shield_yellow.png" }); - this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textPSC72h, MessageGroupControlType = typeof(PSC72hDetailControl), ImagePath = "Resources/alarmclock.png" }); - this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textMDH, MessageGroupControlType = typeof(MaritimeHealthDeclarationDetailControl), ImagePath = "Resources/medical_bag.png" }); - this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textDepartureNotification, MessageGroupControlType = typeof(DepartureNotificationDetailControl), ImagePath = "Resources/arrow_up_right_green.png" }); - this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textShipData, MessageGroupControlType = typeof(ShipDataDetailControl), ImagePath = "Resources/containership.png" }); - this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textBorderPolice, MessageGroupControlType = typeof(BorderPoliceDetailControl), ImagePath = "Resources/policeman_german.png" }); - this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textDGArrival, MessageGroupControlType = typeof(DangerousGoodsDetailControl), ImagePath = "Resources/sign_warning_radiation.png" }); - this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textDGDeparture, MessageGroupControlType = typeof(DangerousGoodsDetailControl), ImagePath = "Resources/sign_warning_radiation.png" }); - this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textTowage, MessageGroupControlType = typeof(TowageDetailControl), ImagePath = "Resources/ship2.png" }); - + if (displayMode == ReportingParty.ShipcallDisplayModeEnum.CLASSIC) + { + this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textOverview, MessageGroupControlType = typeof(OverViewDetailControl), ImagePath = "Resources/documents.png" }); + this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textPortCall, MessageGroupControlType = typeof(PortCallDetailControl), ImagePath = "Resources/eye_blue.png" }); + this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textPortNotification, MessageGroupControlType = typeof(PortNotificationDetailControl), ImagePath = "Resources/anchor.png" }); + this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textWaste, MessageGroupControlType = typeof(WasteDetailControl), ImagePath = "Resources/garbage.png" }); + this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textArrivalNotification, MessageGroupControlType = typeof(ArrivalNotificationDetailControl), ImagePath = "Resources/arrow_down_right_red.png" }); + this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textSecurity, MessageGroupControlType = typeof(SecurityDetailControl), ImagePath = "Resources/shield_yellow.png" }); + this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textPSC72h, MessageGroupControlType = typeof(PSC72hDetailControl), ImagePath = "Resources/alarmclock.png" }); + this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textMDH, MessageGroupControlType = typeof(MaritimeHealthDeclarationDetailControl), ImagePath = "Resources/medical_bag.png" }); + this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textDepartureNotification, MessageGroupControlType = typeof(DepartureNotificationDetailControl), ImagePath = "Resources/arrow_up_right_green.png" }); + this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textShipData, MessageGroupControlType = typeof(ShipDataDetailControl), ImagePath = "Resources/containership.png" }); + this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textBorderPolice, MessageGroupControlType = typeof(BorderPoliceDetailControl), ImagePath = "Resources/policeman_german.png" }); + this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textDGArrival, MessageGroupControlType = typeof(DangerousGoodsDetailControl), ImagePath = "Resources/sign_warning_radiation.png" }); + this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textDGDeparture, MessageGroupControlType = typeof(DangerousGoodsDetailControl), ImagePath = "Resources/sign_warning_radiation.png" }); + this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textTowage, MessageGroupControlType = typeof(TowageDetailControl), ImagePath = "Resources/ship2.png" }); + } + else + { + this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.text1Voyage, MessageGroupControlType = typeof(VoyageControl), ImagePath = "Resources/ship2.png" }); + } this.listBoxMessages.ItemsSource = this._listBoxList; diff --git a/ENI2/ENI2.csproj b/ENI2/ENI2.csproj index 37978d51..d8fcf8ec 100644 --- a/ENI2/ENI2.csproj +++ b/ENI2/ENI2.csproj @@ -140,26 +140,26 @@ packages\log4net.3.0.3\lib\net462\log4net.dll - - packages\Microsoft.Bcl.AsyncInterfaces.9.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll + + packages\Microsoft.Bcl.AsyncInterfaces.9.0.1\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll - - packages\Microsoft.Extensions.DependencyInjection.9.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.dll + + packages\Microsoft.Extensions.DependencyInjection.9.0.1\lib\net462\Microsoft.Extensions.DependencyInjection.dll - - packages\Microsoft.Extensions.DependencyInjection.Abstractions.9.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll + + packages\Microsoft.Extensions.DependencyInjection.Abstractions.9.0.1\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll - - packages\Microsoft.Extensions.Logging.9.0.0\lib\net462\Microsoft.Extensions.Logging.dll + + packages\Microsoft.Extensions.Logging.9.0.1\lib\net462\Microsoft.Extensions.Logging.dll - - packages\Microsoft.Extensions.Logging.Abstractions.9.0.0\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll + + packages\Microsoft.Extensions.Logging.Abstractions.9.0.1\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll - - packages\Microsoft.Extensions.Options.9.0.0\lib\net462\Microsoft.Extensions.Options.dll + + packages\Microsoft.Extensions.Options.9.0.1\lib\net462\Microsoft.Extensions.Options.dll - - packages\Microsoft.Extensions.Primitives.9.0.0\lib\net462\Microsoft.Extensions.Primitives.dll + + packages\Microsoft.Extensions.Primitives.9.0.1\lib\net462\Microsoft.Extensions.Primitives.dll packages\Microsoft.Office.Interop.Excel.15.0.4795.1001\lib\net20\Microsoft.Office.Interop.Excel.dll @@ -202,8 +202,8 @@ packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.119.0\lib\net46\System.Data.SQLite.dll - - packages\System.Diagnostics.DiagnosticSource.9.0.0\lib\net462\System.Diagnostics.DiagnosticSource.dll + + packages\System.Diagnostics.DiagnosticSource.9.0.1\lib\net462\System.Diagnostics.DiagnosticSource.dll @@ -493,6 +493,9 @@ True Reference.svcmap + + VoyageControl.xaml + SplashScreenWindow.xaml @@ -802,6 +805,10 @@ MainWindow.xaml Code + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/ENI2/EditControls/EditReportingPartyDialog.xaml b/ENI2/EditControls/EditReportingPartyDialog.xaml index 2867e0b2..86de7479 100644 --- a/ENI2/EditControls/EditReportingPartyDialog.xaml +++ b/ENI2/EditControls/EditReportingPartyDialog.xaml @@ -8,7 +8,7 @@ xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:p="clr-namespace:ENI2.Properties" mc:Ignorable="d" - Title="{x:Static p:Resources.textReportingParty}" Height="350" Width="800" WindowStyle="SingleBorderWindow" Background="AliceBlue"> + Title="{x:Static p:Resources.textReportingParty}" Height="378" Width="800" WindowStyle="SingleBorderWindow" Background="AliceBlue"> @@ -21,6 +21,7 @@ + @@ -46,9 +47,10 @@ diff --git a/ENI2/EditControls/EditReportingPartyDialog.xaml.cs b/ENI2/EditControls/EditReportingPartyDialog.xaml.cs index d792f080..5ed5889d 100644 --- a/ENI2/EditControls/EditReportingPartyDialog.xaml.cs +++ b/ENI2/EditControls/EditReportingPartyDialog.xaml.cs @@ -2,6 +2,7 @@ // Description: Reporting party Bearbeitungsdialog // +using System; using System.Windows; using bsmd.database; @@ -24,6 +25,7 @@ namespace ENI2.EditControls private void EditReportingPartyDialog_Loaded(object sender, RoutedEventArgs e) { + this.comboBoxDefaultDisplay.ItemsSource = Util.EnumHelper.GetAllValuesAndDescription(typeof(ReportingParty.ShipcallDisplayModeEnum)); this.textBoxCity.Text = this.ReportingParty.City; this.textBoxCountry.Text = this.ReportingParty.Country; this.textBoxEMail.Text = this.ReportingParty.EMail; @@ -40,6 +42,7 @@ namespace ENI2.EditControls this.checkBoxAdministrator.IsChecked = this.ReportingParty.IsAdmin; this.checkBoxArchived.IsChecked = this.ReportingParty.IsArchived; this.checkBoxEditor.IsChecked = this.ReportingParty.IsEditor; + this.comboBoxDefaultDisplay.SelectedValue = this.ReportingParty.ShipcallDisplayMode; this.dateTimePickerChanged.Content = this.ReportingParty.Changed.HasValue ? this.ReportingParty.Changed.ToString() : ""; this.dateTimePickerCreated.Content = this.ReportingParty.Created.HasValue ? this.ReportingParty.Created.ToString() : ""; @@ -62,6 +65,7 @@ namespace ENI2.EditControls this.ReportingParty.StreetAndNumber = this.textBoxStreetNumber.Text.Trim(); this.ReportingParty.UserEMail = this.textBoxUserEMail.Text.Trim(); this.ReportingParty.Logon = this.textBoxUserLogon.Text.Trim(); + this.ReportingParty.ShipcallDisplayMode = (ReportingParty.ShipcallDisplayModeEnum) Enum.Parse(typeof(ReportingParty.ShipcallDisplayModeEnum), (string) this.comboBoxDefaultDisplay.SelectedValue); if(!this.passwordBoxPassword.Password.IsNullOrEmpty()) { diff --git a/ENI2/MainWindow.xaml.cs b/ENI2/MainWindow.xaml.cs index 5f4746c1..01bcc4b2 100644 --- a/ENI2/MainWindow.xaml.cs +++ b/ENI2/MainWindow.xaml.cs @@ -79,7 +79,7 @@ namespace ENI2 #region Search related event handler - private void AnmeldungenControl_MessageCoreSelected(MessageCore aMessageCore) + private void AnmeldungenControl_MessageCoreSelected(MessageCore aMessageCore, ReportingParty.ShipcallDisplayModeEnum displayMode = ReportingParty.ShipcallDisplayModeEnum.CLASSIC) { if(aMessageCore != null) { @@ -120,7 +120,7 @@ namespace ENI2 iDidLockIt); searchResultItem.IsCancelled = aMessageCore.Cancelled ?? false; - DetailRootControl drc = new DetailRootControl(aMessageCore); + DetailRootControl drc = new DetailRootControl(aMessageCore, displayMode); drc.LockedByOtherUser = !iDidLockIt; if (!(aMessageCore.Cancelled ?? false)) diff --git a/ENI2/Properties/Resources.Designer.cs b/ENI2/Properties/Resources.Designer.cs index 2772e9f6..6cdb7d4d 100644 --- a/ENI2/Properties/Resources.Designer.cs +++ b/ENI2/Properties/Resources.Designer.cs @@ -830,6 +830,114 @@ namespace ENI2.Properties { } } + /// + /// Looks up a localized string similar to 1.10 Maritime health data. + /// + public static string text110MaritimeHealthData { + get { + return ResourceManager.GetString("text110MaritimeHealthData", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1.11 Port of itinerary. + /// + public static string text111PortOfItinerary { + get { + return ResourceManager.GetString("text111PortOfItinerary", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1.1 Previous port. + /// + public static string text11PreviousPort { + get { + return ResourceManager.GetString("text11PreviousPort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1.2 Incoming voyage. + /// + public static string text12IncomingVoyage { + get { + return ResourceManager.GetString("text12IncomingVoyage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1.3 Relevant Portcall (port of call) / Kiel-Canal-Transit. + /// + public static string text13RelevantPortcall { + get { + return ResourceManager.GetString("text13RelevantPortcall", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1.4 Outgoing voyage. + /// + public static string text14OutgoingVoyage { + get { + return ResourceManager.GetString("text14OutgoingVoyage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1.5 Next port. + /// + public static string text15NextPort { + get { + return ResourceManager.GetString("text15NextPort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1.5 Voyage. + /// + public static string text16Voyage { + get { + return ResourceManager.GetString("text16Voyage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1.7 Last 10 port facilities called. + /// + public static string text17Last10PortFacilitiesCalled { + get { + return ResourceManager.GetString("text17Last10PortFacilitiesCalled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1.8 Ship to ship activities during last 10 port facilities called. + /// + public static string text18ShipToShip { + get { + return ResourceManager.GetString("text18ShipToShip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1.9 Ports called during the last 30 days. + /// + public static string text19PortsCalled30days { + get { + return ResourceManager.GetString("text19PortsCalled30days", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1. Voyage. + /// + public static string text1Voyage { + get { + return ResourceManager.GetString("text1Voyage", resourceCulture); + } + } + /// /// Looks up a localized string similar to About ENI-2. /// @@ -2000,6 +2108,15 @@ namespace ENI2.Properties { } } + /// + /// Looks up a localized string similar to Default display. + /// + public static string textDefaultDisplay { + get { + return ResourceManager.GetString("textDefaultDisplay", resourceCulture); + } + } + /// /// Looks up a localized string similar to _Delete. /// @@ -3620,6 +3737,24 @@ namespace ENI2.Properties { } } + /// + /// Looks up a localized string similar to Open in classic display mode. + /// + public static string textOpenClassic { + get { + return ResourceManager.GetString("textOpenClassic", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Open in form sheet display mode. + /// + public static string textOpenFormsheet { + get { + return ResourceManager.GetString("textOpenFormsheet", resourceCulture); + } + } + /// /// Looks up a localized string similar to Operations. /// @@ -5303,6 +5438,15 @@ namespace ENI2.Properties { } } + /// + /// Looks up a localized string similar to Voyage. + /// + public static string textVoyage { + get { + return ResourceManager.GetString("textVoyage", resourceCulture); + } + } + /// /// Looks up a localized string similar to Waiting for Id... /// diff --git a/ENI2/Properties/Resources.resx b/ENI2/Properties/Resources.resx index bf125179..2b26ba5a 100644 --- a/ENI2/Properties/Resources.resx +++ b/ENI2/Properties/Resources.resx @@ -1912,4 +1912,52 @@ This will delete all entries. Are you sure? + + Voyage + + + 1.1 Previous port + + + 1.2 Incoming voyage + + + 1.3 Relevant Portcall (port of call) / Kiel-Canal-Transit + + + 1.4 Outgoing voyage + + + 1.5 Next port + + + 1.5 Voyage + + + 1.7 Last 10 port facilities called + + + 1.8 Ship to ship activities during last 10 port facilities called + + + 1.9 Ports called during the last 30 days + + + 1.10 Maritime health data + + + 1.11 Port of itinerary + + + Default display + + + Open in classic display mode + + + Open in form sheet display mode + + + 1. Voyage + \ No newline at end of file diff --git a/ENI2/SheetDisplayControls/VoyageControl.xaml b/ENI2/SheetDisplayControls/VoyageControl.xaml new file mode 100644 index 00000000..3fa74b0f --- /dev/null +++ b/ENI2/SheetDisplayControls/VoyageControl.xaml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ENI2/SheetDisplayControls/VoyageControl.xaml.cs b/ENI2/SheetDisplayControls/VoyageControl.xaml.cs new file mode 100644 index 00000000..4b4cdc7b --- /dev/null +++ b/ENI2/SheetDisplayControls/VoyageControl.xaml.cs @@ -0,0 +1,39 @@ +// Copyright (c) 2025 - schick Informatik +// Description: +// + +using System.Windows; + +using bsmd.database; +using ENI2.EditControls; +using System.Windows.Media; +using System.Windows.Controls; +using System.Windows.Media.Imaging; +using System; + + +namespace ENI2.SheetDisplayControls +{ + /// + /// Interaction logic for VoyageControl.xaml + /// + public partial class VoyageControl : DetailBaseControl + { + public VoyageControl() + { + InitializeComponent(); + } + + #region mouse wheel + + private void ScrollViewer_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e) + { + ScrollViewer scv = (ScrollViewer)sender; + scv.ScrollToVerticalOffset(scv.VerticalOffset - e.Delta); + e.Handled = true; + } + + #endregion + + } +} diff --git a/ENI2/SucheControl.xaml.cs b/ENI2/SucheControl.xaml.cs index 3bd879e1..1d63af8f 100644 --- a/ENI2/SucheControl.xaml.cs +++ b/ENI2/SucheControl.xaml.cs @@ -72,14 +72,24 @@ namespace ENI2 cancelItem.Visibility = Visibility.Collapsed; this.dataGrid.ContextMenu.Items.Add(cancelItem); + this.dataGrid.ContextMenu.Items.Add(new Separator()); + + MenuItem classicOpen = new MenuItem(); + classicOpen.Header = Properties.Resources.textOpenClassic; + classicOpen.Click += ClassicOpen_Click; + this.dataGrid.ContextMenu.Items.Add(classicOpen); + + MenuItem formOpen = new MenuItem(); + formOpen.Header = Properties.Resources.textOpenFormsheet; + formOpen.Click += FormOpen_Click; + this.dataGrid.ContextMenu.Items.Add(formOpen); + if (Keyboard.IsKeyDown(Key.LeftShift)) { efMode = true; logoImage.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/ef_logo.png")); } - } - - + } #endregion @@ -256,20 +266,20 @@ namespace ENI2 #region Selection event handling - private void DisplayCore(MessageCore core) + private void DisplayCore(MessageCore core, ReportingParty.ShipcallDisplayModeEnum displayMode) { if (core != null) { - this.OnMessageCoreSelected(core); + this.OnMessageCoreSelected(core, displayMode); } } - protected void OnMessageCoreSelected(MessageCore aMessageCore) + protected void OnMessageCoreSelected(MessageCore aMessageCore, ReportingParty.ShipcallDisplayModeEnum displayMode) { if ((this.MessageCoreSelected != null) && (aMessageCore != null)) { Util.UIHelper.SetBusyState(); - this.MessageCoreSelected(aMessageCore); + this.MessageCoreSelected(aMessageCore, displayMode); } } @@ -282,7 +292,7 @@ namespace ENI2 { // DataGridRow dgr = grid.ItemContainerGenerator.ContainerFromItem(grid.SelectedItem) as DataGridRow; MessageCore selectedCore = grid.SelectedItem as MessageCore; - this.DisplayCore(selectedCore); + this.DisplayCore(selectedCore, DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].ShipcallDisplayMode); } } } @@ -292,7 +302,7 @@ namespace ENI2 if ((e.Key == Key.Return) || (e.Key == Key.Enter)) { MessageCore selectedCore = dataGrid.SelectedItem as MessageCore; - this.DisplayCore(selectedCore); + this.DisplayCore(selectedCore, DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].ShipcallDisplayMode); } else { @@ -330,6 +340,24 @@ namespace ENI2 } } + private void FormOpen_Click(object sender, RoutedEventArgs e) + { + if (this.dataGrid.SelectedItems?.Count == 1) + { + MessageCore selectedCore = this.dataGrid.SelectedItem as MessageCore; + this.DisplayCore(selectedCore, ReportingParty.ShipcallDisplayModeEnum.FORMSHEET); + } + } + + private void ClassicOpen_Click(object sender, RoutedEventArgs e) + { + if (this.dataGrid.SelectedItems?.Count == 1) + { + MessageCore selectedCore = this.dataGrid.SelectedItem as MessageCore; + this.DisplayCore(selectedCore, ReportingParty.ShipcallDisplayModeEnum.CLASSIC); + } + } + #endregion private void logoImage_MouseUp(object sender, MouseButtonEventArgs e) diff --git a/ENI2/packages.config b/ENI2/packages.config index 28b9df1f..ba183d3a 100644 --- a/ENI2/packages.config +++ b/ENI2/packages.config @@ -6,19 +6,19 @@ Sample license text. - - - - - - - + + + + + + + - + diff --git a/bsmd.LockingService/bsmd.LockingService.csproj b/bsmd.LockingService/bsmd.LockingService.csproj index a1b9cc55..a832ad31 100644 --- a/bsmd.LockingService/bsmd.LockingService.csproj +++ b/bsmd.LockingService/bsmd.LockingService.csproj @@ -46,8 +46,8 @@ 4 - - ..\ENI2\packages\log4net.3.0.1\lib\net462\log4net.dll + + ..\ENI2\packages\log4net.3.0.3\lib\net462\log4net.dll diff --git a/bsmd.LockingService/bsmd.LockingService.csproj.user b/bsmd.LockingService/bsmd.LockingService.csproj.user index afa33dd1..f74e64f4 100644 --- a/bsmd.LockingService/bsmd.LockingService.csproj.user +++ b/bsmd.LockingService/bsmd.LockingService.csproj.user @@ -1,4 +1,4 @@ - + true diff --git a/bsmd.LockingService/packages.config b/bsmd.LockingService/packages.config index 6bae6f53..2efad76e 100644 --- a/bsmd.LockingService/packages.config +++ b/bsmd.LockingService/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/bsmd.database/MessageCore.cs b/bsmd.database/MessageCore.cs index a3a113d2..1e4eca7f 100644 --- a/bsmd.database/MessageCore.cs +++ b/bsmd.database/MessageCore.cs @@ -31,7 +31,7 @@ namespace bsmd.database #region selection delegate definition - public delegate void MessageCoreSelectedHandler(MessageCore aMessageCore); + public delegate void MessageCoreSelectedHandler(MessageCore aMessageCore, ReportingParty.ShipcallDisplayModeEnum displayMode = ReportingParty.ShipcallDisplayModeEnum.CLASSIC); #endregion diff --git a/bsmd.database/ReportingParty.cs b/bsmd.database/ReportingParty.cs index d4e63e50..7b1532df 100644 --- a/bsmd.database/ReportingParty.cs +++ b/bsmd.database/ReportingParty.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Data.SqlClient; using System.Text; using System.Security.Cryptography; +using System.ComponentModel; namespace bsmd.database { @@ -19,11 +20,19 @@ namespace bsmd.database OK, FAILED, USERUKN - } + } public enum ReportingPartyTypeEnum { MASTER, SHIPOWNER, CHARTERER, AGENT, PORT_AUTHORITY, CARRIER, OTHERS } + public enum ShipcallDisplayModeEnum + { + [Description("Classic display")] + CLASSIC, + [Description("New formsheet display")] + FORMSHEET + } + [Flags] internal enum UserFlags : int { @@ -46,7 +55,11 @@ namespace bsmd.database /// /// kann bestimmte Dinge (e.g. templates) im ENI bearbeiten /// - EDITOR = 8 + EDITOR = 8, + /// + /// Beim Klick auf einen Anlauf soll sich per default die "neue" Formansicht öffnen + /// + DEFAULTFORMVIEW = 16 }; #endregion @@ -166,6 +179,19 @@ namespace bsmd.database set { this.SetUserFlag(value, UserFlags.EDITOR); } } + public ShipcallDisplayModeEnum ShipcallDisplayMode + { + get + { + if ((this.Flags & (int)UserFlags.DEFAULTFORMVIEW) != 0) return ShipcallDisplayModeEnum.FORMSHEET; + else return ShipcallDisplayModeEnum.CLASSIC; + } + set + { + this.SetUserFlag(value != ShipcallDisplayModeEnum.CLASSIC, UserFlags.DEFAULTFORMVIEW); + } + } + #endregion #endregion