Adjust document expiry date to 31.12.2100 for all PAS/CREW if date cannot be read

This commit is contained in:
Daniel Schick 2024-07-29 07:00:39 +02:00
parent 3743b55ef6
commit a4c340c2ec

View File

@ -2147,7 +2147,7 @@ namespace ENI2.Excel
if (canceled) return true;
if (crew.CrewMemberIdentityDocumentIssuingState.IsNullOrEmpty() && isOldVersion)
crew.CrewMemberIdentityDocumentIssuingState = "XX";
crew.CrewMemberIdentityDocumentExpiryDate = reader.ReadCellAsDateTime(sheetTitle, string.Format("N{0}", i + 18));
crew.CrewMemberIdentityDocumentExpiryDate = reader.ReadCellAsDateTime(sheetTitle, string.Format("N{0}", i + 18)) ?? (DateTime?)new DateTime(2100, 12, 31);
if (!crew.CrewMemberIdentityDocumentExpiryDate.HasValue && isOldVersion)
crew.CrewMemberIdentityDocumentExpiryDate = new DateTime(2100, 12, 31);
@ -2263,7 +2263,7 @@ namespace ENI2.Excel
if (canceled) return true;
if (crewd.CrewMemberIdentityDocumentIssuingState.IsNullOrEmpty())
crewd.CrewMemberIdentityDocumentIssuingState = "XX";
crewd.CrewMemberIdentityDocumentExpiryDate = reader.ReadCellAsDateTime(sheetTitle, string.Format("N{0}", i + 18));
crewd.CrewMemberIdentityDocumentExpiryDate = reader.ReadCellAsDateTime(sheetTitle, string.Format("N{0}", i + 18)) ?? (DateTime?)new DateTime(2100, 12, 31);
crewd.Effects = reader.ReadCellAsText("2. PORT", string.Format("C{0}", i + 142), 256);
@ -2523,7 +2523,7 @@ namespace ENI2.Excel
if (canceled) return true;
pas.PassengerIdentityDocumentId = reader.ReadCellAsText(sheetTitle, string.Format("N{0}", i + 18), 100);
pas.PassengerIdentityDocumentExpiryDate = reader.ReadCellAsDateTime(sheetTitle, string.Format("P{0}", i + 18));
pas.PassengerIdentityDocumentExpiryDate = reader.ReadCellAsDateTime(sheetTitle, string.Format("P{0}", i + 18)) ?? (DateTime?)new DateTime(2100, 12, 31); ;
pas.PassengerVisaNumber = reader.ReadCellAsText(sheetTitle, string.Format("Q{0}", i + 18), 100);
pas.EmergencyCare = reader.ReadCellAsText(sheetTitle, string.Format("R{0}", i + 18), 255);