diff --git a/ENI2/DetailViewControls/OverViewDetailControl.xaml b/ENI2/DetailViewControls/OverViewDetailControl.xaml
index ec9d46f3..a5489f27 100644
--- a/ENI2/DetailViewControls/OverViewDetailControl.xaml
+++ b/ENI2/DetailViewControls/OverViewDetailControl.xaml
@@ -75,7 +75,13 @@
-
+
+
@@ -123,7 +129,7 @@
-
+
diff --git a/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs b/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs
index 6738becf..dbcd11dd 100644
--- a/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs
+++ b/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs
@@ -766,25 +766,39 @@ namespace ENI2.DetailViewControls
private void buttonExcelExport_Click(object sender, RoutedEventArgs e)
{
string filename = string.Format("{0}_{1}_ref.xlsx", this.Core.Shipname, this.Core.DisplayId);
+ this.ExportData(filename, true);
+ }
+
+ ///
+ /// Export all classes in "new" sheet version (>= 7.0).. this to return the current format to the ships
+ ///
+ private void buttonFormblattNeu_Click(object sender, RoutedEventArgs e)
+ {
+ string filename = string.Format("{0}_{1}_EU-NoAD-Data-Collecting-Tool-5_0.xlsx", this.Core.Shipname, this.Core.DisplayId);
+ this.ExportData(filename, false);
+ }
+
+ private void ExportData(string filename, bool isRefSheet)
+ {
SaveFileDialog sfd = new SaveFileDialog()
{
Filter = "Excel Files|*.xls;*.xlsx",
FileName = filename
};
- if(sfd.ShowDialog() ?? false)
+ if (sfd.ShowDialog() ?? false)
{
Util.UIHelper.SetBusyState();
- ExcelManager em = new ExcelManager();
+ ExcelManager em = new ExcelManager();
try
{
- em.Export(sfd.FileName, this.Core, this.Messages, out string resultMessage);
+ em.Export(sfd.FileName, this.Core, this.Messages, out string resultMessage, isRefSheet);
MessageBox.Show("Exported " + sfd.FileName, "Export successful", MessageBoxButton.OK, MessageBoxImage.Information);
Process.Start(sfd.FileName);
}
- catch(Exception ex)
- {
+ catch (Exception ex)
+ {
MessageBox.Show(ex.Message, "Export failed", MessageBoxButton.OK, MessageBoxImage.Error);
}
}
diff --git a/ENI2/ENI2.csproj b/ENI2/ENI2.csproj
index 257dc96c..43009026 100644
--- a/ENI2/ENI2.csproj
+++ b/ENI2/ENI2.csproj
@@ -36,8 +36,8 @@
5.4.0.0
true
publish.html
- 12
- 7.0.0.12
+ 13
+ 7.0.0.13
false
true
true
@@ -730,6 +730,10 @@
Excel\Reference_Sheet_DE.xlsx
PreserveNewest
+
+ Excel\EU-NoAD-Data-Collecting-Tool-5_0.xlsx
+ PreserveNewest
+
diff --git a/ENI2/EditControls/EditCREWDialog.xaml.cs b/ENI2/EditControls/EditCREWDialog.xaml.cs
index 6bfe2110..fda9db33 100644
--- a/ENI2/EditControls/EditCREWDialog.xaml.cs
+++ b/ENI2/EditControls/EditCREWDialog.xaml.cs
@@ -33,6 +33,8 @@ namespace ENI2.EditControls
this.comboBoxGender.ItemsSource = GlobalStructures.GenderList;
//this.comboBoxGender.KeyUp += ComboBox_KeyUp;
this.comboBoxGender.SelectedIndex = this.CREW.CrewMemberGender ?? -1;
+ if (this.CREW.CrewMemberGender == 9)
+ this.comboBoxGender.SelectedIndex = 3;
this.textBoxPlaceOfBirth.Text = this.CREW.CrewMemberPlaceOfBirth;
this.comboBoxNationality.ItemsSource = bsmd.database.CREW.NationalityDict;
//this.comboBoxNationality.KeyUp += ComboBox_KeyUp;
@@ -60,6 +62,7 @@ namespace ENI2.EditControls
this.CREW.CrewMemberLastName = this.textBoxLastName.Text.Trim();
this.CREW.CrewMemberFirstName = this.textBoxFirstName.Text.Trim();
this.CREW.CrewMemberGender = (this.comboBoxGender.SelectedIndex == -1) ? null : (byte?) this.comboBoxGender.SelectedIndex;
+ if (this.CREW.CrewMemberGender == 3) this.CREW.CrewMemberGender = 9;
this.CREW.CrewMemberPlaceOfBirth = this.textBoxPlaceOfBirth.Text.Trim();
this.CREW.CrewMemberNationality = (this.comboBoxNationality.SelectedValue == null) ? "" : (string)this.comboBoxNationality.SelectedValue;
this.CREW.CrewMemberDateOfBirth = this.datePickerDateOfBirth.SelectedDate;
diff --git a/ENI2/EditControls/EditPasDialog.xaml.cs b/ENI2/EditControls/EditPasDialog.xaml.cs
index 10575754..53494ac0 100644
--- a/ENI2/EditControls/EditPasDialog.xaml.cs
+++ b/ENI2/EditControls/EditPasDialog.xaml.cs
@@ -32,6 +32,8 @@ namespace ENI2.EditControls
this.comboBoxGender.ItemsSource = GlobalStructures.GenderList;
//this.comboBoxGender.KeyUp += ComboBox_KeyUp;
this.comboBoxGender.SelectedIndex = this.PAS.PassengerGender ?? -1;
+ if (this.PAS.PassengerGender == 9)
+ this.comboBoxGender.SelectedIndex = 3;
this.textBoxPlaceOfBirth.Text = this.PAS.PassengerPlaceOfBirth;
this.comboBoxNationality.ItemsSource = bsmd.database.CREW.NationalityDict;
//this.comboBoxNationality.KeyUp += ComboBox_KeyUp;
@@ -64,6 +66,8 @@ namespace ENI2.EditControls
this.PAS.PassengerLastName = this.textBoxLastName.Text.Trim();
this.PAS.PassengerFirstName = this.textBoxFirstName.Text.Trim();
this.PAS.PassengerGender = (this.comboBoxGender.SelectedIndex == -1) ? null : (byte?)this.comboBoxGender.SelectedIndex;
+ if (this.PAS.PassengerGender == 3)
+ this.PAS.PassengerGender = 9;
this.PAS.PassengerPlaceOfBirth = this.textBoxPlaceOfBirth.Text.Trim();
this.PAS.PassengerNationality = (this.comboBoxNationality.SelectedValue == null) ? "" : (string)this.comboBoxNationality.SelectedValue;
this.PAS.PassengerDateOfBirth = this.datePickerDateOfBirth.SelectedDate;
diff --git a/ENI2/Excel/ExcelManager.cs b/ENI2/Excel/ExcelManager.cs
index 8af5a707..8efa3931 100644
--- a/ENI2/Excel/ExcelManager.cs
+++ b/ENI2/Excel/ExcelManager.cs
@@ -54,14 +54,14 @@ namespace ENI2.Excel
return result;
}
- internal void Export(string fileName, MessageCore core, List messages, out string resultMessage)
+ internal void Export(string fileName, MessageCore core, List messages, out string resultMessage, bool isRefSheet)
{
resultMessage = "";
// Create ExcelWriter
- using (ExcelWriter ew = new ExcelWriter(fileName))
+ using (ExcelWriter ew = new ExcelWriter(fileName, isRefSheet))
{
- ew.WriteData(messages, core, out resultMessage);
+ ew.WriteData(messages, core, out resultMessage, isRefSheet);
ew.Save();
}
}
diff --git a/ENI2/Excel/ExcelReader.cs b/ENI2/Excel/ExcelReader.cs
index 93ccfc9c..31c2afaf 100644
--- a/ENI2/Excel/ExcelReader.cs
+++ b/ENI2/Excel/ExcelReader.cs
@@ -107,16 +107,21 @@ namespace ENI2.Excel
string val = this.ReadText(lookup);
if (val != null)
{
- if (val.Equals("m", StringComparison.CurrentCultureIgnoreCase) || val.Equals("male", StringComparison.CurrentCultureIgnoreCase)) {
- result = 0;
+ if (val.Equals("m", StringComparison.CurrentCultureIgnoreCase) || val.Equals("male", StringComparison.CurrentCultureIgnoreCase)) {
+ result = 1;
}
else if (val.Equals("f", StringComparison.CurrentCultureIgnoreCase) || val.Equals("female", StringComparison.CurrentCultureIgnoreCase))
{
- result = 1;
+ result = 2;
+ }
+ else if (val.Equals("n", StringComparison.CurrentCultureIgnoreCase) || val.Equals("not applicable", StringComparison.CurrentCultureIgnoreCase) ||
+ val.Equals("d", StringComparison.CurrentCultureIgnoreCase) || val.Equals("diverse", StringComparison.CurrentCultureIgnoreCase))
+ {
+ result = 9;
}
else
{
- result = 2;
+ result = 0;
}
}
if(result == null)
diff --git a/ENI2/Excel/ExcelWriter.cs b/ENI2/Excel/ExcelWriter.cs
index 2d2838f3..7c855edd 100644
--- a/ENI2/Excel/ExcelWriter.cs
+++ b/ENI2/Excel/ExcelWriter.cs
@@ -10,6 +10,8 @@ using System.Linq;
using System.Reflection;
using bsmd.database;
+using ENI2.Report;
+using ENI2.Util;
namespace ENI2.Excel
{
@@ -24,9 +26,12 @@ namespace ENI2.Excel
#region Construction
- public ExcelWriter(string filePath) : base(filePath)
+ public ExcelWriter(string filePath, bool isRefSheet) : base(filePath)
{
- string refFilePath = System.IO.Path.Combine(Environment.CurrentDirectory, @"Excel\Reference_Sheet_DE.xlsx");
+ string filename = @"Excel\EU-NoAD-Data-Collecting-Tool-5_0.xlsx";
+ if (isRefSheet) filename = @"Excel\Reference_Sheet_DE.xlsx";
+
+ string refFilePath = System.IO.Path.Combine(Environment.CurrentDirectory, filename);
this._workBook = _excelWorkbooks.Open(refFilePath, 0, true, 5, "", "", false, XlPlatform.xlWindows, "", false, false, 0, false, false, false);
this.InitNameFields();
@@ -37,7 +42,7 @@ namespace ENI2.Excel
#region public methods
- public void WriteData(List messages, MessageCore core, out string resultMessage)
+ public void WriteData(List messages, MessageCore core, out string resultMessage, bool isRefSheet)
{
resultMessage = "";
@@ -78,10 +83,10 @@ namespace ENI2.Excel
}
break;
case Message.NotificationClass.CREW:
- this.WriteCREW(message, true);
+ this.WriteCREW(message, true, isRefSheet);
break;
case Message.NotificationClass.CREWD:
- this.WriteCREW(message, false);
+ this.WriteCREW(message, false, isRefSheet);
break;
case Message.NotificationClass.HAZA:
this.WriteHAZ(message, true);
@@ -93,11 +98,11 @@ namespace ENI2.Excel
if (message.Elements[0] is INFO info)
{
this.WriteMessage(info);
- this.WriteINFO(info);
+ this.WriteINFO(info, isRefSheet);
}
break;
case Message.NotificationClass.LADG:
- this.WriteLADG(message);
+ this.WriteLADG(message, isRefSheet);
break;
case Message.NotificationClass.MDH:
if (message.Elements[0] is MDH mdh)
@@ -110,13 +115,13 @@ namespace ENI2.Excel
if (message.Elements[0] is NAME name) this.WriteMessage(name);
break;
case Message.NotificationClass.NOA_NOD:
- if (message.Elements[0] is NOA_NOD noa_nod) this.WriteNOA_NOD(noa_nod, core.IsTransit);
+ if (message.Elements[0] is NOA_NOD noa_nod) this.WriteNOA_NOD(noa_nod, core.IsTransit, isRefSheet);
break;
case Message.NotificationClass.PAS:
- this.WritePAS(message, true);
+ this.WritePAS(message, true, isRefSheet);
break;
case Message.NotificationClass.PASD:
- this.WritePAS(message, false);
+ this.WritePAS(message, false, isRefSheet);
break;
case Message.NotificationClass.POBA:
if (message.Elements[0] is POBA poba) this.WriteMessage(poba);
@@ -133,7 +138,7 @@ namespace ENI2.Excel
break;
case Message.NotificationClass.SEC:
if (message.Elements[0] is SEC sec) this.WriteMessage(sec);
- this.WriteSEC(message);
+ this.WriteSEC(message, isRefSheet);
break;
case Message.NotificationClass.SERV:
this.WriteSERV(message);
@@ -142,7 +147,7 @@ namespace ENI2.Excel
if (message.Elements[0] is STAT stat)
{
this.WriteMessage(stat);
- WriteText("STAT.TransportMode", stat.TransportModeDisplay);
+ this.WriteSTAT(stat, isRefSheet);
}
break;
case Message.NotificationClass.STO:
@@ -163,14 +168,14 @@ namespace ENI2.Excel
}
break;
case Message.NotificationClass.TOWA:
- WriteTOWA(message);
+ WriteTOWA(message, isRefSheet);
break;
case Message.NotificationClass.TOWD:
- WriteTOWD(message);
+ WriteTOWD(message, isRefSheet);
break;
case Message.NotificationClass.WAS:
if (message.Elements[0] is WAS was) this.WriteMessage(was);
- WriteWAS(message);
+ WriteWAS(message, isRefSheet);
break;
case Message.NotificationClass.WAS_RCPT:
WriteWAS_RCPT(message);
@@ -275,7 +280,7 @@ namespace ENI2.Excel
#region LADG
- private void WriteLADG(Message ladgMessage)
+ private void WriteLADG(Message ladgMessage, bool isRefSheet)
{
for (int i = 0; i < Math.Min(ladgMessage.NumberOfExcelRows, ladgMessage.Elements.Count); i++)
{
@@ -300,12 +305,20 @@ namespace ENI2.Excel
}
}
- WriteText(lnType, ladg.CargoCodeNST);
+ if (isRefSheet)
+ {
+ WriteText(lnType, ladg.CargoCodeNST);
+ }
+ else
+ {
+ if (ReportDocument.cargoCodesNST.TryGetValue(ladg.CargoCodeNST, out string cargoCode))
+ WriteText(lnType, cargoCode);
+ }
WriteText(lnZusatz, ladg.CargoCodeNST_3);
WriteNumber(lnCNOI, ladg.CargoNumberOfItems);
WriteNumber(lnCGQ, ladg.CargoGrossQuantity_TNE);
- WriteText(lnLoad, ladg.PortOfLoading);
- WriteText(lnDis, ladg.PortOfDischarge);
+ WriteText(lnLoad, isRefSheet ? ladg.PortOfLoading : Locode.LocodeDB.LocationNameFromLocode(ladg.PortOfLoading));
+ WriteText(lnDis, isRefSheet ? ladg.PortOfDischarge : Locode.LocodeDB.LocationNameFromLocode(ladg.PortOfDischarge));
WriteNumber(lnLACode, ladg.CargoLACode);
}
}
@@ -369,7 +382,7 @@ namespace ENI2.Excel
#region CREW
- private void WriteCREW(Message crewMessage, bool isArrival)
+ private void WriteCREW(Message crewMessage, bool isArrival, bool isRefSheet)
{
if (crewMessage.Elements.Count > 0)
@@ -408,8 +421,25 @@ namespace ENI2.Excel
WriteText(crewIdentDocType, crew.CrewMemberIdentityDocumentTypeDisplay);
WriteText(crewIdentDocId, crew.CrewMemberIdentityDocumentId);
WriteText(crewVisaNo, crew.CrewMemberVisaNumber);
- WriteText(crewIssuingState, crew.CrewMemberIdentityDocumentIssuingState);
- WriteDate(crewExpiry, crew.CrewMemberIdentityDocumentExpiryDate);
+ if (isRefSheet)
+ {
+ WriteText(crewIssuingState, crew.CrewMemberIdentityDocumentIssuingState);
+ }
+ else
+ {
+ if(!crew.CrewMemberIdentityDocumentIssuingState.Equals("XX"))
+ WriteText(crewIssuingState, crew.CrewMemberIdentityDocumentIssuingState);
+ }
+ if(isRefSheet)
+ {
+ WriteDate(crewExpiry, crew.CrewMemberIdentityDocumentExpiryDate);
+ }
+ else
+ {
+ if(crew.CrewMemberIdentityDocumentExpiryDate != new DateTime(2100, 12, 31))
+ WriteDate(crewExpiry, crew.CrewMemberIdentityDocumentExpiryDate);
+ }
+
WriteText(crewCountry, crew.CrewMemberCountryOfBirth);
if (isArrival)
WriteText(effects, crew.Effects);
@@ -701,7 +731,7 @@ namespace ENI2.Excel
#region NOA_NOD
- private void WriteNOA_NOD(NOA_NOD noa_nod, bool isTransit)
+ private void WriteNOA_NOD(NOA_NOD noa_nod, bool isTransit, bool isRefSheet)
{
if(noa_nod.ETAToPortOfCall.HasValue)
{
@@ -735,8 +765,8 @@ namespace ENI2.Excel
}
}
- WriteText("NOA_NOD.LastPort", noa_nod.LastPort);
- WriteText("NOA_NOD.NextPort", noa_nod.NextPort);
+ WriteText("NOA_NOD.LastPort", isRefSheet ? noa_nod.LastPort : Locode.LocodeDB.LocationNameFromLocode(noa_nod.LastPort));
+ WriteText("NOA_NOD.NextPort", isRefSheet ? noa_nod.NextPort : Locode.LocodeDB.LocationNameFromLocode(noa_nod.NextPort));
if(noa_nod.ETDFromLastPort.HasValue)
{
@@ -758,7 +788,7 @@ namespace ENI2.Excel
#region PAS
- private void WritePAS(Message pasMessage, bool isArrival)
+ private void WritePAS(Message pasMessage, bool isArrival, bool isRefSheet)
{
if(pasMessage.Elements.Count > 0)
{
@@ -801,8 +831,24 @@ namespace ENI2.Excel
WriteText(pasIdentDocType, pas.PassengerIdentityDocumentTypeDisplay);
WriteText(pasIdentDocId, pas.PassengerIdentityDocumentId);
WriteText(pasVisaNo, pas.PassengerVisaNumber);
- WriteText(pasIssuing, pas.PassengerIdentityDocumentIssuingState);
- WriteDate(pasExpiry, pas.PassengerIdentityDocumentExpiryDate);
+ if (isRefSheet)
+ {
+ WriteText(pasIssuing, pas.PassengerIdentityDocumentIssuingState);
+ }
+ else
+ {
+ if(!pas.PassengerIdentityDocumentIssuingState.Equals("XX"))
+ WriteText(pasIssuing, pas.PassengerIdentityDocumentIssuingState);
+ }
+ if (isRefSheet)
+ {
+ WriteDate(pasExpiry, pas.PassengerIdentityDocumentExpiryDate);
+ }
+ else
+ {
+ if (pas.PassengerIdentityDocumentExpiryDate != new DateTime(2100, 12, 31))
+ WriteDate(pasExpiry, pas.PassengerIdentityDocumentExpiryDate);
+ }
WriteText(pasCountry, pas.PassengerCountryOfBirth);
WriteText(pasEmergencyCare, pas.EmergencyCare);
WriteText(pasEmergencyContact, pas.EmergencyContactNumber);
@@ -813,7 +859,7 @@ namespace ENI2.Excel
#region SEC
- private void WriteSEC(Message secMessage)
+ private void WriteSEC(Message secMessage, bool isRefSheet)
{
if (secMessage.Elements.Count == 0) return;
SEC sec = secMessage.Elements[0] as SEC;
@@ -904,9 +950,18 @@ namespace ENI2.Excel
WriteDate(s2sToDate, s2s.ShipToShipActivityDateTo.Value);
WriteText(s2sSec, s2s.ShipToShipActivitySecurityMattersToReport);
if (s2s.ShipToShipActivityTypeCode.HasValue)
- WriteText(s2sActivityString, s2s.ShipToShipActivityTypeCode.Value.ToString());
+ {
+ if (isRefSheet)
+ {
+ WriteText(s2sActivityString, s2s.ShipToShipActivityTypeCode.Value.ToString());
+ }
+ else
+ {
+ if (GlobalStructures.Edifact8025.TryGetValue(s2s.ShipToShipActivityTypeCode.Value, out string code))
+ WriteText(s2sActivityString, code);
+ }
+ }
}
-
}
#endregion
@@ -951,7 +1006,7 @@ namespace ENI2.Excel
#region TOWA
- private void WriteTOWA(Message towaMessage)
+ private void WriteTOWA(Message towaMessage, bool isRefSheet)
{
for(int i = 0; i < Math.Min(towaMessage.Elements.Count, towaMessage.NumberOfExcelRows); i++)
{
@@ -967,7 +1022,16 @@ namespace ENI2.Excel
TOWA towa = towaMessage.Elements[i] as TOWA;
WriteText(tName, towa.TowageOnArrivalName);
- WriteText(tFlag, towa.TowageOnArrivalFlag);
+ if(isRefSheet)
+ {
+ WriteText(tFlag, towa.TowageOnArrivalFlag);
+ }
+ else
+ {
+ if(CREW.NationalityDict.TryGetValue(towa.TowageOnArrivalFlag, out string country))
+ WriteText(tFlag, country.Substring(3));
+ }
+
WriteText(tPoC, towa.TowageOnArrivalPurposeOfCall);
if (towa.TowageOnArrivalDraught_DMT.HasValue)
WriteNumber(tDraft, towa.TowageOnArrivalDraught_DMT.Value);
@@ -985,9 +1049,9 @@ namespace ENI2.Excel
#region TOWD
- private void WriteTOWD(Message towdMessage)
+ private void WriteTOWD(Message towdMessage, bool isRefSheet)
{
- for(int i = 0; i < Math.Min(towdMessage.Elements.Count, towdMessage.NumberOfExcelRows); i++)
+ for (int i = 0; i < Math.Min(towdMessage.Elements.Count, towdMessage.NumberOfExcelRows); i++)
{
string tName = string.Format("TOWD.TowageOnDepartureName_{0}", i + 1);
string tFlag = string.Format("TOWD.TowageOnDepartureFlag_{0}", i + 1);
@@ -1000,7 +1064,15 @@ namespace ENI2.Excel
TOWD towd = towdMessage.Elements[i] as TOWD;
WriteText(tName, towd.TowageOnDepartureName);
- WriteText(tFlag, towd.TowageOnDepartureFlag);
+ if (isRefSheet)
+ {
+ WriteText(tFlag, towd.TowageOnDepartureFlag);
+ }
+ else
+ {
+ if (CREW.NationalityDict.TryGetValue(towd.TowageOnDepartureFlag, out string country))
+ WriteText(tFlag, country.Substring(3));
+ }
if (towd.TowageOnDepartureDraught_DMT.HasValue)
WriteNumber(tDraft, towd.TowageOnDepartureDraught_DMT.Value);
if (towd.TowageOnDepartureLengthOverall_MTR.HasValue)
@@ -1016,7 +1088,7 @@ namespace ENI2.Excel
#region WAS
- private void WriteWAS(Message wasMessage)
+ private void WriteWAS(Message wasMessage, bool isRefSheet)
{
if (wasMessage.Elements.Count == 0) return;
WAS was = wasMessage.Elements[0] as WAS;
@@ -1064,7 +1136,7 @@ namespace ENI2.Excel
WriteNumber(wasteCapacity, waste.WasteCapacity_MTQ.Value);
if (waste.WasteAmountRetained_MTQ.HasValue)
WriteNumber(wasteRetained, waste.WasteAmountRetained_MTQ.Value);
- WriteText(wastePort, waste.WasteDisposalPort);
+ WriteText(wastePort, isRefSheet ? waste.WasteDisposalPort : Locode.LocodeDB.LocationNameFromLocode(waste.WasteDisposalPort));
if (waste.WasteAmountGeneratedTillNextPort_MTQ.HasValue)
WriteNumber(amountGen, waste.WasteAmountGeneratedTillNextPort_MTQ.Value);
}
@@ -1115,7 +1187,7 @@ namespace ENI2.Excel
#region INFO
- private void WriteINFO(INFO info)
+ private void WriteINFO(INFO info, bool isRefSheet)
{
if (info != null)
{
@@ -1130,6 +1202,46 @@ namespace ENI2.Excel
case 2: this.WriteText("INFO.ShippingArea", "OVERSEAS"); break;
}
}
+
+ if(isRefSheet)
+ {
+ WriteText("INFO.PortArea", info.PortArea);
+ }
+ else
+ {
+ WriteText("INFO.PortArea", LocalizedLookup.GetPortAreaFromCode(info.PortArea));
+ }
+ }
+ }
+
+ #endregion
+
+ #region STAT
+
+ private void WriteSTAT(STAT stat, bool isRefSheet)
+ {
+ if (stat != null)
+ {
+ WriteText("STAT.PortOfRegistry", isRefSheet ? stat.PortOfRegistry : Locode.LocodeDB.LocationNameFromLocode(stat.PortOfRegistry));
+ WriteText("STAT.TransportMode", stat.TransportModeDisplay);
+ if(isRefSheet)
+ {
+ WriteText("STAT.Flag", stat.Flag);
+ }
+ else
+ {
+ if (CREW.NationalityDict.TryGetValue(stat.Flag, out string country))
+ WriteText("STAT.Flag", country.Substring(3));
+ }
+ if(isRefSheet)
+ {
+ WriteText("STAT.ShipType", stat.ShipType);
+ }
+ else
+ {
+ if (LocalizedLookup.getVesselTypes().TryGetValue(stat.ShipType, out string shipType))
+ WriteText("STAT.ShipType", shipType);
+ }
}
}
@@ -1172,9 +1284,10 @@ namespace ENI2.Excel
{
if(gender.HasValue)
{
- if (gender == 0) WriteText(label, "m");
- if (gender == 1) WriteText(label, "w");
- if (gender == 2) WriteText(label, "d");
+ if (gender == 0) WriteText(label, "?");
+ if (gender == 1) WriteText(label, "m");
+ if (gender == 2) WriteText(label, "f");
+ if (gender == 9) WriteText(label, "d");
}
}
diff --git a/ENI2/Properties/Resources.Designer.cs b/ENI2/Properties/Resources.Designer.cs
index 8207b8d4..e4e27983 100644
--- a/ENI2/Properties/Resources.Designer.cs
+++ b/ENI2/Properties/Resources.Designer.cs
@@ -3316,6 +3316,15 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to not applicable.
+ ///
+ public static string textNotApplicable {
+ get {
+ return ResourceManager.GetString("textNotApplicable", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Notification class.
///
@@ -3361,6 +3370,15 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to not known.
+ ///
+ public static string textNotKnown {
+ get {
+ return ResourceManager.GetString("textNotKnown", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Number of deaths.
///
diff --git a/ENI2/Properties/Resources.resx b/ENI2/Properties/Resources.resx
index 27574f93..87bd0449 100644
--- a/ENI2/Properties/Resources.resx
+++ b/ENI2/Properties/Resources.resx
@@ -1831,4 +1831,10 @@
Pas
+
+ not applicable
+
+
+ not known
+
\ No newline at end of file
diff --git a/ENI2/Report/ReportDocument.cs b/ENI2/Report/ReportDocument.cs
index 38ab0263..12500578 100644
--- a/ENI2/Report/ReportDocument.cs
+++ b/ENI2/Report/ReportDocument.cs
@@ -31,9 +31,9 @@ namespace ENI2.Report
#region static lookup helpers
- private static Dictionary _cargoCodesNST = null;
+ private static Dictionary _cargoCodesNST = null;
- private static Dictionary cargoCodesNST
+ public static Dictionary cargoCodesNST
{
get
{
diff --git a/ENI2/Util/GlobalStructures.cs b/ENI2/Util/GlobalStructures.cs
index ffd32850..6f2b6e82 100644
--- a/ENI2/Util/GlobalStructures.cs
+++ b/ENI2/Util/GlobalStructures.cs
@@ -16,9 +16,10 @@ namespace ENI2.Util
public static string[] GenderList =
{
+ Properties.Resources.textNotKnown,
Properties.Resources.textMale,
Properties.Resources.textFemale,
- Properties.Resources.textOther
+ Properties.Resources.textNotApplicable
};
public static string[] IDDocTypeList =
@@ -167,16 +168,21 @@ namespace ENI2.Util
if (val != null)
{
if (val.Equals("m", StringComparison.CurrentCultureIgnoreCase) || val.Equals("male", StringComparison.CurrentCultureIgnoreCase))
- {
- result = 0;
+ {
+ result = 1;
}
else if (val.Equals("f", StringComparison.CurrentCultureIgnoreCase) || val.Equals("female", StringComparison.CurrentCultureIgnoreCase))
- {
- result = 1;
+ {
+ result = 2;
+ }
+ else if (val.Equals("d", StringComparison.CurrentCultureIgnoreCase) || val.Equals("diverse", StringComparison.CurrentCultureIgnoreCase) ||
+ val.Equals("n", StringComparison.CurrentCultureIgnoreCase) || val.Equals("not applicable", StringComparison.CurrentCultureIgnoreCase))
+ {
+ result = 9;
}
else
{
- result = 2;
+ result = 0;
}
}
return result;
diff --git a/bsmd.ExcelReadService/LocodeDB.cs b/bsmd.ExcelReadService/LocodeDB.cs
index 03c5d997..e5b18201 100644
--- a/bsmd.ExcelReadService/LocodeDB.cs
+++ b/bsmd.ExcelReadService/LocodeDB.cs
@@ -229,7 +229,6 @@ namespace ENI2.Locode
return result;
}
-
public static void CloseDB()
{
_con.Close();
diff --git a/bsmd.database/Util.cs b/bsmd.database/Util.cs
index be1b37ba..34b9c511 100644
--- a/bsmd.database/Util.cs
+++ b/bsmd.database/Util.cs
@@ -40,14 +40,15 @@ namespace bsmd.database
{
switch (val)
{
- case 0: return "Male";
- case 1: return "Female";
- default: return "Other";
+ case 0: return "not known";
+ case 1: return "male";
+ case 2: return "female";
+ default: return "not applicable";
}
}
else
{
- return "Unknown";
+ return "unknown";
}
}
diff --git a/misc/EU-NoAD-Data-Collecting-Tool-5_0.xlsx b/misc/EU-NoAD-Data-Collecting-Tool-5_0.xlsx
new file mode 100644
index 00000000..1e4d116f
Binary files /dev/null and b/misc/EU-NoAD-Data-Collecting-Tool-5_0.xlsx differ