set default call purpose description if left empty during excel import (and valid key exists)

This commit is contained in:
Daniel Schick 2023-03-09 08:28:35 +01:00
parent 81fbd7482f
commit b9f8c8b667

View File

@ -1072,10 +1072,18 @@ namespace ENI2.Excel
noa_nod.CallPurposes.Add(callPurpose);
}
callPurpose.CallPurposeCode = ((int?)reader.ReadNumber(callPurposeCodeKey)) ?? 0;
if (callPurposeDescription.IsNullOrEmpty())
{
if(Util.GlobalStructures.Edifact8025.ContainsKey(callPurpose.CallPurposeCode))
callPurpose.CallPurposeDescription = Util.GlobalStructures.Edifact8025[callPurpose.CallPurposeCode];
}
else
{
callPurpose.CallPurposeDescription = callPurposeDescription;
}
}
}
}
string lastPort = reader.ReadText("NOA_NOD.LastPort")?.Trim().ToUpper();