Set function on board to unknown if left null or empty for CREW
This commit is contained in:
parent
6ee9293fc8
commit
c15fdb8ee2
@ -1162,7 +1162,7 @@ namespace ENI2.DetailViewControls
|
||||
if (crew.CrewMemberLastName.Equals("Family Name") || (crew.CrewMemberLastName.Trim().Length == 0)) continue;
|
||||
if (!reader.IsDBNull(1)) crew.CrewMemberFirstName = reader.GetString(1);
|
||||
if (!reader.IsDBNull(2)) crew.CrewMemberGender = GlobalStructures.ParseGender(reader.GetString(2));
|
||||
if (!reader.IsDBNull(3)) crew.CrewMemberDuty = reader.GetString(3);
|
||||
if (!reader.IsDBNull(3)) crew.CrewMemberDuty = reader.GetString(3).Clean();
|
||||
if (!reader.IsDBNull(4)) crew.CrewMemberNationality = reader.GetString(4).Substring(0, 2).ToUpper();
|
||||
if (!reader.IsDBNull(5)) crew.CrewMemberPlaceOfBirth = reader.GetString(5);
|
||||
if (!reader.IsDBNull(6)) crew.CrewMemberCountryOfBirth = reader.GetString(6).Substring(0, 2).ToUpper();
|
||||
|
||||
@ -79,6 +79,7 @@ namespace ENI2.EditControls
|
||||
{
|
||||
// copy back
|
||||
this.CREW.CrewMemberDuty = this.textBoxDuty.Text.Trim();
|
||||
if (this.CREW.CrewMemberDuty.IsNullOrEmpty()) this.CREW.CrewMemberDuty = "unknown";
|
||||
this.CREW.CrewMemberLastName = this.textBoxLastName.Text.Trim();
|
||||
this.CREW.CrewMemberFirstName = this.textBoxFirstName.Text.Trim();
|
||||
this.CREW.CrewMemberGender = (this.comboBoxGender.SelectedIndex == -1) ? null : (byte?) byte.Parse((string) this.comboBoxGender.SelectedValue);
|
||||
|
||||
@ -1224,6 +1224,7 @@ namespace ENI2.Excel
|
||||
crew.CrewMemberIdentityDocumentExpiryDate = reader.ReadCellAsDateTime("crew departure", string.Format("N{0}", i + 15));
|
||||
|
||||
crew.CrewMemberDuty = reader.ReadCellAsText("crew departure", string.Format("L{0}", i + 15));
|
||||
if (crew.CrewMemberDuty.IsNullOrEmpty()) crew.CrewMemberDuty = "unknown";
|
||||
|
||||
result = true;
|
||||
}
|
||||
@ -1273,6 +1274,7 @@ namespace ENI2.Excel
|
||||
crew.CrewMemberIdentityDocumentExpiryDate = reader.ReadCellAsDateTime("crew arrival", string.Format("N{0}", i + 15));
|
||||
|
||||
crew.CrewMemberDuty = reader.ReadCellAsText("crew arrival", string.Format("L{0}", i + 15));
|
||||
if (crew.CrewMemberDuty.IsNullOrEmpty()) crew.CrewMemberDuty = "unknown";
|
||||
|
||||
result = true;
|
||||
}
|
||||
|
||||
@ -2129,6 +2129,7 @@ namespace ENI2.Excel
|
||||
if (canceled) return true;
|
||||
|
||||
crew.CrewMemberDuty = reader.ReadCellAsText(sheetTitle, string.Format("F{0}", i + 18), 100);
|
||||
if (crew.CrewMemberDuty.IsNullOrEmpty()) crew.CrewMemberDuty = "unknown";
|
||||
crew.CrewMemberNationality = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("G{0}", i + 18)), out canceled);
|
||||
if (canceled) return true;
|
||||
crew.CrewMemberPlaceOfBirth = reader.ReadCellAsText(sheetTitle, string.Format("H{0}", i + 18), 100);
|
||||
@ -2183,6 +2184,7 @@ namespace ENI2.Excel
|
||||
if (canceled) return true;
|
||||
|
||||
crew.CrewMemberDuty = reader.ReadCellAsText(sheetTitle, string.Format("G{0}", i + 13));
|
||||
if (crew.CrewMemberDuty.IsNullOrEmpty()) crew.CrewMemberDuty = "unknown";
|
||||
crew.CrewMemberNationality = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("F{0}", i + 13)), out canceled);
|
||||
if (canceled) return true;
|
||||
crew.CrewMemberPlaceOfBirth = reader.ReadCellAsText(sheetTitle, string.Format("H{0}", i + 13));
|
||||
@ -2246,6 +2248,7 @@ namespace ENI2.Excel
|
||||
if (canceled) return true;
|
||||
|
||||
crewd.CrewMemberDuty = reader.ReadCellAsText(sheetTitle, string.Format("F{0}", i + 18), 100);
|
||||
if (crewd.CrewMemberDuty.IsNullOrEmpty()) crewd.CrewMemberDuty = "unknown";
|
||||
crewd.CrewMemberNationality = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("G{0}", i + 18)), out canceled);
|
||||
if (canceled) return true;
|
||||
crewd.CrewMemberPlaceOfBirth = reader.ReadCellAsText(sheetTitle, string.Format("H{0}", i + 18), 100);
|
||||
@ -2297,6 +2300,7 @@ namespace ENI2.Excel
|
||||
if (canceled) return true;
|
||||
|
||||
crewd.CrewMemberDuty = reader.ReadCellAsText(sheetTitle, string.Format("G{0}", i + 14));
|
||||
if (crewd.CrewMemberDuty.IsNullOrEmpty()) crewd.CrewMemberDuty = "unknown";
|
||||
crewd.CrewMemberNationality = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("F{0}", i + 14)), out canceled);
|
||||
if (canceled) return true;
|
||||
crewd.CrewMemberPlaceOfBirth = reader.ReadCellAsText(sheetTitle, string.Format("H{0}", i + 14));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user