STAT Flag wird beim Excel Import versucht zu importieren, auch wenn der Locode nix ist

This commit is contained in:
Daniel Schick 2022-06-14 18:15:50 +02:00
parent c2af7cbca1
commit 6721ecf9e2

View File

@ -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");