diff --git a/ENI2/Controls/ENIDataGrid.cs b/ENI2/Controls/ENIDataGrid.cs index fde19681..78bdcb6d 100644 --- a/ENI2/Controls/ENIDataGrid.cs +++ b/ENI2/Controls/ENIDataGrid.cs @@ -56,6 +56,7 @@ namespace ENI2.Controls // das hier bildet 1:1 das Kontext-MenĂ¼ des ANSW ab public event Action EditRequested; + public event Action> MultiEditRequested; public event Action DeleteRequested; public event Action CreateRequested; public event Action RefreshGrid; @@ -203,9 +204,17 @@ namespace ENI2.Controls { if((this.SelectedItems != null) && (this.SelectedItems.Count == 1) && !this.IsReadOnly) { - if (this.SelectedItems[0] is DatabaseEntity selectedEntity) + if (this.SelectedItems[0] is DatabaseEntity selectedEntity) this.EditRequested?.Invoke(selectedEntity); } + + if((this.SelectedItems != null) && (this.SelectedItems.Count > 1) && !this.IsReadOnly) + { + List databaseEntities = new List(); + foreach(DatabaseEntity databaseEntity in this.SelectedItems) + databaseEntities.Add(databaseEntity); + this.MultiEditRequested?.Invoke(databaseEntities); + } } protected void printItem(object sender, RoutedEventArgs e) diff --git a/ENI2/Controls/EditWindowBase.cs b/ENI2/Controls/EditWindowBase.cs index ae0f6f06..5e9d590d 100644 --- a/ENI2/Controls/EditWindowBase.cs +++ b/ENI2/Controls/EditWindowBase.cs @@ -63,10 +63,17 @@ namespace ENI2.Controls get { var addButton = (Button)Template.FindName("buttonAdd", this); return addButton.Visibility == Visibility.Visible; } set { - var addButton = (Button)Template.FindName("buttonAdd", this); addButton.Visibility = value ? Visibility.Visible : Visibility.Hidden; + var addButton = (Button)Template.FindName("buttonAdd", this); + if (addButton != null) + { + addButton.Visibility = value ? Visibility.Visible : Visibility.Hidden; + } var okButton = (Button)Template.FindName("buttonOK", this); - if (okButton.Visibility == Visibility.Hidden) - okButton.Width = 1; // we are in a DockPanel, try to collapse okButton to place addButton more to the right + if (okButton != null) + { + if (okButton.Visibility == Visibility.Hidden) + okButton.Width = 1; // we are in a DockPanel, try to collapse okButton to place addButton more to the right + } } } diff --git a/ENI2/DetailViewControls/BorderPoliceDetailControl.xaml.cs b/ENI2/DetailViewControls/BorderPoliceDetailControl.xaml.cs index e2081b6b..95b13bf9 100644 --- a/ENI2/DetailViewControls/BorderPoliceDetailControl.xaml.cs +++ b/ENI2/DetailViewControls/BorderPoliceDetailControl.xaml.cs @@ -114,6 +114,7 @@ namespace ENI2.DetailViewControls this.dataGridCrewList.DeleteRequested += DataGridCrewList_DeleteRequested; this.dataGridCrewList.CreateRequested += DataGridCrewList_CreateRequested; this.dataGridCrewList.RefreshGrid += DataGridCrewList_RefreshGrid; + this.dataGridCrewList.MultiEditRequested += DataGridCrewList_MultiEditRequested; if(this._crewMessage.Elements.Count > 0) { @@ -150,6 +151,7 @@ namespace ENI2.DetailViewControls this.dataGridCrewListDeparture.DeleteRequested += DataGridCrewListDeparture_DeleteRequested; this.dataGridCrewListDeparture.CreateRequested += DataGridCrewListDeparture_CreateRequested; this.dataGridCrewListDeparture.RefreshGrid += DataGridCrewListDeparture_RefreshGrid; + this.dataGridCrewListDeparture.MultiEditRequested += DataGridCrewListDeparture_MultiEditRequested; if (this._crewdMessage.Elements.Count > 0) { @@ -185,7 +187,8 @@ namespace ENI2.DetailViewControls this.dataGridPassengerList.EditRequested += DataGridPassengerList_EditRequested; this.dataGridPassengerList.DeleteRequested += DataGridPassengerList_DeleteRequested; this.dataGridPassengerList.CreateRequested += DataGridPassengerList_CreateRequested; - this.dataGridPassengerList.RefreshGrid += DataGridPassengerList_RefreshGrid; + this.dataGridPassengerList.RefreshGrid += DataGridPassengerList_RefreshGrid; + this.dataGridPassengerList.MultiEditRequested += DataGridPassengerList_MultiEditRequested; if (this._pasMessage.Elements.Count > 0) { @@ -222,6 +225,7 @@ namespace ENI2.DetailViewControls this.dataGridPassengerListDeparture.DeleteRequested += DataGridPassengerListDeparture_DeleteRequested; this.dataGridPassengerListDeparture.CreateRequested += DataGridPassengerListDeparture_CreateRequested; this.dataGridPassengerListDeparture.RefreshGrid += DataGridPassengerListDeparture_RefreshGrid; + this.dataGridPassengerListDeparture.MultiEditRequested += DataGridPassengerListDeparture_MultiEditRequested; if (this._pasdMessage.Elements.Count > 0) { @@ -240,7 +244,7 @@ namespace ENI2.DetailViewControls } #endregion - } + } #region Grid copy handlers @@ -630,6 +634,28 @@ namespace ENI2.DetailViewControls this.DataGridPassengerList_CreateRequested(); } + private void DataGridPassengerList_MultiEditRequested(List databaseEntities) + { + List pasList = new List(); + foreach (PAS apas in databaseEntities.Cast()) + pasList.Add(apas); + + // write common values of all PAS entities to template entity + PAS pas = PAS.CreateCommon(pasList); + + EditPASDialog dialog = new EditPASDialog(); + dialog.PAS = pas; + dialog.AddVisible = false; + if (dialog.ShowDialog() ?? false) + { + // write back changed values from pas to all entities and mark them as changed + PAS.WriteTemplateToList(pas, pasList); + + this.SublistElementChanged(Message.NotificationClass.PASA); + this.dataGridPassengerList.Items.Refresh(); + } + } + #endregion #region passenger grid departure @@ -734,6 +760,28 @@ namespace ENI2.DetailViewControls this.DataGridPassengerListDeparture_CreateRequested(); } + private void DataGridPassengerListDeparture_MultiEditRequested(List databaseEntities) + { + List pasList = new List(); + foreach (PAS apas in databaseEntities.Cast()) + pasList.Add(apas); + + // write common values of all PAS entities to template entity + PAS pas = PAS.CreateCommon(pasList); + + EditPASDialog dialog = new EditPASDialog(); + dialog.PAS = pas; + dialog.AddVisible = false; + if (dialog.ShowDialog() ?? false) + { + // write back changed values from pas to all entities and mark them as changed + PAS.WriteTemplateToList(pas, pasList); + + this.SublistElementChanged(Message.NotificationClass.PASD); + this.dataGridPassengerListDeparture.Items.Refresh(); + } + } + #endregion #region crew grid arrival @@ -835,6 +883,28 @@ namespace ENI2.DetailViewControls this.DataGridCrewList_CreateRequested(); } + private void DataGridCrewList_MultiEditRequested(List databaseEntities) + { + List crewList = new List(); + foreach (CREW acrew in databaseEntities.Cast()) + crewList.Add(acrew); + + // write common values of all CREW entities to template entity + CREW crew = CREW.CreateCommon(crewList); + + EditCREWDialog dialog = new EditCREWDialog(); + dialog.CREW = crew; + dialog.AddVisible = false; + if(dialog.ShowDialog() ?? false) + { + // write back changed values from crew to all entities and mark them as changed + CREW.WriteTemplateToList(crew, crewList); + + this.SublistElementChanged(Message.NotificationClass.CREWA); + this.dataGridCrewList.Items.Refresh(); + } + } + #endregion #region crew grid departure @@ -939,6 +1009,28 @@ namespace ENI2.DetailViewControls this.DataGridCrewListDeparture_CreateRequested(); } + private void DataGridCrewListDeparture_MultiEditRequested(List databaseEntities) + { + List crewList = new List(); + foreach (CREW acrew in databaseEntities.Cast()) + crewList.Add(acrew); + + // write common values of all CREW entities to template entity + CREW crew = CREW.CreateCommon(crewList); + + EditCREWDialog dialog = new EditCREWDialog(); + dialog.CREW = crew; + dialog.AddVisible = false; + if (dialog.ShowDialog() ?? false) + { + // write back changed values from crew to all entities and mark them as changed + CREW.WriteTemplateToList(crew, crewList); + + this.SublistElementChanged(Message.NotificationClass.CREWD); + this.dataGridCrewListDeparture.Items.Refresh(); + } + } + #endregion #region Excel import diff --git a/bsmd.database/CREW.cs b/bsmd.database/CREW.cs index 98aa3915..47c8a970 100644 --- a/bsmd.database/CREW.cs +++ b/bsmd.database/CREW.cs @@ -459,6 +459,135 @@ namespace bsmd.database #endregion + #region public static helper funcs + + public static CREW CreateCommon(List crewList) + { + CREW crew = new CREW(); // template entity + + if(crewList.IsNullOrEmpty()) + return crew; + + string crewMemberLastName = crewList[0].CrewMemberLastName; + if (crewList.All(x => Extensions.AreEqual(x.CrewMemberLastName, crewMemberLastName))) + crew.CrewMemberLastName = crewMemberLastName; + + string crewMemberFirstName = crewList[0].CrewMemberFirstName; + if (crewList.All(x => Extensions.AreEqual(x.CrewMemberFirstName, crewMemberFirstName))) + crew.CrewMemberFirstName = crewMemberFirstName; + + string crewMemberPlaceOfBirth = crewList[0].CrewMemberPlaceOfBirth; + if (crewList.All(x => Extensions.AreEqual(x.CrewMemberPlaceOfBirth, crewMemberPlaceOfBirth))) + crew.CrewMemberPlaceOfBirth = crewMemberPlaceOfBirth; + + string crewMemberCountryOfBirth = crewList[0].CrewMemberCountryOfBirth; + if (crewList.All(x => Extensions.AreEqual(x.CrewMemberPlaceOfBirth, crewMemberCountryOfBirth))) + crew.CrewMemberCountryOfBirth = crewMemberCountryOfBirth; + + DateTime? crewMemberDateOfBirth = crewList[0].CrewMemberDateOfBirth; + if (crewList.All(x => Extensions.AreEqual(x.CrewMemberDateOfBirth, crewMemberDateOfBirth))) + crew.CrewMemberDateOfBirth = crewMemberDateOfBirth; + + byte? crewMemberGender = crewList[0].CrewMemberGender; + if (crewList.All(x => Extensions.AreEqual(x.CrewMemberGender, crewMemberGender))) + crew.CrewMemberGender = crewMemberGender; + + string crewMemberNationality = crewList[0].CrewMemberNationality; + if (crewList.All(x => Extensions.AreEqual(x.CrewMemberNationality, crewMemberNationality))) + crew.CrewMemberNationality = crewMemberNationality; + + byte? crewMemberIdentityDocumentType = crewList[0].CrewMemberIdentityDocumentType; + if (crewList.All(x => Extensions.AreEqual(x.CrewMemberIdentityDocumentType, crewMemberIdentityDocumentType))) + crew.CrewMemberIdentityDocumentType = crewMemberIdentityDocumentType; + + string crewMemberIdentityDocumentId = crewList[0].CrewMemberIdentityDocumentId; + if (crewList.All(x => Extensions.AreEqual(x.CrewMemberIdentityDocumentId, crewMemberIdentityDocumentId))) + crew.CrewMemberIdentityDocumentId = crewMemberIdentityDocumentId; + + string crewMemberVisaNumber = crewList[0].CrewMemberVisaNumber; + if (crewList.All(x => Extensions.AreEqual(x.CrewMemberVisaNumber, crewMemberVisaNumber))) + crew.CrewMemberVisaNumber = crewMemberVisaNumber; + + string crewMemberDuty = crewList[0].CrewMemberDuty; + if (crewList.All(x => Extensions.AreEqual(x.CrewMemberDuty, crewMemberDuty))) + crew.CrewMemberDuty = crewMemberDuty; + + string crewMemberIdentityDocumentIssuingState = crewList[0].CrewMemberIdentityDocumentIssuingState; + if (crewList.All(x => Extensions.AreEqual(x.CrewMemberIdentityDocumentIssuingState, crewMemberIdentityDocumentIssuingState))) + crew.CrewMemberIdentityDocumentIssuingState = crewMemberIdentityDocumentIssuingState; + + DateTime? crewMemberIdentityDocumentExpiryDate = crewList[0].CrewMemberIdentityDocumentExpiryDate; + if (crewList.All(x => Extensions.AreEqual(x.CrewMemberIdentityDocumentExpiryDate, crewMemberIdentityDocumentExpiryDate))) + crew.CrewMemberIdentityDocumentExpiryDate = crewMemberIdentityDocumentExpiryDate; + + string effects = crewList[0].Effects; + if (crewList.All(x => Extensions.AreEqual(x.Effects, effects))) + crew.Effects = effects; + + bool? notificationPax = crewList[0].NotificationPAX; + if (crewList.All(x => Extensions.AreEqual(x.NotificationPAX, notificationPax))) + crew.NotificationPAX = notificationPax; + + bool? notificationSchengen = crewList[0].NotificationSchengen; + if (crewList.All(x => Extensions.AreEqual(x.NotificationSchengen, notificationSchengen))) + crew.NotificationSchengen = notificationSchengen; + + return crew; + } + + public static void WriteTemplateToList(CREW crew, List crewList) + { + if (!crew.CrewMemberLastName.IsNullOrEmpty()) + crewList.ForEach(x => x.CrewMemberLastName = crew.CrewMemberLastName); + + if (!crew.CrewMemberFirstName.IsNullOrEmpty()) + crewList.ForEach(x => x.CrewMemberFirstName = crew.CrewMemberFirstName); + + if (!crew.CrewMemberPlaceOfBirth.IsNullOrEmpty()) + crewList.ForEach(x => x.CrewMemberPlaceOfBirth = crew.CrewMemberPlaceOfBirth); + + if (!crew.CrewMemberCountryOfBirth.IsNullOrEmpty()) + crewList.ForEach(x => x.CrewMemberCountryOfBirth = crew.CrewMemberCountryOfBirth); + + if (crew.CrewMemberDateOfBirth != null) + crewList.ForEach(x => x.CrewMemberDateOfBirth = crew.CrewMemberDateOfBirth); + + if (crew.CrewMemberGender != null) + crewList.ForEach(x => x.CrewMemberGender = crew.CrewMemberGender); + + if (!crew.CrewMemberNationality.IsNullOrEmpty()) + crewList.ForEach(x => x.CrewMemberNationality = crew.CrewMemberNationality); + + if (crew.CrewMemberIdentityDocumentType != null) + crewList.ForEach(x => x.CrewMemberIdentityDocumentType = crew.CrewMemberIdentityDocumentType); + + if (!crew.CrewMemberIdentityDocumentId.IsNullOrEmpty()) + crewList.ForEach(x => x.CrewMemberIdentityDocumentId = crew.CrewMemberIdentityDocumentId); + + if (!crew.CrewMemberVisaNumber.IsNullOrEmpty()) + crewList.ForEach(x => x.CrewMemberVisaNumber = crew.CrewMemberVisaNumber); + + if (!crew.CrewMemberDuty.IsNullOrEmpty()) + crewList.ForEach(x => x.CrewMemberDuty = crew.CrewMemberDuty); + + if (!crew.CrewMemberIdentityDocumentIssuingState.IsNullOrEmpty()) + crewList.ForEach(x => x.CrewMemberIdentityDocumentIssuingState = crew.CrewMemberIdentityDocumentIssuingState); + + if (crew.CrewMemberIdentityDocumentExpiryDate != null) + crewList.ForEach(x => x.CrewMemberIdentityDocumentExpiryDate = crew.CrewMemberIdentityDocumentExpiryDate); + + if (!crew.Effects.IsNullOrEmpty()) + crewList.ForEach(x => x.Effects = crew.Effects); + + if (crew.NotificationPAX != null) + crewList.ForEach(x => x.NotificationPAX = crew.NotificationPAX); + + if (crew.NotificationSchengen != null) + crewList.ForEach(x => x.NotificationSchengen = crew.NotificationSchengen); + } + + #endregion + } #region CREWD diff --git a/bsmd.database/Extensions.cs b/bsmd.database/Extensions.cs index 9392547a..ef2d775f 100644 --- a/bsmd.database/Extensions.cs +++ b/bsmd.database/Extensions.cs @@ -36,6 +36,33 @@ namespace bsmd.database return false; } + public static bool AreEqual(string a, string b) + { + if (string.IsNullOrEmpty(a)) return string.IsNullOrEmpty(b); + return string.Equals(a, b); + } + + public static bool AreEqual(DateTime? a, DateTime? b) + { + if(!a.HasValue) return !b.HasValue; + if(!b.HasValue) return !a.HasValue; + return a.Value.Equals(b.Value); + } + + public static bool AreEqual(byte? a, byte? b) + { + if (!a.HasValue) return !b.HasValue; + if (!b.HasValue) return !a.HasValue; + return a.Value.Equals(b.Value); + } + + public static bool AreEqual(bool? a, bool? b) + { + if (!a.HasValue) return !b.HasValue; + if (!b.HasValue) return !a.HasValue; + return a.Value == b.Value; + } + public static bool IsNullOrEmpty(this List items) { return (items == null) || (items.Count == 0); diff --git a/bsmd.database/PAS.cs b/bsmd.database/PAS.cs index cd247fa4..010b0109 100644 --- a/bsmd.database/PAS.cs +++ b/bsmd.database/PAS.cs @@ -521,6 +521,157 @@ namespace bsmd.database } #endregion + + #region public static helper funcs + + public static PAS CreateCommon(List pasList) + { + PAS pas = new PAS(); // template entity + // + if (pasList.IsNullOrEmpty()) + return pas; + + string passengerLastName = pasList[0].PassengerLastName; + if (pasList.All(x => Extensions.AreEqual(x.PassengerLastName, passengerLastName))) + pas.PassengerLastName = passengerLastName; + + string passengerFirstName = pasList[0].PassengerFirstName; + if(pasList.All(x => Extensions.AreEqual(x.PassengerFirstName, passengerFirstName))) + pas.PassengerFirstName = passengerFirstName; + + string passengerPlaceOfBirth = pasList[0].PassengerPlaceOfBirth; + if(pasList.All(x => Extensions.AreEqual(x.PassengerPlaceOfBirth, passengerPlaceOfBirth))) + pas.PassengerPlaceOfBirth = passengerPlaceOfBirth; + + DateTime? passengerDateOfBirth = pasList[0].PassengerDateOfBirth; + if(pasList.All(x => Extensions.AreEqual(x.PassengerDateOfBirth, passengerDateOfBirth))) + pas.PassengerDateOfBirth = passengerDateOfBirth; + + byte? passengerGender = pasList[0].PassengerGender; + if(pasList.All(x => Extensions.AreEqual(x.PassengerGender, passengerGender))) + pas.PassengerGender = passengerGender; + + string passengerNationality = pasList[0].PassengerNationality; + if(pasList.All(x => Extensions.AreEqual(x.PassengerNationality, passengerNationality))) + pas.PassengerNationality = passengerNationality; + + byte? passengerIdentityDocumentType = pasList[0].PassengerIdentityDocumentType; + if(pasList.All(x => Extensions.AreEqual(x.PassengerIdentityDocumentType, passengerIdentityDocumentType))) + pas.PassengerIdentityDocumentType = passengerIdentityDocumentType; + + string passengerIdentityDocumentId = pasList[0].PassengerIdentityDocumentId; + if(pasList.All(x => Extensions.AreEqual(x.PassengerIdentityDocumentId, passengerIdentityDocumentId))) + pas.PassengerIdentityDocumentId = passengerIdentityDocumentId; + + string passengerVisaNumber = pasList[0].PassengerVisaNumber; + if(pasList.All(x => Extensions.AreEqual(x.PassengerVisaNumber, passengerVisaNumber))) + pas.PassengerVisaNumber = passengerVisaNumber; + + string passengerPortOfEmbarkation = pasList[0].PassengerPortOfEmbarkation; + if (pasList.All(x => Extensions.AreEqual(x.PassengerPortOfEmbarkation, passengerPortOfEmbarkation))) + pas.PassengerPortOfEmbarkation = passengerPortOfEmbarkation; + + string passengerPortOfDisembarkation = pasList[0].PassengerPortOfDisembarkation; + if(pasList.All(x => Extensions.AreEqual(x.PassengerPortOfDisembarkation, passengerPortOfDisembarkation))) + pas.PassengerPortOfDisembarkation = passengerPortOfDisembarkation; + + bool? passengerInTransit = pasList[0].PassengerInTransit; + if(pasList.All(x => Extensions.AreEqual(x.PassengerInTransit, passengerInTransit))) + pas.PassengerInTransit = passengerInTransit; + + string passengerIdentityDocumentIssuingState = pasList[0].PassengerIdentityDocumentIssuingState; + if(pasList.All(x => Extensions.AreEqual(x.PassengerIdentityDocumentIssuingState, passengerIdentityDocumentIssuingState))) + pas.PassengerIdentityDocumentIssuingState = passengerIdentityDocumentIssuingState; + + DateTime? passengerIdentityDocumentExpiryDate = pasList[0].PassengerIdentityDocumentExpiryDate; + if(pasList.All(x => Extensions.AreEqual(x.PassengerIdentityDocumentExpiryDate, passengerIdentityDocumentExpiryDate))) + pas.PassengerIdentityDocumentExpiryDate = passengerIdentityDocumentExpiryDate; + + bool? notificationSchengen = pasList[0].NotificationSchengen; + if(pasList.All(x => Extensions.AreEqual(x.NotificationSchengen, notificationSchengen))) + pas.NotificationSchengen = notificationSchengen; + + bool? notificationPAX = pasList[0].NotificationPAX; + if(pasList.All(x => Extensions.AreEqual(x.NotificationPAX, notificationPAX))) + pas.NotificationPAX = notificationPAX; + + string passengerCountryOfBirth = pasList[0].PassengerCountryOfBirth; + if(pasList.All(x => Extensions.AreEqual(x.PassengerCountryOfBirth, passengerCountryOfBirth))) + pas.PassengerCountryOfBirth = passengerCountryOfBirth; + + string emergencyCare = pasList[0].EmergencyCare; + if(pasList.All(x => Extensions.AreEqual(x.EmergencyCare, emergencyCare))) + pas.EmergencyCare = emergencyCare; + + string emergencyContactNumber = pasList[0].EmergencyContactNumber; + if(pasList.All(x => Extensions.AreEqual(x.EmergencyContactNumber, emergencyContactNumber))) + pas.EmergencyContactNumber = emergencyContactNumber; + + return pas; + } + + public static void WriteTemplateToList(PAS pas, List pasList) + { + if (!pas.PassengerLastName.IsNullOrEmpty()) + pasList.ForEach(x => x.PassengerLastName = pas.PassengerLastName); + + if (!pas.PassengerFirstName.IsNullOrEmpty()) + pasList.ForEach(x => x.PassengerFirstName = pas.PassengerFirstName); + + if(!pas.PassengerPlaceOfBirth.IsNullOrEmpty()) + pasList.ForEach(x => x.PassengerPlaceOfBirth = pas.PassengerPlaceOfBirth); + + if(pas.PassengerDateOfBirth.HasValue) + pasList.ForEach(x => x.PassengerDateOfBirth = pas.PassengerDateOfBirth.Value); + + if(pas.PassengerGender.HasValue) + pasList.ForEach(x => x.PassengerGender = pas.PassengerGender.Value); + + if(!pas.PassengerNationality.IsNullOrEmpty()) + pasList.ForEach(x => x.PassengerNationality = pas.PassengerNationality); + + if(pas.PassengerIdentityDocumentType.HasValue) + pasList.ForEach(x => x.PassengerIdentityDocumentType = pas.PassengerIdentityDocumentType.Value); + + if(!pas.PassengerIdentityDocumentId.IsNullOrEmpty()) + pasList.ForEach(x => x.PassengerIdentityDocumentId = pas.PassengerIdentityDocumentId); + + if(!pas.PassengerVisaNumber.IsNullOrEmpty()) + pasList.ForEach(x => x.PassengerVisaNumber = pas.PassengerVisaNumber); + + if(!pas.PassengerPortOfEmbarkation.IsNullOrEmpty()) + pasList.ForEach(x => x.PassengerPortOfEmbarkation = pas.PassengerPortOfEmbarkation); + + if(!pas.PassengerPortOfDisembarkation.IsNullOrEmpty()) + pasList.ForEach(x => x.PassengerPortOfDisembarkation = pas.PassengerPortOfDisembarkation); + + if(pas.PassengerInTransit.HasValue) + pasList.ForEach(x => x.PassengerInTransit = pas.PassengerInTransit.Value); + + if(!pas.PassengerIdentityDocumentIssuingState.IsNullOrEmpty()) + pasList.ForEach(x => x.PassengerIdentityDocumentIssuingState = pas.PassengerIdentityDocumentIssuingState); + + if(pas.PassengerIdentityDocumentExpiryDate.HasValue) + pasList.ForEach(x => x.PassengerIdentityDocumentExpiryDate = pas.PassengerIdentityDocumentExpiryDate.Value); + + if(pas.NotificationSchengen.HasValue) + pasList.ForEach(x => x.NotificationSchengen = pas.NotificationSchengen.Value); + + if(pas.NotificationPAX.HasValue) + pasList.ForEach(x => x.NotificationPAX = pas.NotificationPAX.Value); + + if(!pas.PassengerCountryOfBirth.IsNullOrEmpty()) + pasList.ForEach(x => x.PassengerCountryOfBirth = pas.PassengerCountryOfBirth); + + if(!pas.EmergencyCare.IsNullOrEmpty()) + pasList.ForEach(x => x.EmergencyCare = pas.EmergencyCare); + + if(!pas.EmergencyContactNumber.IsNullOrEmpty()) + pasList.ForEach(x => x.EmergencyContactNumber = pas.EmergencyContactNumber); + + } + + #endregion } #region class PASD