From 6721ecf9e29f129cab7b2659955529ea10e79a7c Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Tue, 14 Jun 2022 18:15:50 +0200 Subject: [PATCH] STAT Flag wird beim Excel Import versucht zu importieren, auch wenn der Locode nix ist --- ENI2/Excel/ExcelUtil.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ENI2/Excel/ExcelUtil.cs b/ENI2/Excel/ExcelUtil.cs index d1d3fbf4..62d4d3dd 100644 --- a/ENI2/Excel/ExcelUtil.cs +++ b/ENI2/Excel/ExcelUtil.cs @@ -980,7 +980,15 @@ namespace ENI2.Excel stat.PortOfRegistry = reader.ReadLoCode("STAT.PortOfRegistry", false); if (stat.PortOfRegistry.Length == 5) + { stat.Flag = stat.PortOfRegistry.Substring(0, 2); + } + else + { + string statFlagString = reader.ReadText("STAT.PortOfRegistry")?.ToUpper(); + if (statFlagString.Length >= 2) + stat.Flag = statFlagString.Substring(0, 2); + } stat.MMSINumber = reader.ReadTextNoWhitespace("STAT.MMSINumber"); stat.CallSign = reader.ReadTextNoWhitespace("STAT.CallSign"); stat.ISMCompanyId = reader.ReadTextNoWhitespace("STAT.ISMCompanyId");