From 7c64d66ac5c148c4d7d8aff9814e5db53bbce175 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Sat, 26 Aug 2017 15:52:03 +0000 Subject: [PATCH] Sehr lange Korrekturliste bearbeitet, Uploaddetails gefixt usw. --- .../DangerousGoodsDetailControl.xaml.cs | 174 +++++++++++++++++- ...aritimeHealthDeclarationDetailControl.xaml | 4 +- .../PSC72hDetailControl.xaml | 2 +- .../PortCallDetailControl.xaml.cs | 3 +- .../PortNotificationDetailControl.xaml.cs | 66 +++++-- .../TowageDetailControl.xaml.cs | 52 ++++-- .../WasteDetailControl.xaml | 10 +- .../WasteDetailControl.xaml.cs | 13 ++ ENI-2/ENI2/ENI2/ENI2.csproj | 2 +- .../ENI2/EditControls/EditCREWDialog.xaml | 14 +- .../ENI2/EditControls/EditCREWDialog.xaml.cs | 2 +- .../ENI2/ENI2/EditControls/EditIBCDialog.xaml | 18 +- .../ENI2/ENI2/EditControls/EditIGCDialog.xaml | 16 +- .../ENI2/EditControls/EditIMDGDialog.xaml | 60 +++--- .../ENI2/EditControls/EditIMSBCDialog.xaml | 14 +- .../ENI2/EditControls/EditLADGDialog.xaml.cs | 38 +++- .../ENI2/EditControls/EditMarpolDialog.xaml | 3 +- .../ENI2/ENI2/EditControls/EditPasDialog.xaml | 14 +- .../ENI2/EditControls/EditPasDialog.xaml.cs | 8 +- .../EditPortOfItineraryDialog.xaml | 2 +- .../ENI2/EditControls/EditSERVDialog.xaml.cs | 10 +- .../ENI2/ENI2/EditControls/EditTOWDialog.xaml | 29 +-- .../ENI2/EditControls/EditWasteDialog.xaml | 10 +- ENI-2/ENI2/ENI2/LocalizedLookup.cs | 4 + .../ENI2/Properties/Resources.Designer.cs | 18 ++ ENI-2/ENI2/ENI2/Properties/Resources.resx | 6 + Stundensheet.xlsx | Bin 32850 -> 32922 bytes .../bsmd.ExcelReadService/ExcelReader.cs | 2 +- nsw/Source/bsmd.ExcelReadService/Util.cs | 18 +- nsw/Source/bsmd.database/DBManager.cs | 21 +++ nsw/Source/bsmd.database/IBCPosition.cs | 22 +++ nsw/Source/bsmd.database/IGCPosition.cs | 19 ++ nsw/Source/bsmd.database/IMDGPosition.cs | 46 ++++- nsw/Source/bsmd.database/IMSBCPosition.cs | 20 ++ nsw/Source/bsmd.database/ImportValue.cs | 28 ++- .../bsmd.database/MARPOL_Annex_I_Position.cs | 16 ++ nsw/Source/bsmd.database/Message.cs | 10 +- nsw/Source/bsmd.database/MessageCore.cs | 17 +- .../Properties/AssemblyProductInfo.cs | 2 +- .../Properties/AssemblyProjectInfo.cs | 2 +- nsw/Source/bsmd.database/TOWD.cs | 27 ++- nsw/Source/bsmd.hisnord/Request.cs | 89 +++++---- nsw/Source/bsmd.hisnord/Response.cs | 50 +++-- 43 files changed, 768 insertions(+), 213 deletions(-) diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/DangerousGoodsDetailControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailViewControls/DangerousGoodsDetailControl.xaml.cs index 94e33b18..897eaddb 100644 --- a/ENI-2/ENI2/ENI2/DetailViewControls/DangerousGoodsDetailControl.xaml.cs +++ b/ENI-2/ENI2/ENI2/DetailViewControls/DangerousGoodsDetailControl.xaml.cs @@ -7,6 +7,9 @@ using System.Windows; using bsmd.database; using ENI2.EditControls; using ENI2.Util; +using System.Windows.Controls; +using System.Windows.Media.Imaging; +using System; namespace ENI2.DetailViewControls { @@ -18,6 +21,7 @@ namespace ENI2.DetailViewControls private Message _hazMessage; private HAZ haz; + private HAZ hazd; // referenz auf HAZD, falls das hier HAZA ist und wir Positionen kopieren wollen public DangerousGoodsDetailControl() { @@ -30,8 +34,8 @@ namespace ENI2.DetailViewControls this.RegisterCheckboxChange(this.checkBoxDangerousGoodsOnBoard, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA); this.RegisterCheckboxChange(this.checkBoxDGManifestOnBoard, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA); this.RegisterCheckboxChange(this.checkBoxMoUBaltic, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA); - this.RegisterComboboxIndexChange(this.comboBoxVesselClass, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA); - } + this.RegisterComboboxIndexChange(this.comboBoxVesselClass, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA); + } public bool IsDeparture { get; set; } @@ -47,7 +51,28 @@ namespace ENI2.DetailViewControls } else { - if (aMessage.MessageNotificationClass == Message.NotificationClass.HAZA) { this._hazMessage = aMessage; this.ControlMessages.Add(aMessage); } + if (aMessage.MessageNotificationClass == Message.NotificationClass.HAZA) + { + this._hazMessage = aMessage; + this.ControlMessages.Add(aMessage); + } + if (aMessage.MessageNotificationClass == Message.NotificationClass.HAZD) + { + if(aMessage != null) + { + if (aMessage.Elements.Count > 0) + this.hazd = aMessage.Elements[0] as HAZ; + if (this.hazd == null) + { + this.hazd = new HAZ(); + this.hazd.MessageCore = this.Core; + this.hazd.MessageHeader = aMessage; + aMessage.Elements.Add(this.hazd); + SublistElementChanged(Message.NotificationClass.HAZD); + } + this.ControlMessages.Add(aMessage); + } + } } } @@ -113,8 +138,151 @@ namespace ENI2.DetailViewControls #endregion + if (!this.haz.IsDeparture) + { + #region Extra Menüpunkte um Positionen nach HAZD zu kopieren + + this.dataGridIBCItems.ContextMenu.Items.Add(new Separator()); + MenuItem copyIBCItem = new MenuItem(); + copyIBCItem.Header = Properties.Resources.textCopyToHAZD; + copyIBCItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) }; + copyIBCItem.Click += new RoutedEventHandler(this.copyIBC); + this.dataGridIBCItems.ContextMenu.Items.Add(copyIBCItem); + + this.dataGridIGCItems.ContextMenu.Items.Add(new Separator()); + MenuItem copyItemIGC = new MenuItem(); + copyItemIGC.Header = Properties.Resources.textCopyToHAZD; + copyItemIGC.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) }; + copyItemIGC.Click += new RoutedEventHandler(this.copyIGC); + this.dataGridIGCItems.ContextMenu.Items.Add(copyItemIGC); + + this.dataGridIMDGItems.ContextMenu.Items.Add(new Separator()); + MenuItem copyItemIMDG = new MenuItem(); + copyItemIMDG.Header = Properties.Resources.textCopyToHAZD; + copyItemIMDG.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) }; + copyItemIMDG.Click += new RoutedEventHandler(this.copyIMDG); + this.dataGridIMDGItems.ContextMenu.Items.Add(copyItemIMDG); + + this.dataGridIMSBCItems.ContextMenu.Items.Add(new Separator()); + MenuItem copyItemIMSBC = new MenuItem(); + copyItemIMSBC.Header = Properties.Resources.textCopyToHAZD; + copyItemIMSBC.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) }; + copyItemIMSBC.Click += new RoutedEventHandler(this.copyIMSBC); + this.dataGridIMSBCItems.ContextMenu.Items.Add(copyItemIMSBC); + + this.dataGridMARPOLItems.ContextMenu.Items.Add(new Separator()); + MenuItem copyItemMARPOL = new MenuItem(); + copyItemMARPOL.Header = Properties.Resources.textCopyToHAZD; + copyItemMARPOL.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) }; + copyItemMARPOL.Click += new RoutedEventHandler(this.copyMARPOL); + this.dataGridMARPOLItems.ContextMenu.Items.Add(copyItemMARPOL); + + #endregion + + } + + this._initialized = true; } + #region Copy event handler + + private void copyMARPOL(object sender, RoutedEventArgs e) + { + // aus dem aktuell selektierten MARPOL Element ein neues MARPOL Element machen und nach HAZD kopieren + if ((this.dataGridMARPOLItems.SelectedItems != null) && (this.dataGridMARPOLItems.SelectedItems.Count == 1)) + { + MARPOL_Annex_I_Position selectedMARPOL = this.dataGridMARPOLItems.SelectedItems[0] as MARPOL_Annex_I_Position; + if (selectedMARPOL != null) + { + MARPOL_Annex_I_Position copyMARPOL = new MARPOL_Annex_I_Position(); + copyMARPOL.MessageHeader = this.hazd.MessageHeader; + copyMARPOL.HAZ = this.hazd; + copyMARPOL.CopyFromMARPOL(selectedMARPOL); + copyMARPOL.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.MARPOLPositions); + this.hazd.MARPOLPositions.Add(copyMARPOL); + this.SublistElementChanged(Message.NotificationClass.HAZD); + } + } + } + + private void copyIMSBC(object sender, RoutedEventArgs e) + { + // aus dem aktuell selektierten IMBSC Element ein neues IMBSC Element machen und nach HAZD kopieren + if ((this.dataGridIMSBCItems.SelectedItems != null) && (this.dataGridIMSBCItems.SelectedItems.Count == 1)) + { + IMSBCPosition selectedIMSBC = this.dataGridIMSBCItems.SelectedItems[0] as IMSBCPosition; + if (selectedIMSBC != null) + { + IMSBCPosition copyIMSBC = new IMSBCPosition(); + copyIMSBC.MessageHeader = this.hazd.MessageHeader; + copyIMSBC.HAZ = this.hazd; + copyIMSBC.CopyFromIMSBC(selectedIMSBC); + copyIMSBC.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.IMSBCPositions); + this.hazd.IMSBCPositions.Add(copyIMSBC); + this.SublistElementChanged(Message.NotificationClass.HAZD); + } + } + } + + private void copyIMDG(object sender, RoutedEventArgs e) + { + // aus dem aktuell selektierten IMDG Element ein neues IMDG Element machen und nach HAZD kopieren + if ((this.dataGridIMDGItems.SelectedItems != null) && (this.dataGridIMDGItems.SelectedItems.Count == 1)) + { + IMDGPosition selectedIMDG = this.dataGridIMDGItems.SelectedItems[0] as IMDGPosition; + if (selectedIMDG != null) + { + IMDGPosition copyIMDG = new IMDGPosition(); + copyIMDG.MessageHeader = this.hazd.MessageHeader; + copyIMDG.HAZ = this.hazd; + copyIMDG.CopyFromIMDG(selectedIMDG); + copyIMDG.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.IMDGPositions); + this.hazd.IMDGPositions.Add(copyIMDG); + this.SublistElementChanged(Message.NotificationClass.HAZD); + } + } + } + + private void copyIGC(object sender, RoutedEventArgs e) + { + // aus dem aktuell selektierten IGC Element ein neues IGC Element machen und nach HAZD kopieren + if ((this.dataGridIGCItems.SelectedItems != null) && (this.dataGridIGCItems.SelectedItems.Count == 1)) + { + IGCPosition selectedIGC = this.dataGridIGCItems.SelectedItems[0] as IGCPosition; + if (selectedIGC != null) + { + IGCPosition copyIGC = new IGCPosition(); + copyIGC.MessageHeader = this.hazd.MessageHeader; + copyIGC.HAZ = this.hazd; + copyIGC.CopyFromIGC(selectedIGC); + copyIGC.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.IGCPositions); + this.hazd.IGCPositions.Add(copyIGC); + this.SublistElementChanged(Message.NotificationClass.HAZD); + } + } + } + + private void copyIBC(object sender, RoutedEventArgs e) + { + // aus dem aktuell selektierten IBC Element ein neues IBC Element machen und nach HAZD kopieren + if ((this.dataGridIBCItems.SelectedItems != null) && (this.dataGridIBCItems.SelectedItems.Count == 1)) + { + IBCPosition selectedIBC = this.dataGridIBCItems.SelectedItems[0] as IBCPosition; + if (selectedIBC != null) + { + IBCPosition copyIBC = new IBCPosition(); + copyIBC.MessageHeader = this.hazd.MessageHeader; + copyIBC.HAZ = this.hazd; + copyIBC.CopyFromIBC(selectedIBC); + copyIBC.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.IBCPositions); + this.hazd.IBCPositions.Add(copyIBC); + this.SublistElementChanged(Message.NotificationClass.HAZD); + } + } + } + + #endregion + #region MARPOL datagrid handlers private void DataGridMARPOLItems_DeleteRequested(DatabaseEntity obj) diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml b/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml index 561ead12..40416b17 100644 --- a/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml +++ b/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml @@ -124,7 +124,7 @@ SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0"> - + @@ -146,7 +146,7 @@ - + diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/PSC72hDetailControl.xaml b/ENI-2/ENI2/ENI2/DetailViewControls/PSC72hDetailControl.xaml index 28ce3b37..863a8528 100644 --- a/ENI-2/ENI2/ENI2/DetailViewControls/PSC72hDetailControl.xaml +++ b/ENI-2/ENI2/ENI2/DetailViewControls/PSC72hDetailControl.xaml @@ -39,7 +39,7 @@