From f9d96001dd7ea82689123e624cc99e8d660a1c42 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Mon, 11 Jun 2018 17:57:47 +0000 Subject: [PATCH] Version 5.0.9 mit vielen Korrekturpunkten --- ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs | 30 +++++- .../WasteDetailControl.xaml | 3 +- .../WasteDetailControl.xaml.cs | 99 ++++++++++++++++++ ENI-2/ENI2/ENI2/ENI2.csproj | 48 ++++----- ENI-2/ENI2/ENI2/MainWindow.xaml.cs | 2 +- .../ENI2/Properties/Resources.Designer.cs | 11 +- ENI-2/ENI2/ENI2/Properties/Resources.resx | 3 + ENI-2/ENI2/ENI2/packages.config | 6 +- ENI-2/data/WAS.xlsx | Bin 0 -> 12047 bytes ENI-2/data/testCrew.xlsx | Bin 0 -> 13662 bytes Stundensheet.xlsx | Bin 37647 -> 37771 bytes .../bsmd.ExcelReadService.csproj | 9 +- .../bsmd.ExcelReadService/packages.config | 2 +- nsw/Source/bsmd.database/LADG.cs | 13 +++ nsw/Source/bsmd.database/MessageCore.cs | 34 ++++-- nsw/Source/bsmd.database/NOA_NOD.cs | 9 +- .../bsmd.database/ValidationAttribute.cs | 1 + nsw/Source/bsmd.database/Waste.cs | 35 ++++++- nsw/Source/bsmd.hisnord/Response.cs | 2 +- nsw/Source/misc/db.sqlite | Bin 13099008 -> 13099008 bytes 20 files changed, 252 insertions(+), 55 deletions(-) create mode 100644 ENI-2/data/WAS.xlsx create mode 100644 ENI-2/data/testCrew.xlsx diff --git a/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs index 4fe915b1..29b5c588 100644 --- a/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs +++ b/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs @@ -232,6 +232,10 @@ namespace ENI2 existingCore = DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).GetMessageCoreByVisitId(newCore.VisitId); } + + bool skipCopyTransit = false; + bool skipCopyVisit = false; + if(existingCore != null) { if(MessageBox.Show(Properties.Resources.textDeclarationAlreadyExists, Properties.Resources.textCaptionExists, @@ -260,6 +264,25 @@ namespace ENI2 { ((ISublistContainer)existingMessage).DeleteElements(); } + + // Bearbeitungsinformationen für bestehende ID-Beantragung beibehalten, falls bereits vorhanden + + if(existingCore.IsTransit && + (existingMessage.MessageNotificationClass == Message.NotificationClass.TRANSIT) && + (existingMessage.InternalStatus == Message.BSMDStatus.SENT)) + { + skipCopyTransit = true; + continue; + } + + if(!existingCore.IsTransit && + (existingMessage.MessageNotificationClass == Message.NotificationClass.VISIT) && + (existingMessage.InternalStatus == Message.BSMDStatus.SENT)) + { + skipCopyVisit = true; + continue; + } + DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(existingMessage); } @@ -276,14 +299,15 @@ namespace ENI2 List newMessages = new List(); foreach (Message oldMessage in this._messages) { + if (skipCopyTransit && (oldMessage.MessageNotificationClass == Message.NotificationClass.TRANSIT)) continue; + if (skipCopyVisit && (oldMessage.MessageNotificationClass == Message.NotificationClass.VISIT)) continue; + Message newMessage = oldMessage.Clone() as Message; newMessage.MessageCore = newCore; newMessage.MessageCoreId = newCore.Id; DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(newMessage); newMessage.SaveElements(); - } - // - + } this.OnOpenNewCoreRequested(newCore); } diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/WasteDetailControl.xaml b/ENI-2/ENI2/ENI2/DetailViewControls/WasteDetailControl.xaml index fd2377d0..99bf5399 100644 --- a/ENI-2/ENI2/ENI2/DetailViewControls/WasteDetailControl.xaml +++ b/ENI-2/ENI2/ENI2/DetailViewControls/WasteDetailControl.xaml @@ -47,7 +47,8 @@ -