From f6caab44f8f5379f15d7edc1b8c6ca8f5ba549e2 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Mon, 4 Dec 2017 18:18:22 +0000 Subject: [PATCH] =?UTF-8?q?Version=203.9.0:=20Verdopplungsfehler,=20allerl?= =?UTF-8?q?ei=20andere=20kleine=20Bugs,=20l10p=20Import=20erg=C3=A4nzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ENI-2/ENI2/ENI2/App.xaml.cs | 6 +- ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs | 53 ++++++++++- .../OverViewDetailControl.xaml.cs | 8 +- .../SecurityDetailControl.xaml | 9 +- .../SecurityDetailControl.xaml.cs | 89 +++++++++++++++++- ENI-2/ENI2/ENI2/ENI2.csproj | 4 +- ENI-2/ENI2/ENI2/LocalizedLookup.cs | 2 +- .../ENI2/Properties/Resources.Designer.cs | 9 ++ ENI-2/ENI2/ENI2/Properties/Resources.resx | 3 + .../ENI2/ENI2/Util/DatabaseEntityWatchdog.cs | 4 +- ENI-2/ENI2/ENI2/Util/GlobalStructures.cs | 15 +++ ENI-2/data/SEC_Last_10_Ports_Import.xlsx | Bin 0 -> 11543 bytes Stundensheet.xlsx | Bin 35127 -> 35216 bytes .../SendNSWMessageService/NSWSendService.cs | 8 +- nsw/Source/bsmd.ExcelReadService/LocodeDB.cs | 16 +--- nsw/Source/bsmd.ExcelReadService/Util.cs | 26 +---- nsw/Source/bsmd.Tool.sln | 22 +++++ nsw/Source/bsmd.Tool/App.config | 20 +++- nsw/Source/bsmd.Tool/CleanupFiles.cs | 40 ++++++++ nsw/Source/bsmd.Tool/Options.cs | 9 ++ nsw/Source/bsmd.Tool/Program.cs | 6 +- nsw/Source/bsmd.Tool/bsmd.Tool.csproj | 5 +- nsw/Source/bsmd.Tool/bsmd.Tool.csproj.user | 2 +- nsw/Source/bsmd.Tool/packages.config | 2 +- nsw/Source/bsmd.database/AGNT.cs | 6 +- nsw/Source/bsmd.database/ATA.cs | 4 +- nsw/Source/bsmd.database/ATD.cs | 4 +- nsw/Source/bsmd.database/BKRA.cs | 6 +- nsw/Source/bsmd.database/BRKD.cs | 6 +- nsw/Source/bsmd.database/CREW.cs | 6 +- nsw/Source/bsmd.database/CallPurpose.cs | 6 +- nsw/Source/bsmd.database/DBManager.cs | 2 +- nsw/Source/bsmd.database/IBCPosition.cs | 6 +- nsw/Source/bsmd.database/IGCPosition.cs | 6 +- nsw/Source/bsmd.database/IMSBCPosition.cs | 6 +- nsw/Source/bsmd.database/INFO.cs | 6 +- nsw/Source/bsmd.database/LADG.cs | 6 +- .../LastTenPortFacilitiesCalled.cs | 6 +- .../bsmd.database/MARPOL_Annex_I_Position.cs | 6 +- nsw/Source/bsmd.database/MessageError.cs | 4 +- nsw/Source/bsmd.database/MessageViolation.cs | 4 +- nsw/Source/bsmd.database/NAME.cs | 4 +- nsw/Source/bsmd.database/PAS.cs | 6 +- nsw/Source/bsmd.database/POBA.cs | 6 +- nsw/Source/bsmd.database/POBD.cs | 6 +- nsw/Source/bsmd.database/PRE72H.cs | 6 +- .../PortOfCallLast30DaysCrewJoinedShip.cs | 6 +- nsw/Source/bsmd.database/PortOfItinerary.cs | 6 +- .../Properties/AssemblyProductInfo.cs | 2 +- .../Properties/AssemblyProjectInfo.cs | 2 +- nsw/Source/bsmd.database/ReportingParty.cs | 6 +- nsw/Source/bsmd.database/SERV.cs | 6 +- nsw/Source/bsmd.database/STAT.cs | 6 +- nsw/Source/bsmd.database/STO.cs | 6 +- ...vitiesDuringLastTenPortFacilitiesCalled.cs | 6 +- nsw/Source/bsmd.database/SubsidiaryRisks.cs | 6 +- nsw/Source/bsmd.database/SystemError.cs | 6 +- nsw/Source/bsmd.database/TIEFA.cs | 6 +- nsw/Source/bsmd.database/TIEFD.cs | 6 +- nsw/Source/bsmd.database/TOWA.cs | 6 +- nsw/Source/bsmd.database/TOWD.cs | 6 +- nsw/Source/bsmd.database/Util.cs | 51 +++++----- .../bsmd.database/ValidationCondition.cs | 6 +- nsw/Source/bsmd.database/ValidationRule.cs | 3 +- nsw/Source/bsmd.database/Waste.cs | 6 +- .../WasteDisposalServiceProvider.cs | 6 +- nsw/Source/bsmd.database/XtraSendLogic.cs | 2 +- nsw/Source/misc/db.sqlite | Bin 13099008 -> 13099008 bytes 68 files changed, 478 insertions(+), 154 deletions(-) create mode 100644 ENI-2/data/SEC_Last_10_Ports_Import.xlsx create mode 100644 nsw/Source/bsmd.Tool.sln create mode 100644 nsw/Source/bsmd.Tool/CleanupFiles.cs diff --git a/ENI-2/ENI2/ENI2/App.xaml.cs b/ENI-2/ENI2/ENI2/App.xaml.cs index 17208fc6..d47cc03c 100644 --- a/ENI-2/ENI2/ENI2/App.xaml.cs +++ b/ENI-2/ENI2/ENI2/App.xaml.cs @@ -80,13 +80,15 @@ namespace ENI2 // Preload validation fields List vFields = bsmd.database.ValidationRule.ValidationFields; - RuleEngine.RegisterLocodeChecker(bsmd.ExcelReadService.LocodeDB.IsValidLocode); + RuleEngine.RegisterLocodeChecker(Util.GlobalStructures.IsValidLocode); // Connect to locking service (if enabled) try { if (ENI2.Properties.Settings.Default.UseLocking) - App._lockingServiceClient = new ServiceClient("BasicHttpBinding_IService", ENI2.Properties.Settings.Default.LockingServerAddress); + { + App._lockingServiceClient = new ServiceClient("BasicHttpBinding_IService", ENI2.Properties.Settings.Default.LockingServerAddress); + } } catch (Exception ex) { diff --git a/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs index 442eee90..d31947a9 100644 --- a/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs +++ b/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs @@ -369,7 +369,8 @@ namespace ENI2 private void DetailControl_RequestSendValidation() { - this.Validate(false); + this.Validate(false); + foreach(Message aMessage in this._messages) { if(aMessage.InternalStatus == Message.BSMDStatus.TOSEND) @@ -387,6 +388,56 @@ namespace ENI2 } } } + + // NOA_NOD vor ATA vor ATD Versendereihenfolge sicherstellen + bool noa_nod_queued_or_sent = false; + bool ata_queued_or_sent = false; + foreach(Message aMessage in this._messages) + { + if(aMessage.MessageNotificationClass == Message.NotificationClass.NOA_NOD) + { + if ((aMessage.SendSuccess ?? false) || (aMessage.InternalStatus == Message.BSMDStatus.TOSEND)) + noa_nod_queued_or_sent = true; + } + if (aMessage.MessageNotificationClass == Message.NotificationClass.ATA) + { + if ((aMessage.SendSuccess ?? false) || (aMessage.InternalStatus == Message.BSMDStatus.TOSEND)) + ata_queued_or_sent = true; + } + } + + foreach(Message aMessage in this._messages) + { + if((aMessage.MessageNotificationClass == Message.NotificationClass.ATA) && (aMessage.InternalStatus == Message.BSMDStatus.TOSEND)) + { + if(!noa_nod_queued_or_sent) + { + aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED; + aMessage.ChangedBy = ""; + aMessage.StatusInfo = string.Format("Validation error: NOA_NOD must be sent before ATA"); + DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage); + } + } + + if ((aMessage.MessageNotificationClass == Message.NotificationClass.ATD) && (aMessage.InternalStatus == Message.BSMDStatus.TOSEND)) + { + if (!noa_nod_queued_or_sent) + { + aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED; + aMessage.ChangedBy = ""; + aMessage.StatusInfo = string.Format("Validation error: NOA_NOD must be sent before ATD"); + DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage); + } + + if(!ata_queued_or_sent) + { + aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED; + aMessage.ChangedBy = ""; + aMessage.StatusInfo = string.Format("Validation error: ATA must be sent before ATD"); + DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage); + } + } + } } private void DetailControl_RequestValidate() diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs index f908c96b..8d84a26d 100644 --- a/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs +++ b/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs @@ -84,7 +84,7 @@ namespace ENI2.DetailViewControls vtBinding.Source = this.Core; vtBinding.Path = this.Core.IsTransit ? new PropertyPath("TransitId") : new PropertyPath("VisitId"); vtBinding.Mode = BindingMode.TwoWay; - vtBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged; + vtBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged; BindingOperations.SetBinding(textBoxDisplayId, TextBox.TextProperty, vtBinding); if (this.Core.Cancelled ?? false) this.ShowCancelledLabel(); @@ -379,9 +379,13 @@ namespace ENI2.DetailViewControls { this.textBoxDisplayId.DataContext = null; this.textBoxDisplayId.DataContext = this.Core; + this.textBoxDisplayId.GetBindingExpression(TextBox.TextProperty)?.UpdateTarget(); + this.labelBSMDStatusInternal.DataContext = null; this.labelBSMDStatusInternal.DataContext = this.Core; - MessageBox.Show("Visit/Transit ID updated!"); + this.labelBSMDStatusInternal.GetBindingExpression(Label.ContentProperty)?.UpdateTarget(); + + MessageBox.Show(string.Format("Visit/Transit ID updated: {0}", this.Core.DisplayId)); } #endregion diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/SecurityDetailControl.xaml b/ENI-2/ENI2/ENI2/DetailViewControls/SecurityDetailControl.xaml index 3d1481eb..aea79bb5 100644 --- a/ENI-2/ENI2/ENI2/DetailViewControls/SecurityDetailControl.xaml +++ b/ENI-2/ENI2/ENI2/DetailViewControls/SecurityDetailControl.xaml @@ -92,7 +92,13 @@ - + + + + +