diff --git a/ENI2/DetailViewControls/BorderPoliceDetailControl.xaml.cs b/ENI2/DetailViewControls/BorderPoliceDetailControl.xaml.cs index 75f43a9e..a65f09af 100644 --- a/ENI2/DetailViewControls/BorderPoliceDetailControl.xaml.cs +++ b/ENI2/DetailViewControls/BorderPoliceDetailControl.xaml.cs @@ -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(); diff --git a/ENI2/EditControls/EditCREWDialog.xaml.cs b/ENI2/EditControls/EditCREWDialog.xaml.cs index f182f0b0..a63ad71a 100644 --- a/ENI2/EditControls/EditCREWDialog.xaml.cs +++ b/ENI2/EditControls/EditCREWDialog.xaml.cs @@ -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); diff --git a/ENI2/Excel/DakosyUtil.cs b/ENI2/Excel/DakosyUtil.cs index d447836c..f16927b6 100644 --- a/ENI2/Excel/DakosyUtil.cs +++ b/ENI2/Excel/DakosyUtil.cs @@ -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; } diff --git a/ENI2/Excel/ExcelUtil.cs b/ENI2/Excel/ExcelUtil.cs index 2b47b27c..9e6f9791 100644 --- a/ENI2/Excel/ExcelUtil.cs +++ b/ENI2/Excel/ExcelUtil.cs @@ -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));