From f4fd9595a1e11c2aef31208ff15523c2aecfdaba Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Wed, 2 Aug 2023 17:15:32 +0200 Subject: [PATCH] Korrekturen --- .../PortNotificationDetailControl.xaml.cs | 2 +- ENI2/ENI2.csproj | 2 +- ENI2/EditControls/EditCREWDialog.xaml.cs | 20 ++++++++++++++--- ENI2/EditControls/EditPasDialog.xaml.cs | 21 +++++++++++++++--- ENI2/Excel/ExcelUtil.cs | 4 ++++ misc/db.sqlite | Bin 14426112 -> 14426112 bytes 6 files changed, 41 insertions(+), 8 deletions(-) diff --git a/ENI2/DetailViewControls/PortNotificationDetailControl.xaml.cs b/ENI2/DetailViewControls/PortNotificationDetailControl.xaml.cs index bc1ae6c4..752e4bb8 100644 --- a/ENI2/DetailViewControls/PortNotificationDetailControl.xaml.cs +++ b/ENI2/DetailViewControls/PortNotificationDetailControl.xaml.cs @@ -491,7 +491,7 @@ namespace ENI2.DetailViewControls { PortAreaInfo pai = this.comboBoxPortAreaHelper.SelectedItem as PortAreaInfo; // this.comboBoxPortAreaHelper.ToolTip = $"{pai.Remark} Ships: {pai.Ships} Agentur: {pai.Agency} Liegeplatz: {pai.Berth}"; - this.textBlockPortAreaRemarks.Text = $"Ag:{pai.Agency} Ship:{pai.Ships} :{pai.Remark}"; + this.textBlockPortAreaRemarks.Text = $"Agency:{pai.Agency}\nShip:{pai.Ships}\nRemark:{pai.Remark}"; } } diff --git a/ENI2/ENI2.csproj b/ENI2/ENI2.csproj index f5bd8965..1a1824a8 100644 --- a/ENI2/ENI2.csproj +++ b/ENI2/ENI2.csproj @@ -36,7 +36,7 @@ 5.4.0.0 true publish.html - 2 + 4 7.13.0.%2a false true diff --git a/ENI2/EditControls/EditCREWDialog.xaml.cs b/ENI2/EditControls/EditCREWDialog.xaml.cs index 5b1bea43..6c1d1883 100644 --- a/ENI2/EditControls/EditCREWDialog.xaml.cs +++ b/ENI2/EditControls/EditCREWDialog.xaml.cs @@ -2,6 +2,7 @@ // Description: CREW Bearbeitungsdialog // +using System; using System.Windows; using bsmd.database; @@ -15,6 +16,9 @@ namespace ENI2.EditControls /// public partial class EditCREWDialog : EditWindowBase { + + private static DateTime MAXDATE = new DateTime(2198, 12, 31); + public EditCREWDialog() { InitializeComponent(); @@ -35,15 +39,25 @@ namespace ENI2.EditControls this.textBoxPlaceOfBirth.Text = this.CREW.CrewMemberPlaceOfBirth; this.comboBoxNationality.ItemsSource = bsmd.database.CREW.NationalityDict; this.comboBoxNationality.SelectedValue = this.CREW.CrewMemberNationality; - this.datePickerDateOfBirth.SelectedDate = this.CREW.CrewMemberDateOfBirth; + if (this.CREW.CrewMemberDateOfBirth > MAXDATE) + this.CREW.CrewMemberDateOfBirth = MAXDATE; + else + this.datePickerDateOfBirth.SelectedDate = this.CREW.CrewMemberDateOfBirth; this.comboBoxIdDocType.ItemsSource = GlobalStructures.IDDocTypeDict; this.comboBoxIdDocType.SelectedValue = this.CREW.CrewMemberIdentityDocumentType?.ToString(); this.textBoxIdDocNumber.Text = this.CREW.CrewMemberIdentityDocumentId; this.textBoxVisaNumber.Text = this.CREW.CrewMemberVisaNumber; this.comboBoxIssuingState.ItemsSource = bsmd.database.CREW.NationalityDict; this.comboBoxIssuingState.SelectedValue = this.CREW.CrewMemberIdentityDocumentIssuingState; - if(this.CREW.CrewMemberIdentityDocumentExpiryDate.HasValue) - this.datePickerExpiryDate.SelectedDate = this.CREW.CrewMemberIdentityDocumentExpiryDate; + if (this.CREW.CrewMemberIdentityDocumentExpiryDate > MAXDATE) + { + this.datePickerExpiryDate.SelectedDate = MAXDATE; + } + else + { + if (this.CREW.CrewMemberIdentityDocumentExpiryDate.HasValue) + this.datePickerExpiryDate.SelectedDate = MAXDATE; + } // this.comboBoxCountryOfBirth.ItemsSource = bsmd.database.CREW.NationalityDict; // XXX: TODO // this.comboBoxCountryOfBirth.SelectedValue = this.CREW.CrewMemberCountryOfBirth; // this.textBoxEffects.Text = this.CREW.Effects; diff --git a/ENI2/EditControls/EditPasDialog.xaml.cs b/ENI2/EditControls/EditPasDialog.xaml.cs index 50ec611e..e5910f44 100644 --- a/ENI2/EditControls/EditPasDialog.xaml.cs +++ b/ENI2/EditControls/EditPasDialog.xaml.cs @@ -2,6 +2,7 @@ // Description: PAS Bearbeitungsdialog // +using System; using System.Windows; using bsmd.database; @@ -15,6 +16,9 @@ namespace ENI2.EditControls /// public partial class EditPASDialog : EditWindowBase { + + private static DateTime MAXDATE = new DateTime(2198, 12, 31); + public EditPASDialog() { InitializeComponent(); @@ -34,7 +38,10 @@ namespace ENI2.EditControls this.textBoxPlaceOfBirth.Text = this.PAS.PassengerPlaceOfBirth; this.comboBoxNationality.ItemsSource = bsmd.database.CREW.NationalityDict; this.comboBoxNationality.SelectedValue = this.PAS.PassengerNationality; - this.datePickerDateOfBirth.SelectedDate = this.PAS.PassengerDateOfBirth; + if (this.PAS.PassengerDateOfBirth > MAXDATE) + this.datePickerDateOfBirth.SelectedDate = MAXDATE; + else + this.datePickerDateOfBirth.SelectedDate = this.PAS.PassengerDateOfBirth; this.comboBoxIdDocType.ItemsSource = GlobalStructures.IDDocTypeDict; this.comboBoxIdDocType.SelectedValue = this.PAS.PassengerIdentityDocumentType?.ToString(); this.textBoxIdDocNumber.Text = this.PAS.PassengerIdentityDocumentId; @@ -44,8 +51,16 @@ namespace ENI2.EditControls this.checkBoxTransitPassenger.IsChecked = this.PAS.PassengerInTransit; this.comboBoxIssuingState.ItemsSource = bsmd.database.CREW.NationalityDict; this.comboBoxIssuingState.SelectedValue = this.PAS.PassengerIdentityDocumentIssuingState; - if(this.PAS.PassengerIdentityDocumentExpiryDate.HasValue) - this.datePickerExpiryDate.SelectedDate = this.PAS.PassengerIdentityDocumentExpiryDate; + + if (this.PAS.PassengerIdentityDocumentExpiryDate > MAXDATE) + { + this.datePickerExpiryDate.SelectedDate = MAXDATE; + } + else + { + if (this.PAS.PassengerIdentityDocumentExpiryDate.HasValue) + this.datePickerExpiryDate.SelectedDate = this.PAS.PassengerIdentityDocumentExpiryDate; + } // XXX : TODO //this.comboBoxCountryOfBirth.ItemsSource = bsmd.database.CREW.NationalityDict; //this.comboBoxCountryOfBirth.SelectedValue = this.PAS.PassengerCountryOfBirth; diff --git a/ENI2/Excel/ExcelUtil.cs b/ENI2/Excel/ExcelUtil.cs index 791465f0..fb267eeb 100644 --- a/ENI2/Excel/ExcelUtil.cs +++ b/ENI2/Excel/ExcelUtil.cs @@ -1446,6 +1446,10 @@ namespace ENI2.Excel string crewNameString = reader.ReadText(crewName); poc30d.PortOfCallLast30DaysCrewMembersJoined = !crewNameString.IsNullOrEmpty(); + // if crew members joined is set explicitly to true and the name is empty, still set the field to true + if (!(poc30d.PortOfCallLast30DaysCrewMembersJoined ?? false) && (PortOfCallLast30DaysCrewMembersJoinedFlag ?? false)) + poc30d.PortOfCallLast30DaysCrewMembersJoined = true; + if (poc30d.PortOfCallLast30DaysCrewMembersJoined ?? false) { // try different separators diff --git a/misc/db.sqlite b/misc/db.sqlite index 639d6066e43229a1bef0eb76602377cab72d4d62..be5351523e5561cd13abe98f46468e435a2ba1a7 100644 GIT binary patch delta 1251 zcmaLUTTql`90u^+O!wPeb`fJkg>>uFKtW&^PiSTYh}H(w=8~25EVu#WlGs1>ko2eXXI&PC^LYP{;snQoixNvDH4)5UMzd1wCfpZ9&9-u;Ki^-6!f zvu=AqwX<#$2q$q0F@`vm7)y*JT!cZm2@l~VvIrmHC$fq0L=G{5IE~090>tS=9x;)a zL`){~i2~vbVhS;p2oh%!XAvebjhIfHO%xJE#0+94QB0H&vxrinj3_5UM3|@`W)pLW zxx_qTK2b?5AQlqm5Q~U&iN(ZuL=|y9QBBkkwZsylj#x@8BQ78=BqGE`L_N_!G!hpR zmk?3nQers~BbtcIh!w=;#1+Jq#7g2S;%Y+q#EE92g;+%-h--*ziB_VGxQ=KiI*99u zB+*H%Ce{#L#0^9@v6fgz+(@K|^~6m?53zx`nYe}6Nc0k$h|R>U#BBtL+ljs*Si6q+ zT>BiR)9uK%v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