diff --git a/ENI2/Excel/ExcelUtil.cs b/ENI2/Excel/ExcelUtil.cs index 6c962c0f..c270ec97 100644 --- a/ENI2/Excel/ExcelUtil.cs +++ b/ENI2/Excel/ExcelUtil.cs @@ -2227,7 +2227,8 @@ namespace ENI2.Excel for (int i = 0; i < 5000; i++) { string lastName = reader.ReadCellAsText(sheetTitle, string.Format("C{0}", i + 18), 100); - if (lastName.IsNullOrEmpty()) break; + string firstName = reader.ReadCellAsText(sheetTitle, string.Format("D{0}", i + 18), 100); + if (lastName.IsNullOrEmpty() && firstName.IsNullOrEmpty()) break; if (!(crewdMessage.GetSublistElementWithIdentifier((i + 1).ToString()) is CREWD crewd)) { @@ -2241,7 +2242,7 @@ namespace ENI2.Excel crewd.NotificationSchengen = true; crewd.NotificationPAX = notificationPax ?? false; crewd.CrewMemberLastName = lastName; - crewd.CrewMemberFirstName = reader.ReadCellAsText(sheetTitle, string.Format("D{0}", i + 18), 100); + crewd.CrewMemberFirstName = firstName; crewd.CrewMemberGender = ReadGender(reader.ReadCellAsText(sheetTitle, string.Format("E{0}", i + 18)), out bool canceled); if (canceled) return true; @@ -2262,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)) ?? (DateTime?)new DateTime(2100, 12, 31); + crewd.CrewMemberIdentityDocumentExpiryDate = reader.ReadCellAsDateTime(sheetTitle, string.Format("N{0}", i + 18)); crewd.Effects = reader.ReadCellAsText("2. PORT", string.Format("C{0}", i + 142), 256); @@ -2522,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)) ?? (DateTime?)new DateTime(2100, 12, 31); + pas.PassengerIdentityDocumentExpiryDate = reader.ReadCellAsDateTime(sheetTitle, string.Format("P{0}", i + 18)); pas.PassengerVisaNumber = reader.ReadCellAsText(sheetTitle, string.Format("Q{0}", i + 18), 100); pas.EmergencyCare = reader.ReadCellAsText(sheetTitle, string.Format("R{0}", i + 18), 255);