From 811d8c1eb459e7faf1db7ed41775eceda591ef85 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Sun, 3 Apr 2022 10:39:00 +0200 Subject: [PATCH] fixed Report error, fixed WAS_RCPT delete --- ENI2/DetailViewControls/WasteDetailControl.xaml.cs | 13 +++++++------ ENI2/Report/ReportDocument.cs | 6 +++++- bsmd.database/Properties/AssemblyProductInfo.cs | 2 +- bsmd.database/Properties/AssemblyProjectInfo.cs | 2 +- bsmd.hisnord/Request.cs | 2 +- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ENI2/DetailViewControls/WasteDetailControl.xaml.cs b/ENI2/DetailViewControls/WasteDetailControl.xaml.cs index 7d1e1890..3723b3d9 100644 --- a/ENI2/DetailViewControls/WasteDetailControl.xaml.cs +++ b/ENI2/DetailViewControls/WasteDetailControl.xaml.cs @@ -212,6 +212,7 @@ namespace ENI2.DetailViewControls { // are you sure dialog is in base class _wasRcptMessage.Elements.Remove(wasRCPT); + wasRCPT.DeleteElements(); DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(wasRCPT); DatabaseEntity.ResetIdentifiers(new List(_wasRcptMessage.Elements)); this.SublistElementChanged(Message.NotificationClass.WAS_RCPT); @@ -241,10 +242,10 @@ namespace ENI2.DetailViewControls if (epd.ShowDialog() ?? false) { if (!_wasRcptMessage.Elements.Contains(epd.WAS_RCPT)) - _wasRcptMessage.Elements.Add(epd.WAS_RCPT); - this.dataGridWasteReceipt.Items.Refresh(); - this.SublistElementChanged(Message.NotificationClass.WAS_RCPT); + _wasRcptMessage.Elements.Add(epd.WAS_RCPT); } + this.dataGridWasteReceipt.Items.Refresh(); + this.SublistElementChanged(Message.NotificationClass.WAS_RCPT); } private void DataGridWasteReceipt_AddingNewItem(object sender, AddingNewItemEventArgs e) @@ -335,10 +336,10 @@ namespace ENI2.DetailViewControls { if (!_selectedWAS_RCPT.WasteReceived.Any(wr => wr.WasteCode == ewrd.WasteReceived.WasteCode)) { - _selectedWAS_RCPT.WasteReceived.Add(ewrd.WasteReceived); - this.dataGridWasteReceived.Items.Refresh(); - this.SublistElementChanged(Message.NotificationClass.WAS_RCPT); + _selectedWAS_RCPT.WasteReceived.Add(ewrd.WasteReceived); } + this.dataGridWasteReceived.Items.Refresh(); + this.SublistElementChanged(Message.NotificationClass.WAS_RCPT); } } diff --git a/ENI2/Report/ReportDocument.cs b/ENI2/Report/ReportDocument.cs index 12500578..4de02bcd 100644 --- a/ENI2/Report/ReportDocument.cs +++ b/ENI2/Report/ReportDocument.cs @@ -380,7 +380,8 @@ namespace ENI2.Report case Message.NotificationClass.TOWA: case Message.NotificationClass.TOWD: case Message.NotificationClass.HAZA when (message.Elements[0] is HAZ haz) && ((haz.IMDGPositions.Count > 0) || (haz.IBCPositions.Count > 0) || (haz.IGCPositions.Count > 0) || (haz.IMSBCPositions.Count > 0) || (haz.MARPOLPositions.Count > 0)): - { + case Message.NotificationClass.HAZD when (message.Elements[0] is HAZ hazd) && ((hazd.IMDGPositions.Count > 0) || (hazd.IBCPositions.Count > 0) || (hazd.IGCPositions.Count > 0) || (hazd.IMSBCPositions.Count > 0) || (hazd.MARPOLPositions.Count > 0)): + { // Landscape if not set if (_lastOrientation == Orientation.Portrait) { @@ -434,6 +435,9 @@ namespace ENI2.Report case Message.NotificationClass.HAZA when (message.Elements[0] is HAZ haz) && ((haz.IMDGPositions.Count > 0) || (haz.IBCPositions.Count > 0) || (haz.IGCPositions.Count > 0) || (haz.IMSBCPositions.Count > 0) || (haz.MARPOLPositions.Count > 0)): CreateHAZPage(document, haz); return; + case Message.NotificationClass.HAZD when (message.Elements[0] is HAZ haz) && ((haz.IMDGPositions.Count > 0) || (haz.IBCPositions.Count > 0) || (haz.IGCPositions.Count > 0) || (haz.IMSBCPositions.Count > 0) || (haz.MARPOLPositions.Count > 0)): + CreateHAZPage(document, haz); + return; case Message.NotificationClass.WAS: CreateWASTable(document, message); return; diff --git a/bsmd.database/Properties/AssemblyProductInfo.cs b/bsmd.database/Properties/AssemblyProductInfo.cs index 6c462a7b..510fabfd 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("7.0.1")] +[assembly: AssemblyInformationalVersion("7.0.2")] [assembly: AssemblyCopyright("Copyright © 2014-2022 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 b1f00991..98fdcad6 100644 --- a/bsmd.database/Properties/AssemblyProjectInfo.cs +++ b/bsmd.database/Properties/AssemblyProjectInfo.cs @@ -1,4 +1,4 @@ using System.Reflection; -[assembly: AssemblyVersion("7.0.1.*")] +[assembly: AssemblyVersion("7.0.2.*")] diff --git a/bsmd.hisnord/Request.cs b/bsmd.hisnord/Request.cs index 38973dc6..1708119a 100644 --- a/bsmd.hisnord/Request.cs +++ b/bsmd.hisnord/Request.cs @@ -1309,7 +1309,7 @@ namespace bsmd.hisnord for (int j = 0; j < was_rcpt.WasteReceived.Count; j++) { hn_was_rcpt.Items[i].WasteReceived[j] = new was_rcptWasteDeliveryReceiptWasteReceived(); - hn_was_rcpt.Items[i].WasteReceived[j].AmountWasteReceived_MTQ = (decimal) (was_rcpt.WasteReceived[j].AmountWasteReceived_MTQ ?? 0); + hn_was_rcpt.Items[i].WasteReceived[j].AmountWasteReceived_MTQ = decimal.Round((decimal) (was_rcpt.WasteReceived[j].AmountWasteReceived_MTQ ?? 0), 3); hn_was_rcpt.Items[i].WasteReceived[j].WasteType = new was_rcptWasteDeliveryReceiptWasteReceivedWasteType(); hn_was_rcpt.Items[i].WasteReceived[j].WasteType.WasteCode = was_rcpt.WasteReceived[j].WasteCode; if(!was_rcpt.WasteReceived[j].WasteDescription.IsNullOrEmpty())