Korrekturen für die letzten Kommentare

This commit is contained in:
Daniel Schick 2022-10-24 13:16:03 +02:00
parent 47ea445716
commit 0d052723b9
3 changed files with 22 additions and 11 deletions

View File

@ -36,7 +36,7 @@
<MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage>
<ApplicationRevision>11</ApplicationRevision>
<ApplicationRevision>12</ApplicationRevision>
<ApplicationVersion>7.5.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>

View File

@ -2072,7 +2072,8 @@ namespace ENI2.Excel
{
string lastName = reader.ReadCellAsText(sheetTitle, string.Format("C{0}", i + 18));
if (lastName.IsNullOrEmpty()) break;
string firstName = reader.ReadCellAsText(sheetTitle, string.Format("D{0}", i + 18));
if (lastName.IsNullOrEmpty() && firstName.IsNullOrEmpty()) break;
if (!(crewMessage.GetSublistElementWithIdentifier((i + 1).ToString()) is CREW crew))
{
@ -2085,7 +2086,7 @@ namespace ENI2.Excel
crew.NotificationSchengen = notificationSchengen;
crew.NotificationPAX = notificationPax;
crew.CrewMemberLastName = lastName;
crew.CrewMemberFirstName = reader.ReadCellAsText(sheetTitle, string.Format("D{0}", i + 18));
crew.CrewMemberFirstName = firstName;
crew.CrewMemberGender = ReadGender(reader.ReadCellAsText(sheetTitle, string.Format("E{0}", i + 18)), out bool canceled);
if (canceled) return true;
@ -2193,10 +2194,10 @@ namespace ENI2.Excel
{
string lastName = reader.ReadCellAsText(sheetTitle, string.Format("C{0}", i + 17));
if (lastName.IsNullOrEmpty()) break; // finish after reading last row
string firstName = reader.ReadCellAsText(sheetTitle, string.Format("D{0}", i + 17));
if (lastName.IsNullOrEmpty() && firstName.IsNullOrEmpty()) break; // finish after reading last row
DateTime? dateOfBirth = reader.ReadCellAsDateTime(sheetTitle, string.Format("L{0}", i + 17));
PAS pas = new PAS();
pas.Identifier = (i + 1).ToString();
pas.MessageHeader = pasMessage;
@ -2482,7 +2483,7 @@ namespace ENI2.Excel
}
}
}
else
if(!result.HasValue)
{
result = 0; // not known
}
@ -2518,8 +2519,8 @@ namespace ENI2.Excel
{
if (!fid.SelectedValue.IsNullOrEmpty())
{
_genderImportDict[documentType] = fid.SelectedValue;
result = byte.Parse(_genderImportDict[documentType]);
_documentTypeImportDict[documentType] = fid.SelectedValue;
result = byte.Parse(_documentTypeImportDict[documentType]);
}
}
else
@ -2542,9 +2543,9 @@ namespace ENI2.Excel
{
result = "XX";
}
else if(CREW.NationalityDict.ContainsKey(nationality))
else if(CREW.NationalityDict.ContainsKey(nationality.ToUpper()))
{
result = nationality;
result = nationality.ToUpper();
}
else if(CREW.NationalityDict.ContainsKey(nationality.ToUpper()))
{

View File

@ -356,7 +356,17 @@ namespace bsmd.database
row[14] = crew.CrewMemberIdentityDocumentExpiryDate ?? (object)DBNull.Value;
row[15] = crew.NotificationSchengen ?? (object)DBNull.Value;
row[16] = crew.NotificationPAX ?? (object)DBNull.Value;
row[17] = crew.CrewMemberCountryOfBirth?.Substring(0,2) ?? (object)DBNull.Value;
if (crew.CrewMemberCountryOfBirth == null)
{
row[17] = DBNull.Value;
}
else
{
if (crew.CrewMemberCountryOfBirth.Length > 2)
row[17] = crew.CrewMemberCountryOfBirth.Substring(0, 2);
else
row[17] = crew.CrewMemberCountryOfBirth;
}
row[18] = crew.Effects ?? (object)DBNull.Value;
result.Rows.Add(row);
}