From 1da414a782d2c6cce6db73d65337cc7bb42ffb7e Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Sun, 9 Jul 2023 15:05:41 +0200 Subject: [PATCH] =?UTF-8?q?MV=20/=20SH=20Hafenliste=20der=20SQlite=20DB=20?= =?UTF-8?q?hinzugef=C3=BCgt=20Dadurch=20ist=20es=20m=C3=B6glich,=20f=C3=BC?= =?UTF-8?q?r=20die=20betreffenden=20H=C3=A4fen=20eine=20zus=C3=A4tzliche?= =?UTF-8?q?=20Validierung=20zu=20machen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ENI2/App.xaml.cs | 1 + ENI2/LocalizedLookup.cs | 16 ++++++++++++++++ .../bsmd.LockingService.csproj.user | 2 +- bsmd.database/LADG.cs | 15 +++++++++++++-- misc/db.sqlite | Bin 14426112 -> 14426112 bytes 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/ENI2/App.xaml.cs b/ENI2/App.xaml.cs index b2ca4b37..d2304b61 100644 --- a/ENI2/App.xaml.cs +++ b/ENI2/App.xaml.cs @@ -72,6 +72,7 @@ namespace ENI2 Dictionary cargoHandlingDict = LocalizedLookup.getLADGCargoHandlingStrings(langKey); foreach (int key in cargoHandlingDict.Keys) LADG.CargoHandlingDict.Add(key, cargoHandlingDict[key]); + LADG.MVSHLocodes.AddRange(LocalizedLookup.getMVSHLocodes()); EventManager.RegisterClassHandler(typeof(DatePicker), DatePicker.PreviewKeyDownEvent, new KeyEventHandler(this.DatePicker_PreviewKeyDown)); CREW.NationalityDict = LocalizedLookup.getNationalities(); diff --git a/ENI2/LocalizedLookup.cs b/ENI2/LocalizedLookup.cs index cf521efc..4956f671 100644 --- a/ENI2/LocalizedLookup.cs +++ b/ENI2/LocalizedLookup.cs @@ -288,5 +288,21 @@ namespace ENI2 reader.Close(); return result; } + + public static List getMVSHLocodes() + { + List result = new List(); + + string query = string.Format("SELECT locode from MVSH_ports"); + SQLiteCommand cmd = new SQLiteCommand(query, _con); + IDataReader reader = cmd.ExecuteReader(); + while (reader.Read()) + { + if (reader.IsDBNull(0)) continue; + result.Add(reader.GetString(0)); + } + reader.Close(); + return result; + } } } diff --git a/bsmd.LockingService/bsmd.LockingService.csproj.user b/bsmd.LockingService/bsmd.LockingService.csproj.user index 3517ad61..afa33dd1 100644 --- a/bsmd.LockingService/bsmd.LockingService.csproj.user +++ b/bsmd.LockingService/bsmd.LockingService.csproj.user @@ -2,7 +2,7 @@ true - Release|Any CPU + Debug|Any CPU diff --git a/bsmd.database/LADG.cs b/bsmd.database/LADG.cs index e7f380e7..6753fb63 100644 --- a/bsmd.database/LADG.cs +++ b/bsmd.database/LADG.cs @@ -41,7 +41,7 @@ namespace bsmd.database { 65, "Wechselbrücken / -behälter" }, { 66, "Eisenbahngüterwagen" }, { 67, "Reisezugwagen und Triebwagen" } - }); + }); #endregion @@ -119,6 +119,8 @@ namespace bsmd.database public static Dictionary CargoHandlingDict { get; } = new Dictionary(); + public static List MVSHLocodes { get; } = new List(); + #endregion #region DatabaseEntity implementation @@ -212,7 +214,7 @@ namespace bsmd.database #endregion - #region Validation + #region Validation public override void Validate(List errors, List violations) { @@ -234,6 +236,15 @@ namespace bsmd.database errors.Add(RuleEngine.CreateError(ValidationCode.LOCODE, "PortOfLoading", this.PortOfLoading, this.Title, this.Identifier, this.Tablename)); } + if(LADG.MVSHLocodes.Contains(this.MessageCore.PoC)) + { + if (this.CargoCodeNST_3.IsNullOrEmpty()) + violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "CargoCodeNST_3 empty", this.CargoCodeNST_3, this.Title, this.Identifier, this.Tablename)); + + if(!this.CargoLACode.HasValue) + violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "CargoLACode empty", "not set", this.Title, this.Identifier, this.Tablename)); + } + } #endregion diff --git a/misc/db.sqlite b/misc/db.sqlite index 15570602a0e96724922429c1b456f93dc9928a33..4bfc9c1a915f3635aae44952766a8e9848e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