From 958f236ac054a4d7a7e69fab7304e19230ec7b6f Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Thu, 10 Mar 2022 08:40:13 +0100 Subject: [PATCH] Fehlerkorrekturen ENI 7.0, Zwischenversion 7.0.0.7 --- ENI2/DetailRootControl.xaml.cs | 12 ++++++------ .../OverViewDetailControl.xaml.cs | 4 ++-- ENI2/ENI2.csproj | 4 ++-- ENI2/EditControls/ErrorListDialog.xaml | 2 +- ENI2/EditControls/ShowIdDialog.xaml | 2 +- ENI2/EditControls/ViolationListDialog.xaml | 2 +- ENI2/Excel/ExcelUtil.cs | 4 ++-- ENI2/Excel/ExcelWriter.cs | 9 +++++++-- SendNSWMessageService/NSWSendService.cs | 9 ++++++--- bsmd.database/Message.cs | 2 ++ bsmd.database/TreatmentFacilityProvider.cs | 2 +- bsmd.database/WAS.cs | 15 +++------------ bsmd.database/WAS_RCPT.cs | 8 ++++++++ bsmd.database/Waste.cs | 3 +-- bsmd.database/WasteReceived.cs | 2 +- bsmd.hisnord/Request.cs | 19 +------------------ 16 files changed, 45 insertions(+), 54 deletions(-) diff --git a/ENI2/DetailRootControl.xaml.cs b/ENI2/DetailRootControl.xaml.cs index 941892ec..11d4237f 100644 --- a/ENI2/DetailRootControl.xaml.cs +++ b/ENI2/DetailRootControl.xaml.cs @@ -210,7 +210,7 @@ namespace ENI2 } }; - detailControl.RequestReload += DetailControl_RequestReload; + detailControl.RequestReload += DetailControl_RequestReload; detailControl.NotificationClassChanged += DetailControl_NotificationClassChanged; detailControl.ResetControlCache += DetailControl_ResetControlCache; detailControl.RequestValidate += DetailControl_RequestValidate; @@ -1042,28 +1042,28 @@ namespace ENI2 { if(this._errorListDialog == null) { - this._errorListDialog = new ErrorListDialog(); + this._errorListDialog = new ErrorListDialog(); this._errorListDialog.Closed += (o, e) => this._errorListDialog = null; this._errorListDialog.Loaded += (o, e) => this._errorListDialog.RefreshVisible = true; this._errorListDialog.ErrorSelected += _errorListDialog_ErrorSelected; this._errorListDialog.RefreshClicked += _errorListDialog_RefreshClicked; this._errorListDialog.Show(); - } - this._errorListDialog.Errors = vErrors; + } + this._errorListDialog.Errors = vErrors; } if (vViolations.Count > 0) { if(this._violationListDialog == null) { - this._violationListDialog = new ViolationListDialog(); + this._violationListDialog = new ViolationListDialog(); this._violationListDialog.Closed += (o, e) => this._violationListDialog = null; this._violationListDialog.Loaded += (o, e) => this._violationListDialog.RefreshVisible = true; this._violationListDialog.ViolationSelected += _errorListDialog_ErrorSelected; this._violationListDialog.RefreshClicked += _errorListDialog_RefreshClicked; this._violationListDialog.Show(); } - _violationListDialog.Violations = vViolations; + _violationListDialog.Violations = vViolations; } if((vErrors.Count == 0) && (vViolations.Count == 0)) diff --git a/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs b/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs index a69af06e..af2e4b3e 100644 --- a/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs +++ b/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs @@ -707,7 +707,7 @@ namespace ENI2.DetailViewControls private void buttonValidate_Click(object sender, RoutedEventArgs e) { - this.OnRequestValidate(); + this.OnRequestValidate(); } /// @@ -743,7 +743,7 @@ namespace ENI2.DetailViewControls else { MessageBox.Show(importResultText, "Import failed", MessageBoxButton.OK, MessageBoxImage.Error); - } + } } } } diff --git a/ENI2/ENI2.csproj b/ENI2/ENI2.csproj index cd9abfff..f771cfc1 100644 --- a/ENI2/ENI2.csproj +++ b/ENI2/ENI2.csproj @@ -36,8 +36,8 @@ 5.4.0.0 true publish.html - 6 - 7.0.0.6 + 7 + 7.0.0.7 false true true diff --git a/ENI2/EditControls/ErrorListDialog.xaml b/ENI2/EditControls/ErrorListDialog.xaml index 6fd955a9..587cfdf7 100644 --- a/ENI2/EditControls/ErrorListDialog.xaml +++ b/ENI2/EditControls/ErrorListDialog.xaml @@ -8,7 +8,7 @@ xmlns:p="clr-namespace:ENI2.Properties" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" mc:Ignorable="d" - Title="{x:Static p:Resources.textErrors}" Height="300" Width="600" Background="AliceBlue" Icon="/ENI2;component/Resources/bullet_ball_red.ico"> + Title="{x:Static p:Resources.textErrors}" Height="300" Width="600" Background="AliceBlue" Icon="/ENI2;component/Resources/bullet_ball_red.ico" Topmost="True"> diff --git a/ENI2/EditControls/ShowIdDialog.xaml b/ENI2/EditControls/ShowIdDialog.xaml index 6da2d010..861baefe 100644 --- a/ENI2/EditControls/ShowIdDialog.xaml +++ b/ENI2/EditControls/ShowIdDialog.xaml @@ -6,7 +6,7 @@ xmlns:local="clr-namespace:ENI2.EditControls" xmlns:p="clr-namespace:ENI2.Properties" mc:Ignorable="d" - Title="{x:Static p:Resources.textVisitTransitId}" Height="236" Width="300" WindowStyle="SingleBorderWindow" WindowStartupLocation="CenterOwner" Loaded="Window_Loaded"> + Title="{x:Static p:Resources.textVisitTransitId}" Height="236" Width="300" WindowStyle="SingleBorderWindow" WindowStartupLocation="CenterOwner" Loaded="Window_Loaded" Topmost="True"> diff --git a/ENI2/EditControls/ViolationListDialog.xaml b/ENI2/EditControls/ViolationListDialog.xaml index 9d276423..ba797b83 100644 --- a/ENI2/EditControls/ViolationListDialog.xaml +++ b/ENI2/EditControls/ViolationListDialog.xaml @@ -8,7 +8,7 @@ xmlns:p="clr-namespace:ENI2.Properties" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" mc:Ignorable="d" - Title="{x:Static p:Resources.textViolations}" Height="300" Width="600" Background="AliceBlue" Icon="/ENI2;component/Resources/bullet_ball_yellow.ico"> + Title="{x:Static p:Resources.textViolations}" Height="300" Width="600" Background="AliceBlue" Icon="/ENI2;component/Resources/bullet_ball_yellow.ico" Topmost="True"> diff --git a/ENI2/Excel/ExcelUtil.cs b/ENI2/Excel/ExcelUtil.cs index a47cb295..db44af40 100644 --- a/ENI2/Excel/ExcelUtil.cs +++ b/ENI2/Excel/ExcelUtil.cs @@ -470,8 +470,8 @@ namespace ENI2.Excel ibcPosition.Flashpoint_CEL = reader.ReadText(ibc_flash); if (!ibcPosition.Flashpoint_CEL.IsNullOrEmpty()) { - if (ibcPosition.Flashpoint_CEL != "-") - { + if (ibcPosition.Flashpoint_CEL != "-") + { if (double.TryParse(ibcPosition.Flashpoint_CEL, out double flashval)) { if (flashval > 60) ibcPosition.FlashpointInformation = 1; // GT60CEL diff --git a/ENI2/Excel/ExcelWriter.cs b/ENI2/Excel/ExcelWriter.cs index 0c674dd2..385fb4cb 100644 --- a/ENI2/Excel/ExcelWriter.cs +++ b/ENI2/Excel/ExcelWriter.cs @@ -505,7 +505,7 @@ namespace ENI2.Excel { string ibc_productName = string.Format("{1}.IBC.ProductName_{0}", i + 1, className); string ibc_pollutionCategory = string.Format("{1}.IBC.PollutionCategory_{0}", i + 1, className); - string ibc_flash = string.Format("{1}.IBC.Flashpoint_CEL_{0}", i + 1, className); + string ibc_flash = string.Format("{1}.IBC.FlashpointInformation_{0}", i + 1, className); string ibc_quantity = string.Format("{1}.IBC.Quantity_KGM_{0}", i + 1, className); string ibc_stowagePosition = string.Format("{1}.IBC.StowagePosition_{0}", i + 1, className); string ibc_portOfLoading = string.Format("{1}.IBC.PortOfLoading_{0}", i + 1, className); @@ -525,7 +525,12 @@ namespace ENI2.Excel case 3: WriteText(ibc_pollutionCategory, "OS"); break; } } - WriteText(ibc_flash, ibcPosition.Flashpoint_CEL); + + if (ibcPosition.FlashpointInformation == 0) // == "NF" + WriteText(ibc_flash, "-"); + else + WriteText(ibc_flash, ibcPosition.Flashpoint_CEL); + if (ibcPosition.Quantity_KGM.HasValue) WriteNumber(ibc_quantity, ibcPosition.Quantity_KGM.Value); WriteText(ibc_stowagePosition, ibcPosition.StowagePosition); diff --git a/SendNSWMessageService/NSWSendService.cs b/SendNSWMessageService/NSWSendService.cs index 37e73de5..8b9fa295 100644 --- a/SendNSWMessageService/NSWSendService.cs +++ b/SendNSWMessageService/NSWSendService.cs @@ -131,10 +131,13 @@ namespace SendNSWMessageService if (message.InternalStatus != Message.BSMDStatus.TOSEND) continue; // "Virtuelle" Meldeklassen (bisher: DK) werden hier nicht versendet! - if ((message.MessageNotificationClass == Message.NotificationClass.STO) || - (message.MessageNotificationClass == Message.NotificationClass.CREWD) || - (message.MessageNotificationClass == Message.NotificationClass.PASD)) + if (message.MessageNotificationClass == Message.NotificationClass.STO) continue; + + /* muss zum Go Live wieder einkommentiert werden, da CREWD und PASD vorerst nicht versendet werden + if((message.MessageNotificationClass == Message.NotificationClass.CREWD) || + (message.MessageNotificationClass == Message.NotificationClass.PASD)) continue; + */ if ((message.MessageNotificationClass == Message.NotificationClass.VISIT) || (message.MessageNotificationClass == Message.NotificationClass.TRANSIT)) diff --git a/bsmd.database/Message.cs b/bsmd.database/Message.cs index cd291bee..2aa9c3a0 100644 --- a/bsmd.database/Message.cs +++ b/bsmd.database/Message.cs @@ -628,6 +628,8 @@ namespace bsmd.database case NotificationClass.SERV: case NotificationClass.WAS: case NotificationClass.TOWD: + case NotificationClass.HAZD: + case NotificationClass.WAS_RCPT: if (isTransit) result = false; break; case NotificationClass.VISIT: diff --git a/bsmd.database/TreatmentFacilityProvider.cs b/bsmd.database/TreatmentFacilityProvider.cs index 6ac9661d..40d3eca6 100644 --- a/bsmd.database/TreatmentFacilityProvider.cs +++ b/bsmd.database/TreatmentFacilityProvider.cs @@ -26,7 +26,7 @@ namespace bsmd.database [MaxLength(70)] [ENI2Validation] [Validation(ValidationCode.STRING_MAXLEN, 70)] - public string TreatmentFacilityProviderName { get; set; } + public string TreatmentFacilityProviderName { get; set; } public string Identifier { get; set; } diff --git a/bsmd.database/WAS.cs b/bsmd.database/WAS.cs index 52334762..f51ab183 100644 --- a/bsmd.database/WAS.cs +++ b/bsmd.database/WAS.cs @@ -130,8 +130,7 @@ namespace bsmd.database public DateTime? LastWasteDisposalDate { get; set; } [Obsolete] - [ShowReport] - [Validation2(ValidationCode.NOT_NULL)] + [ShowReport] [ENI2Validation] public byte? WasteDisposalDelivery { get; set; } @@ -463,26 +462,18 @@ namespace bsmd.database errors.Add(RuleEngine.CreateError(ValidationCode.POSITION_COUNT, string.Format("Waste {0}", missingType), null, this.Title, null, this.Tablename)); } - // Extravalidierung für "0" Meldung (5.3.21) - double totalSludgeRetained = 0; + // Extravalidierung für "0" Meldung (5.3.21) double totalWC = 0; double totalWAR = 0; double totalWAGTNP = 0; double totalWDA = 0; foreach(Waste w in this.Waste) - { - if (w.WasteType == 1100) totalSludgeRetained += w.WasteAmountRetained_MTQ ?? 0; - if (w.WasteType == 1300) totalSludgeRetained += w.WasteAmountRetained_MTQ ?? 0; - + { totalWC += w.WasteCapacity_MTQ ?? 0; totalWAR += w.WasteAmountRetained_MTQ ?? 0; totalWAGTNP += w.WasteAmountGeneratedTillNextPort_MTQ ?? 0; totalWDA += w.WasteDisposalAmount_MTQ ?? 0; - } - if(totalSludgeRetained == 0) - { - violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Waste amount retained on board for types 1100 'sludge' and 1300 'oil-others' = 0", null, this.Title, null, this.Tablename)); } if(totalWC == 0) { diff --git a/bsmd.database/WAS_RCPT.cs b/bsmd.database/WAS_RCPT.cs index 5d93f167..78eb38e7 100644 --- a/bsmd.database/WAS_RCPT.cs +++ b/bsmd.database/WAS_RCPT.cs @@ -25,12 +25,15 @@ namespace bsmd.database #region Properties [MaxLength(20)] + [ENI2Validation] public string IdentificationNumber { get; set; } [MaxLength(70)] + [ENI2Validation] public string PortReceptionFacilityName { get; set; } [MaxLength(70)] + [ENI2Validation] public string PortReceptionFacilityProviderName { get; set; } public ObservableCollection WasteReceived { get; private set; } = new ObservableCollection(); @@ -331,6 +334,11 @@ namespace bsmd.database public override void Validate(List errors, List violations) { + foreach(TreatmentFacilityProvider tfp in this.TreatmentFacilityProvider) + { + RuleEngine.ValidateProperties(tfp, errors, violations); + } + foreach (WasteReceived wasteReceived in this.WasteReceived) { RuleEngine.ValidateProperties(wasteReceived, errors, violations); diff --git a/bsmd.database/Waste.cs b/bsmd.database/Waste.cs index 8101855d..6452842e 100644 --- a/bsmd.database/Waste.cs +++ b/bsmd.database/Waste.cs @@ -117,8 +117,7 @@ namespace bsmd.database public double? WasteAmountGeneratedTillNextPort_MTQ { get; set; } [Obsolete] - [ENI2Validation] - [Validation(ValidationCode.NOT_NULL)] + [ENI2Validation] public double? WasteDisposedAtLastPort_MTQ { get; set; } public string Identifier { get; set; } diff --git a/bsmd.database/WasteReceived.cs b/bsmd.database/WasteReceived.cs index 06787e12..20d1311d 100644 --- a/bsmd.database/WasteReceived.cs +++ b/bsmd.database/WasteReceived.cs @@ -137,7 +137,7 @@ namespace bsmd.database public override void Validate(List errors, List violations) { if (this.AmountWasteReceived_MTQ > 10000) - violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Waste disposal amount", null, this.Title, this.Identifier, this.Tablename)); + violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Waste disposal amount too big", null, this.Title, this.Identifier, this.Tablename)); } #endregion diff --git a/bsmd.hisnord/Request.cs b/bsmd.hisnord/Request.cs index cfea5b35..dc34df20 100644 --- a/bsmd.hisnord/Request.cs +++ b/bsmd.hisnord/Request.cs @@ -1585,24 +1585,7 @@ namespace bsmd.hisnord items1.Add(hn_crewtype); } } - } - - if (message.MessageNotificationClass == Message.NotificationClass.CREW) - { - if (message.Reset) - { - items1ChoiceType.Add(Items1ChoiceType.RESET_CREWA); - items1.Add(ytype.Y); - } - else - { - if (message.Elements.Count > 0) - { - - - } - } - } + } #endregion