diff --git a/ENI-2/ENI2/ENI2/Controls/ServerStatusControl.xaml b/ENI-2/ENI2/ENI2/Controls/ServerStatusControl.xaml
index f9fad8bc..b803dca1 100644
--- a/ENI-2/ENI2/ENI2/Controls/ServerStatusControl.xaml
+++ b/ENI-2/ENI2/ENI2/Controls/ServerStatusControl.xaml
@@ -22,6 +22,7 @@
+
guidIdDict = new Dictionary();
@@ -118,8 +119,20 @@ namespace ENI2.Controls
return result;
}
+ public static void ClearIds() { guidIdDict.Clear(); }
+
+ public int CompareTo(object obj)
+ {
+ if(obj is StatusEntry)
+ return -(Timestamp.CompareTo(((StatusEntry)obj).Timestamp));
+ return 0;
+ }
}
+ private void refreshButton_Click(object sender, System.Windows.RoutedEventArgs e)
+ {
+ StatusEntry.ClearIds();
+ }
}
}
diff --git a/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs
index d31947a9..cefa1e7c 100644
--- a/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs
+++ b/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs
@@ -390,53 +390,56 @@ namespace ENI2
}
// NOA_NOD vor ATA vor ATD Versendereihenfolge sicherstellen
- bool noa_nod_queued_or_sent = false;
- bool ata_queued_or_sent = false;
- foreach(Message aMessage in this._messages)
+ if ((this.Core.InitialHIS == Message.NSWProvider.DUDR) || (this.Core.InitialHIS == Message.NSWProvider.DUDR_TEST))
{
- if(aMessage.MessageNotificationClass == Message.NotificationClass.NOA_NOD)
+ bool noa_nod_queued_or_sent = false;
+ bool ata_queued_or_sent = false;
+ foreach (Message aMessage in this._messages)
{
- if ((aMessage.SendSuccess ?? false) || (aMessage.InternalStatus == Message.BSMDStatus.TOSEND))
- noa_nod_queued_or_sent = true;
- }
- if (aMessage.MessageNotificationClass == Message.NotificationClass.ATA)
- {
- if ((aMessage.SendSuccess ?? false) || (aMessage.InternalStatus == Message.BSMDStatus.TOSEND))
- ata_queued_or_sent = true;
- }
- }
-
- foreach(Message aMessage in this._messages)
- {
- if((aMessage.MessageNotificationClass == Message.NotificationClass.ATA) && (aMessage.InternalStatus == Message.BSMDStatus.TOSEND))
- {
- if(!noa_nod_queued_or_sent)
+ if (aMessage.MessageNotificationClass == Message.NotificationClass.NOA_NOD)
{
- aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED;
- aMessage.ChangedBy = "";
- aMessage.StatusInfo = string.Format("Validation error: NOA_NOD must be sent before ATA");
- DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage);
+ if ((aMessage.SendSuccess ?? false) || (aMessage.InternalStatus == Message.BSMDStatus.TOSEND))
+ noa_nod_queued_or_sent = true;
+ }
+ if (aMessage.MessageNotificationClass == Message.NotificationClass.ATA)
+ {
+ if ((aMessage.SendSuccess ?? false) || (aMessage.InternalStatus == Message.BSMDStatus.TOSEND))
+ ata_queued_or_sent = true;
}
}
- if ((aMessage.MessageNotificationClass == Message.NotificationClass.ATD) && (aMessage.InternalStatus == Message.BSMDStatus.TOSEND))
+ foreach (Message aMessage in this._messages)
{
- if (!noa_nod_queued_or_sent)
+ if ((aMessage.MessageNotificationClass == Message.NotificationClass.ATA) && (aMessage.InternalStatus == Message.BSMDStatus.TOSEND))
{
- aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED;
- aMessage.ChangedBy = "";
- aMessage.StatusInfo = string.Format("Validation error: NOA_NOD must be sent before ATD");
- DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage);
+ if (!noa_nod_queued_or_sent)
+ {
+ aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED;
+ aMessage.ChangedBy = "";
+ aMessage.StatusInfo = string.Format("Validation error: NOA_NOD must be sent before ATA");
+ DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage);
+ }
}
- if(!ata_queued_or_sent)
+ if ((aMessage.MessageNotificationClass == Message.NotificationClass.ATD) && (aMessage.InternalStatus == Message.BSMDStatus.TOSEND))
{
- aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED;
- aMessage.ChangedBy = "";
- aMessage.StatusInfo = string.Format("Validation error: ATA must be sent before ATD");
- DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage);
+ if (!noa_nod_queued_or_sent)
+ {
+ aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED;
+ aMessage.ChangedBy = "";
+ aMessage.StatusInfo = string.Format("Validation error: NOA_NOD must be sent before ATD");
+ DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage);
+ }
+
+ if (!ata_queued_or_sent)
+ {
+ aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED;
+ aMessage.ChangedBy = "";
+ aMessage.StatusInfo = string.Format("Validation error: ATA must be sent before ATD");
+ DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage);
+ }
}
- }
+ }
}
}
diff --git a/ENI-2/ENI2/ENI2/ENI2.csproj b/ENI-2/ENI2/ENI2/ENI2.csproj
index d1bb6154..19fdf730 100644
--- a/ENI-2/ENI2/ENI2/ENI2.csproj
+++ b/ENI-2/ENI2/ENI2/ENI2.csproj
@@ -36,7 +36,7 @@
true
publish.html
1
- 3.9.0.%2a
+ 3.9.2.%2a
false
true
true
diff --git a/ENI-2/ENI2/ENI2/Util/DatabaseEntityWatchdog.cs b/ENI-2/ENI2/ENI2/Util/DatabaseEntityWatchdog.cs
index ab97923c..525bfc66 100644
--- a/ENI-2/ENI2/ENI2/Util/DatabaseEntityWatchdog.cs
+++ b/ENI-2/ENI2/ENI2/Util/DatabaseEntityWatchdog.cs
@@ -49,18 +49,24 @@ namespace ENI2.Util
if(entity.IsTransit)
{
- if ((!watchedEntity.TransitId.IsNullOrEmpty()) && !entity.TransitId.Equals(watchedEntity.TransitId))
+ if (!entity.TransitId.IsNullOrEmpty())
{
- OnVisitTransitIdUpdated(entity);
- watchedEntity.TransitId = entity.TransitId;
+ if ((watchedEntity.TransitId.IsNullOrEmpty()) && !entity.TransitId.Equals(watchedEntity.TransitId))
+ {
+ OnVisitTransitIdUpdated(entity);
+ watchedEntity.TransitId = entity.TransitId;
+ }
}
}
else
{
- if ((!watchedEntity.VisitId.IsNullOrEmpty()) && !entity.VisitId.Equals(watchedEntity.VisitId))
+ if (!entity.VisitId.IsNullOrEmpty())
{
- OnVisitTransitIdUpdated(entity);
- watchedEntity.VisitId = entity.VisitId;
+ if ((watchedEntity.VisitId.IsNullOrEmpty()) && !entity.VisitId.Equals(watchedEntity.VisitId))
+ {
+ OnVisitTransitIdUpdated(entity);
+ watchedEntity.VisitId = entity.VisitId;
+ }
}
}
diff --git a/Stundensheet.xlsx b/Stundensheet.xlsx
index 19a97822..7473be4b 100644
Binary files a/Stundensheet.xlsx and b/Stundensheet.xlsx differ
diff --git a/nsw/Source/bsmd.ReportGenerator/BSMDDocument.cs b/nsw/Source/bsmd.ReportGenerator/BSMDDocument.cs
index b875f87d..783e02ee 100644
--- a/nsw/Source/bsmd.ReportGenerator/BSMDDocument.cs
+++ b/nsw/Source/bsmd.ReportGenerator/BSMDDocument.cs
@@ -472,13 +472,13 @@ namespace bsmd.ReportGenerator
#endregion
#region LADG
-
+ /*
if((message != null) && (message.MessageNotificationClass == Message.NotificationClass.LADG))
{
BSMDDocument.CreateLADGTable(document, message);
return;
}
-
+ */
#endregion
if (messageParagraph.MessageText != null) // komplette Nachricht (z.B. STAT)
@@ -661,19 +661,19 @@ namespace bsmd.ReportGenerator
table.Borders.Visible = true;
Column column = table.AddColumn();
- column.Width = Unit.FromCentimeter(1);
+ column.Width = Unit.FromCentimeter(0.8);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(2);
column = table.AddColumn();
- column.Width = Unit.FromCentimeter(2);
+ column.Width = Unit.FromCentimeter(3);
column = table.AddColumn();
- column.Width = Unit.FromCentimeter(2);
+ column.Width = Unit.FromCentimeter(1.2);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(9);
Row hRow = table.AddRow();
- hRow.Cells[1].AddParagraph("LoCode");
+ hRow.Cells[1].AddParagraph("Port");
hRow.Cells[2].AddParagraph("Date of departure");
hRow.Cells[3].AddParagraph("Crew members joined");
hRow.Cells[4].AddParagraph("Names of joining crew");
@@ -681,19 +681,19 @@ namespace bsmd.ReportGenerator
for (int i = 0; i < mdh.PortOfCallLast30Days.Count; i++)
{
Row row = table.AddRow();
- BSMDDocument.SetPoCLast30Days((i + 1), ((PortOfCallLast30Days) mdh.PortOfCallLast30Days[i]), row);
+ BSMDDocument.SetPoCLast30Days(((PortOfCallLast30Days) mdh.PortOfCallLast30Days[i]), row);
}
}
}
- private static void SetPoCLast30Days(int p, PortOfCallLast30Days portOfCallLast30Days, Row row)
+ private static void SetPoCLast30Days(PortOfCallLast30Days portOfCallLast30Days, Row row)
{
- row.Cells[0].AddParagraph(p.ToString());
+ row.Cells[0].AddParagraph(portOfCallLast30Days.Identifier);
row.Cells[1].AddParagraph(portOfCallLast30Days.PortOfCallLast30DaysLocode ?? "");
row.Cells[2].AddParagraph(portOfCallLast30Days.PortOfCallLast30DaysDateOfDeparture.HasValue ?
portOfCallLast30Days.PortOfCallLast30DaysDateOfDeparture.Value.ToShortDateString() : "");
row.Cells[3].AddParagraph(portOfCallLast30Days.PortOfCallLast30DaysCrewMembersJoined.HasValue ?
- portOfCallLast30Days.PortOfCallLast30DaysCrewMembersJoined.Value ? "True" : "False" : "");
+ portOfCallLast30Days.PortOfCallLast30DaysCrewMembersJoined.Value ? "Yes" : "No" : "");
for (int i = 0; i < portOfCallLast30Days.CrewJoinedShip.Count; i++)
{
row.Cells[4].AddParagraph(portOfCallLast30Days.CrewJoinedShip[i].PortOfCallLast30DaysCrewJoinedShipName ?? "");
@@ -888,8 +888,8 @@ namespace bsmd.ReportGenerator
row.Cells[0].AddParagraph("Valid exemption?");
row.Cells[1].AddParagraph("Confirmation of correctness");
row = table.AddRow();
- row.Cells[0].AddParagraph(was.WasteDisposalValidExemption ?? false ? "YES" : "NO");
- row.Cells[1].AddParagraph(was.ConfirmationOfCorrectness ?? false ? "YES" : "NO");
+ row.Cells[0].AddParagraph(was.WasteDisposalValidExemption ?? false ? "Yes" : "No");
+ row.Cells[1].AddParagraph(was.ConfirmationOfCorrectness ?? false ? "Yes" : "No");
row = table.AddRow();
row.Cells[0].AddParagraph("Last port where waste or cargo residues were discharged");
@@ -897,7 +897,7 @@ namespace bsmd.ReportGenerator
row = table.AddRow();
row.Cells[0].AddParagraph(was.LastWasteDisposalPort ?? "");
if(was.LastWasteDisposalDate.HasValue)
- row.Cells[1].AddParagraph(was.LastWasteDisposalDate.ToString());
+ row.Cells[1].AddParagraph(was.LastWasteDisposalDate?.ToShortDateString());
row = table.AddRow();
row.Cells[0].AddParagraph("Name of waste disposal service provider");
row.Cells[1].AddParagraph("Waste disposal order (all, some, none)");
@@ -935,40 +935,61 @@ namespace bsmd.ReportGenerator
row.Cells[6].AddParagraph("Estimated waste/cargo residues amount generated between port of call and next port");
row = table.AddRow();
- row.Cells[0].AddParagraph("1 Oil Sludge");
- GetWasteForIndex(1, was, row);
+ row.Cells[0].AddParagraph("1100 Oily residues (sludge)");
+ GetWasteForIndex(1100, was, row);
row = table.AddRow();
- row.Cells[0].AddParagraph("2 Oil Bilgewater");
- GetWasteForIndex(2, was, row);
+ row.Cells[0].AddParagraph("1200 Oily bilge water");
+ GetWasteForIndex(1200, was, row);
row = table.AddRow();
- row.Cells[0].AddParagraph("3 Oil other");
- GetWasteForIndex(3, was, row);
+ row.Cells[0].AddParagraph("1300 Waste oil - others");
+ GetWasteForIndex(1300, was, row);
row = table.AddRow();
- row.Cells[0].AddParagraph("4 Garbage Foodwaste");
- GetWasteForIndex(4, was, row);
+ row.Cells[0].AddParagraph("2100 Food waste");
+ GetWasteForIndex(2100, was, row);
row = table.AddRow();
- row.Cells[0].AddParagraph("5 Garbage plastic");
- GetWasteForIndex(5, was, row);
+ row.Cells[0].AddParagraph("2200 Plastic");
+ GetWasteForIndex(2200, was, row);
row = table.AddRow();
- row.Cells[0].AddParagraph("6 Garbage other");
- GetWasteForIndex(6, was, row);
+ row.Cells[0].AddParagraph("2300 Domestic wastes");
+ GetWasteForIndex(2300, was, row);
row = table.AddRow();
- row.Cells[0].AddParagraph("7 Sewage");
- GetWasteForIndex(7, was, row);
+ row.Cells[0].AddParagraph("2311 Cooking oil");
+ GetWasteForIndex(2311, was, row);
row = table.AddRow();
- row.Cells[0].AddParagraph("8 Cargo associated waste");
- GetWasteForIndex(8, was, row);
+ row.Cells[0].AddParagraph("2308 Incinerator ashes");
+ GetWasteForIndex(2308, was, row);
row = table.AddRow();
- row.Cells[0].AddParagraph("9 Cargo residues");
- GetWasteForIndex(9, was, row);
+ row.Cells[0].AddParagraph("2600 Operational wastes");
+ GetWasteForIndex(2600, was, row);
+
+ row = table.AddRow();
+ row.Cells[0].AddParagraph("2309 Animal carcass(es)");
+ GetWasteForIndex(2309, was, row);
+
+ row = table.AddRow();
+ row.Cells[0].AddParagraph("3000 Sewage");
+ GetWasteForIndex(3000, was, row);
+
+ row = table.AddRow();
+ row.Cells[0].AddParagraph("5100 Cargo residues - Marpol Annex I");
+ GetWasteForIndex(5100, was, row);
+
+ row = table.AddRow();
+ row.Cells[0].AddParagraph("5200 Cargo residues - Marpol Annex II");
+ GetWasteForIndex(5200, was, row);
+
+ row = table.AddRow();
+ row.Cells[0].AddParagraph("5300 Cargo residues - Marpol Annex ");
+ GetWasteForIndex(5300, was, row);
+
}
private static void GetWasteForIndex(int index, WAS was, Row row)
@@ -1055,6 +1076,7 @@ namespace bsmd.ReportGenerator
/// Name des Felds (ohne Klassenname)
/// Aktueller Wert / Wert aus der DB
/// ggf. ersetzter Wert
+
private static string DatabaseEntity_ReportReplacer(string propertyName, string value)
{
@@ -1063,6 +1085,10 @@ namespace bsmd.ReportGenerator
string result = value;
+ // ACHTUNG! Die Name (propertyName) sind die bereits in report.db *ersetzten* Namen, d.h. ändert man dort
+ // wieder etwas funktioniert es ggf. hier nicht mehr. Das ist leider aufwändig zu ändern, man müsste die Report
+ // Erzeugung komplett umbauen
+
switch(propertyName)
{
case "PackageType":
@@ -1080,10 +1106,32 @@ namespace bsmd.ReportGenerator
}
}
break;
+ case "Ship Type":
+ if (LocalizedLookup.getVesselTypes().ContainsKey(value))
+ result = string.Format("{0} - {1}", value, LocalizedLookup.getVesselTypes()[value]);
+ break;
default:
break;
}
+ if(propertyName.Contains("flag", StringComparison.OrdinalIgnoreCase))
+ if (LocalizedLookup.getNationalities().ContainsKey(value))
+ result = LocalizedLookup.getNationalities()[value];
+
+ if(propertyName.Contains("port", StringComparison.OrdinalIgnoreCase))
+ {
+ string portName = LocodeDB.PortNameFromLocode(value);
+ if (!portName.IsNullOrEmpty())
+ {
+ result = string.Format("{0} - {1}", value, portName);
+ }
+ }
+
+ if (propertyName.Contains("nst2007", StringComparison.OrdinalIgnoreCase))
+ if (LocalizedLookup.getCargoCodesNST().ContainsKey(value))
+ result = LocalizedLookup.getCargoCodesNST()[value];
+
+
return result;
}
diff --git a/nsw/Source/bsmd.ReportGenerator/ReportService.cs b/nsw/Source/bsmd.ReportGenerator/ReportService.cs
index 323d93f2..8b53fe72 100644
--- a/nsw/Source/bsmd.ReportGenerator/ReportService.cs
+++ b/nsw/Source/bsmd.ReportGenerator/ReportService.cs
@@ -241,7 +241,8 @@ namespace bsmd.ReportGenerator
{
if (aMessage.InternalStatus == Message.BSMDStatus.REPORT)
{
- reportMessages.Add(aMessage);
+ if ((aMessage.MessageNotificationClass != Message.NotificationClass.VISIT) && (aMessage.MessageNotificationClass != Message.NotificationClass.TRANSIT))
+ reportMessages.Add(aMessage);
aMessage.InternalStatus = Message.BSMDStatus.PREPARE;
DBManager.Instance.Save(aMessage);
sb.Append(aMessage.MessageNotificationClassDisplay);
@@ -262,7 +263,7 @@ namespace bsmd.ReportGenerator
Dictionary coverInfos = new Dictionary();
coverInfos.Add("Ship", DBManager.Instance.GetShipNameFromCore(reportCore));
- coverInfos.Add("ETA", reportCore.ETA_NOA_NOD.ToString());
+ coverInfos.Add("ETA", reportCore.ETA_NOA_NOD.HasValue ? reportCore.ETA_NOA_NOD.Value.ToLocalTime().ToString() : "");
coverInfos.Add("Port of call", reportCore.Portname);
coverInfos.Add("Visit-ID", reportCore.DisplayId);
coverInfos.Add("Class", classes);
diff --git a/nsw/Source/bsmd.database/DatabaseEntity.cs b/nsw/Source/bsmd.database/DatabaseEntity.cs
index 34ceb540..1f00fe7c 100644
--- a/nsw/Source/bsmd.database/DatabaseEntity.cs
+++ b/nsw/Source/bsmd.database/DatabaseEntity.cs
@@ -314,6 +314,8 @@ namespace bsmd.database
public virtual string GetDisplayValue(PropertyInfo property)
{
bool isDouble = (property.PropertyType == typeof(Nullable));
+ bool isDateTime = (property.PropertyType == typeof(Nullable));
+
object propValue = property.GetValue(this, null);
if (propValue == null) return "";
string value = propValue.ToString();
@@ -321,6 +323,17 @@ namespace bsmd.database
{
value = ((double)propValue).ToString("N2");
}
+ else if(isDateTime)
+ {
+ if(Attribute.IsDefined(property, typeof(DateOnlyAttribute)))
+ {
+ value = ((DateTime)propValue).ToShortDateString();
+ }
+ else
+ {
+ value = ((DateTime)propValue).ToLocalTime().ToString(); // perform UTC-LocalTime Conversion
+ }
+ }
else
{
if(ReportReplacer != null)
diff --git a/nsw/Source/bsmd.database/Extensions.cs b/nsw/Source/bsmd.database/Extensions.cs
index ba3f819f..b80abc11 100644
--- a/nsw/Source/bsmd.database/Extensions.cs
+++ b/nsw/Source/bsmd.database/Extensions.cs
@@ -14,6 +14,7 @@ using System.Globalization;
using System.Text.RegularExpressions;
using log4net;
using System.Linq;
+using System.Collections;
namespace bsmd.database
{
@@ -152,5 +153,22 @@ namespace bsmd.database
return str.Substring(0, maxLen);
}
+ public static void BubbleSort(this IList o)
+ {
+ for (int i = o.Count - 1; i >= 0; i--)
+ {
+ for (int j = 1; j <= i; j++)
+ {
+ object o1 = o[j - 1];
+ object o2 = o[j];
+ if (((IComparable)o1).CompareTo(o2) > 0)
+ {
+ o.Remove(o1);
+ o.Insert(j, o1);
+ }
+ }
+ }
+ }
+
}
}
diff --git a/nsw/Source/bsmd.database/IBCPosition.cs b/nsw/Source/bsmd.database/IBCPosition.cs
index a7c6b406..71d31830 100644
--- a/nsw/Source/bsmd.database/IBCPosition.cs
+++ b/nsw/Source/bsmd.database/IBCPosition.cs
@@ -113,6 +113,7 @@ namespace bsmd.database
[ShowReport]
[MaxLength(11)]
[ENI2Validation]
+ [Validation(ValidationCode.DOT_NO_COMMA)]
public string Flashpoint_CEL { get; set; }
[ShowReport]
diff --git a/nsw/Source/bsmd.database/IMDGPosition.cs b/nsw/Source/bsmd.database/IMDGPosition.cs
index 165800dc..c6402f06 100644
--- a/nsw/Source/bsmd.database/IMDGPosition.cs
+++ b/nsw/Source/bsmd.database/IMDGPosition.cs
@@ -67,6 +67,7 @@ namespace bsmd.database
[ShowReport]
[MaxLength(10)]
[ENI2Validation]
+ [Validation(ValidationCode.DOT_NO_COMMA)]
public string Flashpoint_CEL { get; set; }
[ShowReport]
diff --git a/nsw/Source/bsmd.database/MARPOL_Annex_I_Position.cs b/nsw/Source/bsmd.database/MARPOL_Annex_I_Position.cs
index 16bd4a3e..b52c127e 100644
--- a/nsw/Source/bsmd.database/MARPOL_Annex_I_Position.cs
+++ b/nsw/Source/bsmd.database/MARPOL_Annex_I_Position.cs
@@ -51,6 +51,7 @@ namespace bsmd.database
[ShowReport]
[MaxLength(10)]
[ENI2Validation]
+ [Validation(ValidationCode.DOT_NO_COMMA)]
public string Flashpoint_CEL { get; set; }
[ShowReport]
diff --git a/nsw/Source/bsmd.database/MDH.cs b/nsw/Source/bsmd.database/MDH.cs
index b9d9560d..ed1aa35e 100644
--- a/nsw/Source/bsmd.database/MDH.cs
+++ b/nsw/Source/bsmd.database/MDH.cs
@@ -154,6 +154,7 @@ namespace bsmd.database
[ShowReport]
[LookupName("MDH.DateOfIssue")]
[ENI2Validation]
+ [DateOnly]
public DateTime? DateOfIssue { get; set; }
[ShowReport]
diff --git a/nsw/Source/bsmd.database/PRE72H.cs b/nsw/Source/bsmd.database/PRE72H.cs
index 778f3172..97d0f91b 100644
--- a/nsw/Source/bsmd.database/PRE72H.cs
+++ b/nsw/Source/bsmd.database/PRE72H.cs
@@ -66,6 +66,7 @@ namespace bsmd.database
[ShowReport]
[LookupName("PRE72H.DateOfLastExpandedInspection")]
[ENI2Validation]
+ [DateOnly]
public DateTime? DateOfLastExpandedInspection { get; set; }
[ShowReport]
diff --git a/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs b/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs
index ff5ba82a..a5a307a6 100644
--- a/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs
+++ b/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs
@@ -2,6 +2,6 @@
[assembly: AssemblyCompany("schick Informatik")]
[assembly: AssemblyProduct("BSMD NSW interface")]
-[assembly: AssemblyInformationalVersion("3.9.0")]
+[assembly: AssemblyInformationalVersion("3.9.2")]
[assembly: AssemblyCopyright("Copyright © 2014-2017 schick Informatik")]
[assembly: AssemblyTrademark("")]
\ No newline at end of file
diff --git a/nsw/Source/bsmd.database/Properties/AssemblyProjectInfo.cs b/nsw/Source/bsmd.database/Properties/AssemblyProjectInfo.cs
index 95f98a27..a026d89f 100644
--- a/nsw/Source/bsmd.database/Properties/AssemblyProjectInfo.cs
+++ b/nsw/Source/bsmd.database/Properties/AssemblyProjectInfo.cs
@@ -1,4 +1,4 @@
using System.Reflection;
-[assembly: AssemblyVersion("3.9.0.*")]
+[assembly: AssemblyVersion("3.9.2.*")]
diff --git a/nsw/Source/bsmd.database/RuleEngine.cs b/nsw/Source/bsmd.database/RuleEngine.cs
index af60e9c0..df779ec5 100644
--- a/nsw/Source/bsmd.database/RuleEngine.cs
+++ b/nsw/Source/bsmd.database/RuleEngine.cs
@@ -306,6 +306,22 @@ namespace bsmd.database
}
}
break;
+ case ValidationCode.DOT_NO_COMMA:
+ {
+ if(!value.IsNullOrEmpty() && (value.Contains(",")))
+ {
+ errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
+ }
+ break;
+ }
+ case ValidationCode.VESSEL_TYPE:
+ {
+ if((value.Length == 0) || ((STAT.VesselTypeDict != null) && !STAT.VesselTypeDict.ContainsKey(value)))
+ {
+ errors.Add(RuleEngine.CreateError(ValidationCode.NOT_NULL, property.Name, value, entity.Title, identifier, entity.Tablename));
+ }
+ break;
+ }
default:
break;
}
diff --git a/nsw/Source/bsmd.database/SEC.cs b/nsw/Source/bsmd.database/SEC.cs
index ecba4d2c..85fb65b2 100644
--- a/nsw/Source/bsmd.database/SEC.cs
+++ b/nsw/Source/bsmd.database/SEC.cs
@@ -113,6 +113,7 @@ namespace bsmd.database
[Validation2(ValidationCode.NOT_NULL)]
[LookupName("SEC.ISSCDateOfExpiration")]
[ENI2Validation]
+ [DateOnly]
public DateTime? ISSCDateOfExpiration { get; set; }
[ShowReport]
diff --git a/nsw/Source/bsmd.database/STAT.cs b/nsw/Source/bsmd.database/STAT.cs
index e51c43ed..65356634 100644
--- a/nsw/Source/bsmd.database/STAT.cs
+++ b/nsw/Source/bsmd.database/STAT.cs
@@ -102,7 +102,7 @@ namespace bsmd.database
}
[ShowReport]
- [Validation(ValidationCode.NOT_NULL)]
+ [Validation(ValidationCode.VESSEL_TYPE)]
[LookupName("STAT.ShipType")]
[MaxLength(5)]
[ENI2Validation]
diff --git a/nsw/Source/bsmd.database/ShowReportAttribute.cs b/nsw/Source/bsmd.database/ShowReportAttribute.cs
index 882f2fa5..5ce6f1ab 100644
--- a/nsw/Source/bsmd.database/ShowReportAttribute.cs
+++ b/nsw/Source/bsmd.database/ShowReportAttribute.cs
@@ -18,6 +18,12 @@ namespace bsmd.database
public ShowReportAttribute() { }
}
+ [AttributeUsage(AttributeTargets.Property)]
+ public class DateOnlyAttribute : Attribute
+ {
+ public DateOnlyAttribute() { }
+ }
+
[AttributeUsage(AttributeTargets.Property)]
public class ReportDisplayNameAttribute : Attribute
{
diff --git a/nsw/Source/bsmd.database/ValidationAttribute.cs b/nsw/Source/bsmd.database/ValidationAttribute.cs
index f6e4f17c..d8fbcd0d 100644
--- a/nsw/Source/bsmd.database/ValidationAttribute.cs
+++ b/nsw/Source/bsmd.database/ValidationAttribute.cs
@@ -34,6 +34,8 @@ namespace bsmd.database
IMPLAUSIBLE_ZZUKN,
LOCODE_NOPORT,
LOCODE_SSN,
+ DOT_NO_COMMA,
+ VESSEL_TYPE,
POSITION_COUNT = 22,
STRING_UNNUMBER = 23,
STRING_IMOCLASS = 24,
diff --git a/nsw/Source/bsmd.database/WAS.cs b/nsw/Source/bsmd.database/WAS.cs
index 6db8af81..90d564e9 100644
--- a/nsw/Source/bsmd.database/WAS.cs
+++ b/nsw/Source/bsmd.database/WAS.cs
@@ -48,7 +48,7 @@ namespace bsmd.database
public bool? WasteDisposalValidExemption { get; set; }
[ShowReport]
- [Validation2(ValidationCode.NOT_NULL)]
+ [Validation2(ValidationCode.LOCODE)]
[LookupName("WAS.LastWasteDisposalPort")]
[MaxLength(5)]
[ENI2Validation]
@@ -64,6 +64,7 @@ namespace bsmd.database
[Validation2(ValidationCode.NOT_NULL)]
[LookupName("WAS.LastWasteDisposalDate")]
[ENI2Validation]
+ [DateOnly]
public DateTime? LastWasteDisposalDate { get; set; }
[ShowReport]
diff --git a/nsw/Source/bsmd.hisnord/Request.cs b/nsw/Source/bsmd.hisnord/Request.cs
index b3814462..9b344e60 100644
--- a/nsw/Source/bsmd.hisnord/Request.cs
+++ b/nsw/Source/bsmd.hisnord/Request.cs
@@ -52,8 +52,9 @@ namespace bsmd.hisnord
if (theResult.code > 0)
{
- core.BSMDStatusInternal = MessageCore.BSMDStatus.FAILURE;
- DBManager.Instance.Save(core);
+ MessageCore reloadCore = DBManager.Instance.GetMessageCoreById(core.Id.Value);
+ reloadCore.BSMDStatusInternal = MessageCore.BSMDStatus.FAILURE;
+ DBManager.Instance.Save(reloadCore);
message.InternalStatus = Message.BSMDStatus.SEND_FAILED;
DBManager.Instance.Save(message);
@@ -734,7 +735,8 @@ namespace bsmd.hisnord
SERV serv = message.Elements[i] as SERV;
hn_serv.Service[i] = new service();
hn_serv.Service[i].ServiceBeneficiary = serv.ServiceBeneficiary;
- hn_serv.Service[i].ServiceName = serv.ServiceName;
+ if(!serv.ServiceName.IsNullOrEmpty())
+ hn_serv.Service[i].ServiceName = serv.ServiceName;
hn_serv.Service[i].ServiceInvoiceRecipient = serv.ServiceInvoiceRecipient;
}
@@ -1328,7 +1330,8 @@ namespace bsmd.hisnord
hn_pas.Passenger[i].PassengerPlaceOfBirth = pas.PassengerPlaceOfBirth;
hn_pas.Passenger[i].PassengerPortOfDisembarkation = pas.PassengerPortOfDisembarkation;
hn_pas.Passenger[i].PassengerPortOfEmbarkation = pas.PassengerPortOfEmbarkation;
- hn_pas.Passenger[i].PassengerVisaNumber = pas.PassengerVisaNumber;
+ if(!pas.PassengerVisaNumber.IsNullOrEmpty())
+ hn_pas.Passenger[i].PassengerVisaNumber = pas.PassengerVisaNumber;
}
items1ChoiceType.Add(Items1ChoiceType.PAS);
@@ -1524,16 +1527,23 @@ namespace bsmd.hisnord
{
AGNT agnt = message.Elements[0] as AGNT;
global::agnt hn_agnt = new global::agnt();
- hn_agnt.AgentCity = agnt.AgentCity;
+ if(!agnt.AgentCity.IsNullOrEmpty())
+ hn_agnt.AgentCity = agnt.AgentCity;
hn_agnt.AgentCompanyName = agnt.AgentCompanyName;
- hn_agnt.AgentCountry = agnt.AgentCountry;
- hn_agnt.AgentEMail = agnt.AgentEMail;
- hn_agnt.AgentFax = agnt.AgentFax;
- hn_agnt.AgentFirstName = agnt.AgentFirstName;
+ if(!agnt.AgentCountry.IsNullOrEmpty())
+ hn_agnt.AgentCountry = agnt.AgentCountry;
+ if(!agnt.AgentEMail.IsNullOrEmpty())
+ hn_agnt.AgentEMail = agnt.AgentEMail;
+ if(!agnt.AgentFax.IsNullOrEmpty())
+ hn_agnt.AgentFax = agnt.AgentFax;
+ if(!agnt.AgentFirstName.IsNullOrEmpty())
+ hn_agnt.AgentFirstName = agnt.AgentFirstName;
hn_agnt.AgentLastName = agnt.AgentLastName;
hn_agnt.AgentPhone = agnt.AgentPhone;
- hn_agnt.AgentPostalCode = agnt.AgentPostalCode;
- hn_agnt.AgentStreetAndNumber = agnt.AgentStreetAndNumber;
+ if(!agnt.AgentPostalCode.IsNullOrEmpty())
+ hn_agnt.AgentPostalCode = agnt.AgentPostalCode;
+ if(!agnt.AgentStreetAndNumber.IsNullOrEmpty())
+ hn_agnt.AgentStreetAndNumber = agnt.AgentStreetAndNumber;
items1ChoiceType.Add(Items1ChoiceType.AGNT);
items1.Add(hn_agnt);
}
diff --git a/nsw/Source/misc/report.db b/nsw/Source/misc/report.db
index 218453d6..4a19fd40 100644
Binary files a/nsw/Source/misc/report.db and b/nsw/Source/misc/report.db differ