diff --git a/REDIRECT.txt b/REDIRECT.txt
index b8d56360..0ffb9171 100644
--- a/REDIRECT.txt
+++ b/REDIRECT.txt
@@ -23,6 +23,8 @@ Im Proxy und backend web.config m
+Außerdem ganz wichtig! Im Backend-Server muss die Komprimierung deaktiviert werden, da sonst das outbound rewrite nicht funktioniert
+
Global rewrite rules are used to define server-wide URL rewriting logic. These rules are defined within applicationHost.config file and they cannot be overridden or disabled on any lower configuration levels, such as site or virtual directory. Global rules always operate on the absolute URL path (that is, requested URI without the server name). For example if a request was made to http://localhost/directory1/directory2/index.html, then the URL rewrite module will pass “directory1/directory2/index.html” as an input to a global rule.
diff --git a/Stundensheet.xlsx b/Stundensheet.xlsx
index 32d7c842..1c9643a7 100644
Binary files a/Stundensheet.xlsx and b/Stundensheet.xlsx differ
diff --git a/nsw/SLA NSW-Kernsystem und HIS.pdf b/nsw/SLA NSW-Kernsystem und HIS.pdf
new file mode 100644
index 00000000..a76dbac6
Binary files /dev/null and b/nsw/SLA NSW-Kernsystem und HIS.pdf differ
diff --git a/nsw/SLA NSW-Kernsystem und Organisation.pdf b/nsw/SLA NSW-Kernsystem und Organisation.pdf
new file mode 100644
index 00000000..9f942208
Binary files /dev/null and b/nsw/SLA NSW-Kernsystem und Organisation.pdf differ
diff --git a/nsw/Source/SQL/Update_1.5_To_1.6.sql b/nsw/Source/SQL/Update_1.5_To_1.6.sql
new file mode 100644
index 00000000..e97d3d34
--- /dev/null
+++ b/nsw/Source/SQL/Update_1.5_To_1.6.sql
@@ -0,0 +1,165 @@
+-- neue Tabellen für Gefahrgutanmeldung (jetzt doch!)
+
+CREATE TABLE [dbo].[HAZA]
+(
+ [Id] UNIQUEIDENTIFIER CONSTRAINT [DF_HAZA_Id] DEFAULT (newid()) ROWGUIDCOL NOT NULL,
+ [MessageHeaderId] UNIQUEIDENTIFIER NULL,
+ [NoDPGOnBoardOnArrival] BIT NULL,
+ [DPGManifestOnBoardOnArrival] BIT NULL,
+ [INFShipClass] TINYINT NULL,
+ [DPGClassificationIMDG] BIT NULL,
+ [DPGClassificationIGC] BIT NULL,
+ [DPGClassificationIBC] BIT NULL,
+ [DPGClassificationIMSBC] BIT NULL,
+ [DPGClassificationMARPOL_ANNEX_I] BIT NULL,
+ CONSTRAINT [PK_HAZA] PRIMARY KEY CLUSTERED ([Id] ASC),
+ CONSTRAINT [FK_HAZA_MessageHeader] FOREIGN KEY ([MessageHeaderId]) REFERENCES [dbo].[MessageHeader] ([Id])
+)
+
+GO
+
+CREATE TABLE [dbo].[HAZD]
+(
+ [Id] UNIQUEIDENTIFIER CONSTRAINT [DF_HAZD_Id] DEFAULT (newid()) ROWGUIDCOL NOT NULL,
+ [MessageHeaderId] UNIQUEIDENTIFIER NULL,
+ [NoDPGOnBoardOnDeparture] BIT NULL,
+ [DPGManifestOnBoardOnDeparture] BIT NULL,
+ [INFShipClass] TINYINT NULL,
+ [DPGClassificationIMDG] BIT NULL,
+ [DPGClassificationIGC] BIT NULL,
+ [DPGClassificationIBC] BIT NULL,
+ [DPGClassificationIMSBC] BIT NULL,
+ [DPGClassificationMARPOL_ANNEX_I] BIT NULL,
+ CONSTRAINT [PK_HAZD] PRIMARY KEY CLUSTERED ([Id] ASC),
+ CONSTRAINT [FK_HAZD_MessageHeader] FOREIGN KEY ([MessageHeaderId]) REFERENCES [dbo].[MessageHeader] ([Id])
+)
+
+GO
+
+CREATE TABLE [dbo].[IMDGPosition]
+(
+ [Id] UNIQUEIDENTIFIER CONSTRAINT [DF_IMDGPosition_Id] DEFAULT (newid()) ROWGUIDCOL NOT NULL,
+ [HAZId] UNIQUEIDENTIFIER NULL,
+ [UNNumber] NVARCHAR (10) NULL,
+ [PackingGroup] TINYINT NULL,
+ [ProperShippingName] NVARCHAR (255) NULL,
+ [IMOClass] NVARCHAR (10) NULL,
+ [CompatibilityGroup] NVARCHAR (10) NULL,
+ [TechnicalName] NVARCHAR (255) NULL,
+ [NetExplosiveMass_KGM] FLOAT (53) NULL,
+ [Flashpoint_CEL] NVARCHAR (10) NULL,
+ [Class7NuclideName] NVARCHAR (100) NULL,
+ [Class7MaxActivity_BQL] FLOAT (53) NULL,
+ [Class7Category] INT NULL,
+ [Class7TransportIndex] FLOAT (53) NULL,
+ [Class7CSI] INT NULL,
+ [ControlTemperature_CEL] FLOAT (53) NULL,
+ [EmergencyTemperature_CEL] FLOAT (53) NULL,
+ [MarinePollutant] BIT NULL,
+ [NumberOfPackages] INT NULL,
+ [PackageType] NVARCHAR (255) NULL,
+ [LimitedQuantities] BIT NULL,
+ [ExceptedQuantities] BIT NULL,
+ [NetQuantity_KGM] FLOAT (53) NULL,
+ [GrossQuantity_KGM] FLOAT (53) NULL,
+ [Volume_MTQ] FLOAT (53) NULL,
+ [GeneralCargoIBC] BIT NULL,
+ [ContainerNumber] NVARCHAR (24) NULL,
+ [VehicleLicenseNumber] NVARCHAR (24) NULL,
+ [StowagePosition] NVARCHAR (24) NULL,
+ [PortOfLoading] NCHAR(5) NULL,
+ [PortOfDischarge] NCHAR(5) NULL,
+ [Remarks] NVARCHAR (255) NULL,
+ [Identifier] NVARCHAR (40) NULL,
+ CONSTRAINT [PK_IMDGPosition] PRIMARY KEY CLUSTERED ([Id] ASC)
+)
+
+GO
+
+CREATE TABLE [dbo].[SubsidiaryRisks]
+(
+ [Id] UNIQUEIDENTIFIER CONSTRAINT [DF_SubsidiaryRisks_Id] DEFAULT (newid()) ROWGUIDCOL NOT NULL,
+ [IMDGPositionId] UNIQUEIDENTIFIER NULL,
+ [SubsidiaryRisk] NVARCHAR (11) NULL,
+ CONSTRAINT [PK_SubsidiaryRisks] PRIMARY KEY CLUSTERED ([Id] ASC)
+)
+
+GO
+
+CREATE TABLE [dbo].[IBCPosition]
+(
+ [Id] UNIQUEIDENTIFIER CONSTRAINT [DF_IBCPosition_Id] DEFAULT (newid()) ROWGUIDCOL NOT NULL,
+ [HAZId] UNIQUEIDENTIFIER NULL,
+ [ProductName] NVARCHAR (255) NULL,
+ [ProductCategory] TINYINT NULL,
+ [Hazards] TINYINT NULL,
+ [FlashpointInformation] TINYINT NULL,
+ [Flashpoint_CEL] NVARCHAR (11) NULL,
+ [Quantity_KGM] FLOAT (53) NULL,
+ [StowagePosition] NVARCHAR (24) NULL,
+ [PortOfLoading] NCHAR(5) NULL,
+ [PortOfDischarge] NCHAR(5) NULL,
+ [SpecRef15_19] BIT NULL,
+ [Remarks] NVARCHAR (255) NULL,
+ [Identifier] NVARCHAR (40) NULL,
+ CONSTRAINT [PK_IBCPosition] PRIMARY KEY CLUSTERED ([Id] ASC)
+)
+
+GO
+
+CREATE TABLE [dbo].[IGCPosition]
+(
+ [Id] UNIQUEIDENTIFIER CONSTRAINT [DF_IGCPosition_Id] DEFAULT (newid()) ROWGUIDCOL NOT NULL,
+ [HAZId] UNIQUEIDENTIFIER NULL,
+ [UNNumber] NVARCHAR (4) NULL,
+ [IMOClass] NVARCHAR (10) NULL,
+ [ProductName] NVARCHAR (255) NULL,
+ [Quantity_KGM] FLOAT (53) NULL,
+ [StowagePosition] NVARCHAR (24) NULL,
+ [PortOfLoading] NCHAR(5) NULL,
+ [PortOfDischarge] NCHAR(5) NULL,
+ [Remarks] NVARCHAR (255) NULL,
+ [Identifier] NVARCHAR (40) NULL,
+ CONSTRAINT [PK_IGCPosition] PRIMARY KEY CLUSTERED ([Id] ASC)
+)
+
+GO
+
+CREATE TABLE [dbo].[IMSBCPosition]
+(
+ [Id] UNIQUEIDENTIFIER CONSTRAINT [DF_IMSBCPosition_Id] DEFAULT (newid()) ROWGUIDCOL NOT NULL,
+ [HAZId] UNIQUEIDENTIFIER NULL,
+ [BulkCargoShippingName] NVARCHAR (255) NULL,
+ [MHB] BIT NULL,
+ [UNNumber] NVARCHAR (4) NULL,
+ [IMOClass] NVARCHAR (10) NULL,
+ [Quantity_KGM] FLOAT (53) NULL,
+ [StowagePosition] NVARCHAR (24) NULL,
+ [PortOfLoading] NCHAR(5) NULL,
+ [PortOfDischarge] NCHAR(5) NULL,
+ [Remarks] NVARCHAR (255) NULL,
+ [Identifier] NVARCHAR (40) NULL,
+ CONSTRAINT [PK_IMSBCPosition] PRIMARY KEY CLUSTERED ([Id] ASC)
+)
+
+GO
+
+CREATE TABLE [dbo].[MARPOL_Annex_IPosition]
+(
+ [Id] UNIQUEIDENTIFIER CONSTRAINT [DF_MARPOL_Annex_IPosition_Id] DEFAULT (newid()) ROWGUIDCOL NOT NULL,
+ [HAZId] UNIQUEIDENTIFIER NULL,
+ [Name] NVARCHAR (255) NULL,
+ [FlashpointInformation] TINYINT NULL,
+ [Flashpoint_CEL] NVARCHAR (10) NULL,
+ [Quantity_KGM] FLOAT (53) NULL,
+ [StowagePosition] NVARCHAR (24) NULL,
+ [PortOfLoading] NCHAR (5) NULL,
+ [PortOfDischarge] NCHAR (5) NULL,
+ [Remarks] NVARCHAR (255) NULL,
+ [Identifier] NVARCHAR (40) NULL,
+ CONSTRAINT [PK_MARPOL_Annex_IPosition] PRIMARY KEY CLUSTERED ([Id] ASC)
+)
+
+GO
+
+
diff --git a/nsw/Source/bsmd.dakosy/Request.cs b/nsw/Source/bsmd.dakosy/Request.cs
index 3e26f64b..843714c8 100644
--- a/nsw/Source/bsmd.dakosy/Request.cs
+++ b/nsw/Source/bsmd.dakosy/Request.cs
@@ -77,7 +77,7 @@ namespace bsmd.dakosy
reqList.RequestId[0].MessageHeader.MessageSender = new Participant();
reqList.RequestId[0].MessageHeader.MessageSender.ParticipantCode = new ParticipantCode();
reqList.RequestId[0].MessageHeader.MessageSender.ParticipantCode.AgencyID = "DAK";
- reqList.RequestId[0].MessageHeader.MessageSender.ParticipantCode.Value = "TBD"; // TODO -> Absprache!
+ reqList.RequestId[0].MessageHeader.MessageSender.ParticipantCode.Value = "BSM"; // TODO -> Absprache!
reqList.RequestId[0].ReportingParty = new ReportingParty();
reqList.RequestId[0].ReportingParty.City = aMessage.ReportingParty.City;
reqList.RequestId[0].ReportingParty.Country = aMessage.ReportingParty.Country;
diff --git a/nsw/Source/bsmd.database/CallPurpose.cs b/nsw/Source/bsmd.database/CallPurpose.cs
new file mode 100644
index 00000000..0d2a9eee
--- /dev/null
+++ b/nsw/Source/bsmd.database/CallPurpose.cs
@@ -0,0 +1,97 @@
+//
+// Class: CallPurpose
+// Current CLR: 4.0.30319.34209
+// System: Microsoft Visual Studio 10.0
+// Author: dani
+// Created: 5/20/2015 8:16:09 PM
+//
+// Copyright (c) 2015 Informatikbüro Daniel Schick. All rights reserved.
+
+using System;
+using System.Data;
+using System.Data.SqlClient;
+using System.Collections.Generic;
+
+namespace bsmd.database
+{
+ public class CallPurpose : DatabaseEntity
+ {
+
+ public CallPurpose()
+ {
+ this.tablename = "[dbo].[CallPurpose]";
+ }
+
+ #region Properties
+
+ public NOA_NOD NOA_NOD { get; set; }
+
+ public int CallPurposeCode { get; set; }
+
+ public string CallPurposeDescription { get; set; }
+
+ #endregion
+
+ #region DatabaseEntity implementation
+
+ public override void PrepareSave(System.Data.IDbCommand cmd)
+ {
+ SqlCommand scmd = cmd as SqlCommand;
+
+ scmd.Parameters.AddWithValue("@P1", this.NOA_NOD.Id);
+ scmd.Parameters.AddWithNullableValue("@P2", this.CallPurposeCode);
+ scmd.Parameters.AddWithNullableValue("@P3", this.CallPurposeDescription);
+
+ if (this.IsNew)
+ {
+ scmd.CommandText = string.Format("INSERT INTO {0} (NOA_NODId, CallPurposeCode, CallPurposeDescription) " +
+ " VALUES ( @P1, @P2, @P3 )", this.Tablename);
+ }
+ else
+ {
+ scmd.Parameters.AddWithValue(@"ID", this.Id);
+ scmd.CommandText = string.Format("UPDATE {0} SET CallPurposeCode = @P2, CallPurposeDescription = @P3 " +
+ "WHERE Id = @ID", this.Tablename);
+ }
+ }
+
+ public override void PrepareLoadCommand(System.Data.IDbCommand cmd, Message.LoadFilter filter, params object[] criteria)
+ {
+ string query = string.Format("SELECT Id, CallPurposeCode, CallPurposeDescription FROM {0} ", this.Tablename);
+
+ switch (filter)
+ {
+ case Message.LoadFilter.NOA_NODID:
+ query += " WHERE NOA_NODId = @NNID";
+ ((SqlCommand)cmd).Parameters.AddWithValue("@NNID", criteria[0]);
+ break;
+ case Message.LoadFilter.ALL:
+ default:
+
+ break;
+ }
+
+ cmd.CommandText = query;
+ }
+
+ public override List LoadList(System.Data.IDataReader reader)
+ {
+ List result = new List();
+
+ while (reader.Read())
+ {
+ CallPurpose cp = new CallPurpose();
+
+ cp.id = reader.GetGuid(0);
+ if (!reader.IsDBNull(1)) cp.CallPurposeCode = reader.GetInt32(1);
+ if (!reader.IsDBNull(2)) cp.CallPurposeDescription = reader.GetString(2);
+ result.Add(cp);
+ }
+ reader.Close();
+ return result;
+ }
+
+ #endregion
+
+ }
+}
diff --git a/nsw/Source/bsmd.database/DBManager.cs b/nsw/Source/bsmd.database/DBManager.cs
index dcd94e84..82c895d4 100644
--- a/nsw/Source/bsmd.database/DBManager.cs
+++ b/nsw/Source/bsmd.database/DBManager.cs
@@ -423,11 +423,25 @@ namespace bsmd.database
was.Waste.Add(aWaste);
aWaste.WAS = was;
}
-
}
#endregion
+ if (databaseEntity.GetType().IsAssignableFrom(typeof(NOA_NOD)))
+ {
+ NOA_NOD noa_nod = databaseEntity as NOA_NOD;
+
+ CallPurpose cp = new CallPurpose();
+ cp.PrepareLoadCommand(cmd, Message.LoadFilter.NOA_NODID, noa_nod.Id);
+ SqlDataReader reader = this.PerformCommand(cmd);
+ List cps = cp.LoadList(reader);
+ foreach (CallPurpose callPurpose in cps)
+ {
+ noa_nod.CallPurposes.Add(callPurpose);
+ callPurpose.NOA_NOD = noa_nod;
+ }
+ }
+
#region WasteDisposalServiceProvider
if(databaseEntity.GetType().IsAssignableFrom(typeof(WasteDisposalServiceProvider)))
diff --git a/nsw/Source/bsmd.database/Extensions.cs b/nsw/Source/bsmd.database/Extensions.cs
new file mode 100644
index 00000000..6c0dfaf2
--- /dev/null
+++ b/nsw/Source/bsmd.database/Extensions.cs
@@ -0,0 +1,64 @@
+//
+// Class: Extensions
+// Current CLR: 4.0.30319.34209
+// System: Microsoft Visual Studio 10.0
+// Author: dani
+// Created: 5/13/2015 7:37:03 PM
+//
+// Copyright (c) 2015 Informatikbüro Daniel Schick. All rights reserved.
+
+using System;
+using System.Collections.Generic;
+using System.Text.RegularExpressions;
+
+
+namespace bsmd.database
+{
+ ///
+ /// sensible helpers
+ ///
+ public static class Extensions
+ {
+
+ public static bool IsNullOrEmpty(this String str)
+ {
+ if (str == null) return true;
+ if (str.Trim().Length == 0) return true;
+ if (str.Equals("00000000-0000-0000-0000-000000000000")) return true; // for null guids
+ return false;
+ }
+
+ public static bool IsNullOrEmpty(this List items)
+ {
+ return (items == null) || (items.Count == 0);
+ }
+
+ public static bool IsNullOrEmpty(this Dictionary items)
+ {
+ return (items == null) || (items.Count == 0);
+ }
+
+ public static bool IsNumber(this String str)
+ {
+ string pattern = @"^[1-9]\d*(\.\d+)?$";
+ if (str == null) return false;
+ if (str.Trim().Length == 0) return false;
+ return new Regex(pattern).IsMatch(str);
+ }
+
+ public static bool IsBoolean(this String str)
+ {
+ if (str == null) return false;
+ if (str.Trim().Length == 0) return false;
+ if (str.Trim().Equals("true", StringComparison.InvariantCultureIgnoreCase)) return true;
+ if (str.Trim().Equals("false", StringComparison.InvariantCultureIgnoreCase)) return true;
+ return false;
+ }
+
+ public static bool Contains(this string source, string toCheck, StringComparison comp)
+ {
+ return source.IndexOf(toCheck, comp) >= 0;
+ }
+
+ }
+}
diff --git a/nsw/Source/bsmd.database/LastTenPortFacilitiesCalled.cs b/nsw/Source/bsmd.database/LastTenPortFacilitiesCalled.cs
index 93f65355..28ee455c 100644
--- a/nsw/Source/bsmd.database/LastTenPortFacilitiesCalled.cs
+++ b/nsw/Source/bsmd.database/LastTenPortFacilitiesCalled.cs
@@ -82,12 +82,12 @@ namespace bsmd.database
{
string query = string.Format("SELECT Id, PortFacilityPortName, PortFacilityPortCountry, PortFacilityPortLoCode, " +
"PortFacilityDateOfArrival, PortFacilityDateOfDeparture, PortFacilityShipSecurityLevel, PortFacilitySecurityMattersToReport, " +
- "PortFacilityGISISCode FROM {0}", this.Tablename);
+ "PortFacilityGISISCode FROM {0} ", this.Tablename);
switch (filter)
{
case Message.LoadFilter.SEC_ID:
- query += "WHERE SEC_Id = @SECID";
+ query += " WHERE SEC_Id = @SECID";
((SqlCommand)cmd).Parameters.AddWithValue("@SECID", criteria[0]);
break;
case Message.LoadFilter.ALL:
@@ -96,6 +96,8 @@ namespace bsmd.database
break;
}
+ query += " ORDER BY PortFacilityDateOfArrival DESC"; // jüngster Eintrag zuerst
+
cmd.CommandText = query;
}
diff --git a/nsw/Source/bsmd.database/Message.cs b/nsw/Source/bsmd.database/Message.cs
index cf6588aa..518e2fab 100644
--- a/nsw/Source/bsmd.database/Message.cs
+++ b/nsw/Source/bsmd.database/Message.cs
@@ -54,7 +54,8 @@ namespace bsmd.database
SEC_ID,
HERBERG_FORMGUID,
BY_ID,
- BY_CORE
+ BY_CORE,
+ NOA_NODID
}
///
diff --git a/nsw/Source/bsmd.database/NOA_NOD.cs b/nsw/Source/bsmd.database/NOA_NOD.cs
index 67f1d22a..d75b4a60 100644
--- a/nsw/Source/bsmd.database/NOA_NOD.cs
+++ b/nsw/Source/bsmd.database/NOA_NOD.cs
@@ -17,6 +17,8 @@ namespace bsmd.database
public class NOA_NOD : DatabaseEntity
{
+ List callPurposes = new List();
+
public NOA_NOD()
{
this.tablename = "[dbo].[NOA_NOD]";
@@ -28,9 +30,7 @@ namespace bsmd.database
public DateTime? ETDFromPortOfCall { get; set; }
- public int? CallPurposeCode { get; set; }
-
- public string CallPurposeDescription { get; set; }
+ public List CallPurposes { get { return this.callPurposes; } }
public DateTime? ETAToKielCanal { get; set; }
@@ -50,7 +50,7 @@ namespace bsmd.database
public override void PrepareLoadCommand(System.Data.IDbCommand cmd, Message.LoadFilter filter, params object[] criteria)
{
- string query = string.Format("SELECT Id, ETAToPortOfCall, ETDFromPortOfCall, CallPurposeCode, CallPurposeDescription, " +
+ string query = string.Format("SELECT Id, ETAToPortOfCall, ETDFromPortOfCall, " +
"ETAToKielCanal, ETDFromKielCanal, LastPort, ETDFromLastPort, NextPort, ETAToNextPort FROM {0}", this.Tablename);
switch (filter)
@@ -77,14 +77,12 @@ namespace bsmd.database
nn.id = reader.GetGuid(0);
if (!reader.IsDBNull(1)) nn.ETAToPortOfCall = reader.GetDateTime(1);
if (!reader.IsDBNull(2)) nn.ETDFromPortOfCall = reader.GetDateTime(2);
- if (!reader.IsDBNull(3)) nn.CallPurposeCode = reader.GetInt32(3);
- if (!reader.IsDBNull(4)) nn.CallPurposeDescription = reader.GetString(4);
- if (!reader.IsDBNull(5)) nn.ETAToKielCanal = reader.GetDateTime(5);
- if (!reader.IsDBNull(6)) nn.ETDFromKielCanal = reader.GetDateTime(6);
- if (!reader.IsDBNull(7)) nn.LastPort = reader.GetString(7);
- if (!reader.IsDBNull(8)) nn.ETDFromLastPort = reader.GetDateTime(8);
- if (!reader.IsDBNull(9)) nn.NextPort = reader.GetString(9);
- if (!reader.IsDBNull(10)) nn.ETAToNextPort = reader.GetDateTime(10);
+ if (!reader.IsDBNull(3)) nn.ETAToKielCanal = reader.GetDateTime(5);
+ if (!reader.IsDBNull(4)) nn.ETDFromKielCanal = reader.GetDateTime(6);
+ if (!reader.IsDBNull(5)) nn.LastPort = reader.GetString(7);
+ if (!reader.IsDBNull(6)) nn.ETDFromLastPort = reader.GetDateTime(8);
+ if (!reader.IsDBNull(7)) nn.NextPort = reader.GetString(9);
+ if (!reader.IsDBNull(8)) nn.ETAToNextPort = reader.GetDateTime(10);
result.Add(nn);
}
reader.Close();
@@ -97,29 +95,27 @@ namespace bsmd.database
scmd.Parameters.AddWithNullableValue("@P1", this.MessageHeader.Id);
scmd.Parameters.AddWithNullableValue("@P2", this.ETAToPortOfCall);
- scmd.Parameters.AddWithNullableValue("@P3", this.ETDFromPortOfCall);
- scmd.Parameters.AddWithNullableValue("@P4", this.CallPurposeCode);
- scmd.Parameters.AddWithNullableValue("@P5", this.CallPurposeDescription);
- scmd.Parameters.AddWithNullableValue("@P6", this.ETAToKielCanal);
- scmd.Parameters.AddWithNullableValue("@P7", this.ETDFromKielCanal);
- scmd.Parameters.AddWithNullableValue("@P8", this.LastPort);
- scmd.Parameters.AddWithNullableValue("@P9", this.ETDFromLastPort);
- scmd.Parameters.AddWithNullableValue("@P10", this.NextPort);
- scmd.Parameters.AddWithNullableValue("@P11", this.ETAToNextPort);
+ scmd.Parameters.AddWithNullableValue("@P3", this.ETDFromPortOfCall);
+ scmd.Parameters.AddWithNullableValue("@P4", this.ETAToKielCanal);
+ scmd.Parameters.AddWithNullableValue("@P5", this.ETDFromKielCanal);
+ scmd.Parameters.AddWithNullableValue("@P6", this.LastPort);
+ scmd.Parameters.AddWithNullableValue("@P7", this.ETDFromLastPort);
+ scmd.Parameters.AddWithNullableValue("@P8", this.NextPort);
+ scmd.Parameters.AddWithNullableValue("@P9", this.ETAToNextPort);
if (this.IsNew)
{
cmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, ETAToPortOfCall, ETDFromPortOfCall, " +
- "CallPurposeCode, CallPurposeDescription, ETAToKielCanal, ETDFromKielCanal, LastPort, ETDFromLastPort, " +
- "NextPort, ETAToNextPort) VALUES (@P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11) ", this.Tablename);
+ "ETAToKielCanal, ETDFromKielCanal, LastPort, ETDFromLastPort, " +
+ "NextPort, ETAToNextPort) VALUES (@P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9) ", this.Tablename);
}
else
{
((SqlCommand)cmd).Parameters.AddWithValue("@ID", this.Id);
- cmd.CommandText = string.Format("UPDATE {0} SET ETAToPortOfCall = @P2, ETDFromPortOfCall = @P3, CallPurposeCode = @P4, " +
- "CallPurposeDescription = @P5, ETAToKielCanal = @P6, ETDFromKielCanal = @P7, LastPort = @P8, ETDFromLastPort = @P9, " +
- "NextPort = @P10, ETAToNextPort = @P11 WHERE Id = @ID", this.Tablename);
+ cmd.CommandText = string.Format("UPDATE {0} SET ETAToPortOfCall = @P2, ETDFromPortOfCall = @P3, " +
+ "ETAToKielCanal = @P4, ETDFromKielCanal = @P5, LastPort = @P6, ETDFromLastPort = @P7, " +
+ "NextPort = @P8, ETAToNextPort = @P9 WHERE Id = @ID", this.Tablename);
}
}
diff --git a/nsw/Source/bsmd.database/ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.cs b/nsw/Source/bsmd.database/ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.cs
index a8b3a581..9fe98e66 100644
--- a/nsw/Source/bsmd.database/ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.cs
+++ b/nsw/Source/bsmd.database/ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.cs
@@ -87,7 +87,7 @@ namespace bsmd.database
switch (filter)
{
case Message.LoadFilter.SEC_ID:
- query += "WHERE SEC_Id = @SECID";
+ query += " WHERE SEC_Id = @SECID";
((SqlCommand)cmd).Parameters.AddWithValue("@SECID", criteria[0]);
break;
case Message.LoadFilter.ALL:
@@ -96,6 +96,8 @@ namespace bsmd.database
break;
}
+ query += " ORDER BY ShipToShipActivityDateFrom DESC"; // jüngster Eintrag zuerst
+
cmd.CommandText = query;
}
diff --git a/nsw/Source/bsmd.database/WAS.cs b/nsw/Source/bsmd.database/WAS.cs
index 8f16e1d2..b2ea77ab 100644
--- a/nsw/Source/bsmd.database/WAS.cs
+++ b/nsw/Source/bsmd.database/WAS.cs
@@ -76,12 +76,12 @@ namespace bsmd.database
public override void PrepareLoadCommand(System.Data.IDbCommand cmd, Message.LoadFilter filter, params object[] criteria)
{
string query = string.Format("SELECT Id, WasteDisposalValidExemption, LastWasteDisposalPort, ConfirmationOfCorrectness, LastWasteDisposalDate, WasteDisposalDelivery " +
- "FROM {0}", this.Tablename);
+ "FROM {0} ", this.Tablename);
switch (filter)
{
case Message.LoadFilter.MESSAGEHEADER:
- query += "WHERE MessageHeaderId = @MHID";
+ query += " WHERE MessageHeaderId = @MHID";
((SqlCommand)cmd).Parameters.AddWithValue("@MHID", criteria[0]);
break;
case Message.LoadFilter.ALL:
diff --git a/nsw/Source/bsmd.database/Waste.cs b/nsw/Source/bsmd.database/Waste.cs
index 1d26f759..3b54e901 100644
--- a/nsw/Source/bsmd.database/Waste.cs
+++ b/nsw/Source/bsmd.database/Waste.cs
@@ -77,13 +77,13 @@ namespace bsmd.database
public override void PrepareLoadCommand(System.Data.IDbCommand cmd, Message.LoadFilter filter, params object[] criteria)
{
string query = string.Format("SELECT Id, WasteType, WasteDescription, WasteDisposalAmount_MTQ, " +
- "WasteCapacity_MTQ, WasteAmountRetained_MTQ, WasteDisposalPort, WasteAmountGeneratedTillNextPort_MTQ, " +
- " FROM {0}", this.Tablename);
+ "WasteCapacity_MTQ, WasteAmountRetained_MTQ, WasteDisposalPort, WasteAmountGeneratedTillNextPort_MTQ " +
+ " FROM {0} ", this.Tablename);
switch (filter)
{
case Message.LoadFilter.WDSP_ID:
- query += "WHERE WASId = @WDID";
+ query += " WHERE WASId = @WDID";
((SqlCommand)cmd).Parameters.AddWithValue("@WDID", criteria[0]);
break;
case Message.LoadFilter.ALL:
diff --git a/nsw/Source/bsmd.database/bsmd.database.csproj b/nsw/Source/bsmd.database/bsmd.database.csproj
index b8566097..fbb32104 100644
--- a/nsw/Source/bsmd.database/bsmd.database.csproj
+++ b/nsw/Source/bsmd.database/bsmd.database.csproj
@@ -53,7 +53,9 @@
+
+
diff --git a/nsw/Source/bsmd.dbh/Request.cs b/nsw/Source/bsmd.dbh/Request.cs
index 8adb661c..3bd92742 100644
--- a/nsw/Source/bsmd.dbh/Request.cs
+++ b/nsw/Source/bsmd.dbh/Request.cs
@@ -11,7 +11,7 @@ using System;
using System.Collections.Generic;
using log4net;
using bsmd.database;
-//using bsmd.dbh.request;
+
using bsmd.dbh.DBHWebReference;
namespace bsmd.dbh
@@ -20,27 +20,24 @@ namespace bsmd.dbh
{
private static ILog _log = LogManager.GetLogger(typeof(Request));
- public static bool SendMessage(DatabaseEntity dbEntity)
+ public static bool SendMessage(Message message)
{
- if (dbEntity == null) return false;
+ if (message == null) return false;
- Message aMessage = null;
RootType rootType = RootType.DATA;
- if (dbEntity.GetType().IsAssignableFrom(typeof(Message)))
+ if (message.ReportingParty == null)
{
- aMessage = (Message)dbEntity;
- rootType = aMessage.MessageCore.IsTransit ? RootType.TRANSIT : RootType.VISIT;
- aMessage.SentAt = DateTime.Now;
- }
- else
- {
- aMessage = dbEntity.MessageHeader;
+ _log.ErrorFormat("Reporting party not set on message {0}", message.Id);
+ return false;
}
- if (aMessage.ReportingParty == null)
+ if ((message.MessageNotificationClass != Message.NotificationClass.VISIT) &&
+ (message.MessageNotificationClass != Message.NotificationClass.TRANSIT) &&
+ (message.Elements.Count == 0))
{
- _log.ErrorFormat("Reporting party not set on message {0}", aMessage.Id);
+ _log.ErrorFormat("trying to send message {0} class {1} but there are no depending record elements",
+ message.Id, message.MessageNotificationClass);
return false;
}
@@ -48,28 +45,28 @@ namespace bsmd.dbh
Dbh_Osis_Answ_Ws client = new Dbh_Osis_Answ_Ws();
RootReportingParty rp = new RootReportingParty();
- rp.RPCity = aMessage.ReportingParty.City;
- rp.RPCountry = aMessage.ReportingParty.Country;
- rp.RPEMail = aMessage.ReportingParty.EMail;
- rp.RPFax = aMessage.ReportingParty.Fax;
- rp.RPFirstName = aMessage.ReportingParty.FirstName;
- rp.RPLastName = aMessage.ReportingParty.LastName;
- rp.RPName = aMessage.ReportingParty.Name;
- rp.RPPhone = aMessage.ReportingParty.Phone;
- rp.RPPostalCode = aMessage.ReportingParty.PostalCode;
- rp.RPStreetAndNumber = aMessage.ReportingParty.StreetAndNumber;
- rp.RPTypeSpecified = aMessage.ReportingParty.ReportingPartyType.HasValue;
+ rp.RPCity = message.ReportingParty.City;
+ rp.RPCountry = message.ReportingParty.Country;
+ rp.RPEMail = message.ReportingParty.EMail;
+ rp.RPFax = message.ReportingParty.Fax;
+ rp.RPFirstName = message.ReportingParty.FirstName;
+ rp.RPLastName = message.ReportingParty.LastName;
+ rp.RPName = message.ReportingParty.Name;
+ rp.RPPhone = message.ReportingParty.Phone;
+ rp.RPPostalCode = message.ReportingParty.PostalCode;
+ rp.RPStreetAndNumber = message.ReportingParty.StreetAndNumber;
+ rp.RPTypeSpecified = message.ReportingParty.ReportingPartyType.HasValue;
if (rp.RPTypeSpecified)
- rp.RPType = (RootReportingPartyRPType)aMessage.ReportingParty.ReportingPartyType.Value;
+ rp.RPType = (RootReportingPartyRPType)message.ReportingParty.ReportingPartyType.Value;
DateTime timestamp = DateTime.Now;
string version = "2.0";
object item = null;
- string senderReference = dbEntity.Id.Value.ToString("N");
-
+ string senderReference = message.Id.Value.ToString("N");
+
ItemChoiceType2 itemChoiceType2 = ItemChoiceType2.Visit; // ?
- switch (aMessage.MessageNotificationClass)
+ switch (message.MessageNotificationClass)
{
#region VISIT
@@ -78,19 +75,19 @@ namespace bsmd.dbh
RootVisit rootVisit = new RootVisit();
rootType = RootType.VISIT;
- if (aMessage.MessageCore.IMO != null)
+ if (message.MessageCore.IMO != null)
{
rootVisit.ItemElementName = ItemChoiceType.IMONumber;
- rootVisit.Item = aMessage.MessageCore.IMO;
+ rootVisit.Item = message.MessageCore.IMO;
}
else
{
rootVisit.ItemElementName = ItemChoiceType.ENINumber;
- rootVisit.Item = aMessage.MessageCore.ENI;
+ rootVisit.Item = message.MessageCore.ENI;
}
-
- rootVisit.PortOfCall = aMessage.MessageCore.PoC;
- rootVisit.ETAPortOfCall = aMessage.MessageCore.ETA.Value;
+
+ rootVisit.PortOfCall = message.MessageCore.PoC;
+ rootVisit.ETAPortOfCall = message.MessageCore.ETA.Value;
item = rootVisit;
break;
@@ -103,18 +100,18 @@ namespace bsmd.dbh
RootTransit rootTransit = new RootTransit();
rootType = RootType.TRANSIT;
- if (aMessage.MessageCore.IMO != null)
+ if (message.MessageCore.IMO != null)
{
rootTransit.ItemElementName = ItemChoiceType1.IMONumber;
- rootTransit.Item = aMessage.MessageCore.IMO;
+ rootTransit.Item = message.MessageCore.IMO;
}
else
{
rootTransit.ItemElementName = ItemChoiceType1.ENINumber;
- rootTransit.Item = aMessage.MessageCore.ENI;
+ rootTransit.Item = message.MessageCore.ENI;
}
- rootTransit.ETAKielCanal = aMessage.MessageCore.ETA.Value;
+ rootTransit.ETAKielCanal = message.MessageCore.ETA.Value;
item = rootTransit;
break;
@@ -124,11 +121,11 @@ namespace bsmd.dbh
#region NOA_NOD
case Message.NotificationClass.NOA_NOD:
{
- NOA_NOD noa_nod = dbEntity as NOA_NOD;
+ NOA_NOD noa_nod = message.Elements[0] as NOA_NOD;
if (noa_nod != null)
{
RootNOA_NOD rootNoaNod = new RootNOA_NOD();
- rootType = RootType.DATA;
+
if (noa_nod.ETAToNextPort.HasValue)
rootNoaNod.ETAToNextPort = noa_nod.ETAToNextPort.Value;
rootNoaNod.ETAToNextPortSpecified = noa_nod.ETAToNextPort.HasValue;
@@ -180,12 +177,11 @@ namespace bsmd.dbh
#region ATA
case Message.NotificationClass.ATA:
{
- ATA ata = dbEntity as ATA;
+ ATA ata = message.Elements[0] as ATA;
if (ata != null)
{
RootATA rootATA = new RootATA();
- rootType = RootType.DATA;
- if(ata.ATAPortOfCall.HasValue)
+ if (ata.ATAPortOfCall.HasValue)
rootATA.ATAPortOfCall = ata.ATAPortOfCall.Value;
item = rootATA;
}
@@ -196,11 +192,10 @@ namespace bsmd.dbh
#region ATD
case Message.NotificationClass.ATD:
{
- ATD atd = dbEntity as ATD;
+ ATD atd = message.Elements[0] as ATD;
if (atd != null)
{
RootATD rootATD = new RootATD();
- rootType = RootType.DATA;
rootATD.ATDPortOfCall = atd.ATDPortOfCall.Value;
item = rootATD;
}
@@ -208,15 +203,112 @@ namespace bsmd.dbh
}
#endregion
+ #region SEC
+ case Message.NotificationClass.SEC:
+ {
+ RootSEC rootSEC = new RootSEC();
+ SEC sec = message.Elements[0] as SEC;
+ int numFields = (sec.SECSimplification ?? false) ?
+ 2 : (15 + sec.LastTenPortFacilitesCalled.Count + sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Count);
+ rootSEC.Items = new object[numFields];
+ rootSEC.ItemsElementName = new ItemsChoiceType1[numFields];
+
+ if (sec.SECSimplification ?? false)
+ {
+ rootSEC.ItemsElementName[0] = ItemsChoiceType1.SECSimplification;
+ rootSEC.Items[0] = RootSECSECSimplification.Y;
+ rootSEC.ItemsElementName[1] = ItemsChoiceType1.PortOfCallWhereCompleteSECNotified;
+ rootSEC.Items[1] = sec.PortOfCallWhereCompleteSECNotified;
+ }
+ else
+ {
+ rootSEC.ItemsElementName[0] = ItemsChoiceType1.CSOLastName;
+ rootSEC.Items[0] = sec.CSOLastName;
+ rootSEC.ItemsElementName[1] = ItemsChoiceType1.CSOFirstName;
+ rootSEC.Items[1] = sec.CSOFirstName;
+ rootSEC.ItemsElementName[2] = ItemsChoiceType1.CSOPhone;
+ rootSEC.Items[2] = sec.CSOPhone;
+ rootSEC.ItemsElementName[3] = ItemsChoiceType1.CSOFax;
+ rootSEC.Items[3] = sec.CSOFax;
+ rootSEC.ItemsElementName[4] = ItemsChoiceType1.ValidISSCOnBoard;
+ rootSEC.Items[4] = sec.ValidISSCOnBoard ?? false ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N;
+ rootSEC.ItemsElementName[5] = ItemsChoiceType1.ISSCType;
+ rootSEC.Items[5] = (RootSECISSCType) (sec.ISSCType ?? 0);
+ rootSEC.ItemsElementName[6] = ItemsChoiceType1.ISSCIssuerName;
+ rootSEC.Items[6] = sec.ISSCIssuerName;
+ rootSEC.ItemsElementName[7] = ItemsChoiceType1.ISSCDateOfExpiration;
+ if(sec.ISSCDateOfExpiration.HasValue)
+ rootSEC.Items[7] = sec.ISSCDateOfExpiration.Value;
+ rootSEC.ItemsElementName[8] = ItemsChoiceType1.ApprovedSecurityPlanOnBoard;
+ rootSEC.Items[8] = sec.ApprovedSecurityPlanOnBoard ?? false ? RootSECApprovedSecurityPlanOnBoard.Y : RootSECApprovedSecurityPlanOnBoard.N;
+ rootSEC.ItemsElementName[9] = ItemsChoiceType1.CurrentShipSecurityLevel;
+ if (sec.CurrentShipSecurityLevel.HasValue) rootSEC.Items[9] = (int)sec.CurrentShipSecurityLevel.Value;
+ rootSEC.ItemsElementName[10] = ItemsChoiceType1.PortFacilityOfArrival;
+ rootSEC.Items[10] = sec.PortFacilityOfArrival;
+ rootSEC.ItemsElementName[11] = ItemsChoiceType1.GeneralDescriptionOfCargo;
+ if (sec.GeneralDescriptionOfCargo.HasValue)
+ rootSEC.Items[11] = (RootSECGeneralDescriptionOfCargo)sec.GeneralDescriptionOfCargo.Value;
+ rootSEC.ItemsElementName[12] = ItemsChoiceType1.ReasonsForNoValidISSC;
+ rootSEC.Items[12] = sec.ReasonsForNoValidISSC;
+ rootSEC.ItemsElementName[13] = ItemsChoiceType1.ISSCIssuerType;
+ rootSEC.Items[13] = (RootSECISSCIssuerType) (sec.ISSCIssuerType ?? 0);
+ rootSEC.ItemsElementName[14] = ItemsChoiceType1.CSOEMail;
+ rootSEC.Items[14] = sec.CSOEMail;
+
+ int index = 15;
+ for (int i=0; i < sec.LastTenPortFacilitesCalled.Count; index++, i++)
+ {
+ rootSEC.ItemsElementName[index] = ItemsChoiceType1.LastTenPortFacilitiesCalled;
+ RootSECLastTenPortFacilitiesCalled lastTen = new RootSECLastTenPortFacilitiesCalled();
+ rootSEC.Items[index] = lastTen;
+ lastTen.PortFacilityPortName = sec.LastTenPortFacilitesCalled[i].PortFacilityPortName;
+ lastTen.PortFacilityPortCountry = sec.LastTenPortFacilitesCalled[i].PortFacilityPortCountry;
+ lastTen.PortFacilityPortLoCode = sec.LastTenPortFacilitesCalled[i].PortFacilityPortLoCode;
+ if (sec.LastTenPortFacilitesCalled[i].PortFacilityDateOfArrival.HasValue)
+ lastTen.PortFacilityDateOfArrival = sec.LastTenPortFacilitesCalled[i].PortFacilityDateOfArrival.Value;
+ if (sec.LastTenPortFacilitesCalled[i].PortFacilityDateOfDeparture.HasValue)
+ lastTen.PortFacilityDateOfDeparture = sec.LastTenPortFacilitesCalled[i].PortFacilityDateOfDeparture.Value;
+ if (sec.LastTenPortFacilitesCalled[i].PortFacilityShipSecurityLevel.HasValue)
+ lastTen.PortFacilityShipSecurityLevel = sec.LastTenPortFacilitesCalled[i].PortFacilityShipSecurityLevel.Value;
+ lastTen.PortFacilitySecurityMattersToReport = sec.LastTenPortFacilitesCalled[i].PortFacilitySecurityMattersToReport;
+ lastTen.PortFacilityGISISCode = sec.LastTenPortFacilitesCalled[i].PortFacilityGISISCode;
+ }
+
+ for (int i = 0; i < sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Count; index++, i++ )
+ {
+ rootSEC.ItemsElementName[index] = ItemsChoiceType1.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled;
+ RootSECShipToShipActivitiesDuringLastTenPortFacilitiesCalled s2s = new RootSECShipToShipActivitiesDuringLastTenPortFacilitiesCalled();
+ rootSEC.Items[index] = s2s;
+ s2s.ShipToShipActivityLocation = new RootSECShipToShipActivitiesDuringLastTenPortFacilitiesCalledShipToShipActivityLocation();
+ s2s.ShipToShipActivityLocation.ShipToShipActivityLocationName = sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityLocationName;
+ s2s.ShipToShipActivityLocation.ShipToShipActivityLocationLoCode = sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityLocationLoCode;
+ s2s.ShipToShipActivityLocation.ShipToShipActivityLocationCoordinates = new RootSECShipToShipActivitiesDuringLastTenPortFacilitiesCalledShipToShipActivityLocationShipToShipActivityLocationCoordinates();
+ if (sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityLocationCoordinatesLatitude.HasValue)
+ s2s.ShipToShipActivityLocation.ShipToShipActivityLocationCoordinates.ShipToShipActivityLocationCoordinatesLatitude = sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityLocationCoordinatesLatitude.Value;
+ if (sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityLocationCoordinatesLongitude.HasValue)
+ s2s.ShipToShipActivityLocation.ShipToShipActivityLocationCoordinates.ShipToShipActivityLocationCoordinatesLongitude = sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityLocationCoordinatesLongitude.Value;
+ if (sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityDateFrom.HasValue)
+ s2s.ShipToShipActivityDateFrom = sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityDateFrom.Value;
+ if (sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityDateTo.HasValue)
+ s2s.ShipToShipActivityDateTo = sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityDateTo.Value;
+ s2s.ShipToShipActivityType = sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityType;
+ s2s.ShipToShipActivitySecurityMattersToReport = sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivitySecurityMattersToReport;
+ }
+
+ }
+
+ item = rootSEC;
+ }
+ break;
+ #endregion
+
#region BPOL
case Message.NotificationClass.BPOL:
{
- BPOL bpol = dbEntity as BPOL;
+ BPOL bpol = message.Elements[0] as BPOL;
if (bpol != null)
{
RootBPOL rootBPOL = new RootBPOL();
- rootType = RootType.DATA;
-
RootBPOLPortOfItinerary[] poiArray = new RootBPOLPortOfItinerary[bpol.PortOfItineraries.Count];
rootBPOL.PortOfItinerary = poiArray;
@@ -242,40 +334,534 @@ namespace bsmd.dbh
#region CREW
case Message.NotificationClass.CREW:
{
- if (aMessage.Elements.Count > 0)
+
+ RootCREW rootCREW = new RootCREW();
+
+ rootCREW.CrewMember = new RootCREWCrewMember[message.Elements.Count];
+ for (int i = 0; i < message.Elements.Count; i++)
{
- RootCREW rootCREW = new RootCREW();
- rootType = RootType.DATA;
- rootCREW.CrewMember = new RootCREWCrewMember[aMessage.Elements.Count];
- for (int i = 0; i < aMessage.Elements.Count; i++)
- {
- CREW crew = aMessage.Elements[i] as CREW;
- rootCREW.CrewMember[i] = new RootCREWCrewMember();
- if (crew.CrewMemberDateOfBirth.HasValue)
- rootCREW.CrewMember[i].CrewMemberDateOfBirth = crew.CrewMemberDateOfBirth.Value;
- rootCREW.CrewMember[i].CrewMemberDuty = crew.CrewMemberDuty;
- rootCREW.CrewMember[i].CrewMemberFirstName = crew.CrewMemberFirstName;
- rootCREW.CrewMember[i].CrewMemberGenderSpecified = crew.CrewMemberGender.HasValue;
- if (crew.CrewMemberGender.HasValue)
- rootCREW.CrewMember[i].CrewMemberGender = (RootCREWCrewMemberCrewMemberGender) crew.CrewMemberGender.Value;
- rootCREW.CrewMember[i].CrewMemberIdentityDocumentId = crew.CrewMemberIdentityDocumentId;
- if(crew.CrewMemberIdentityDocumentType.HasValue)
- rootCREW.CrewMember[i].CrewMemberIdentityDocumentType = (RootCREWCrewMemberCrewMemberIdentityDocumentType)crew.CrewMemberIdentityDocumentType.Value;
- rootCREW.CrewMember[i].CrewMemberLastName = crew.CrewMemberLastName;
- rootCREW.CrewMember[i].CrewMemberNationality = crew.CrewMemberNationality;
- rootCREW.CrewMember[i].CrewMemberPlaceOfBirth = crew.CrewMemberPlaceOfBirth;
- rootCREW.CrewMember[i].CrewMemberVisaNumber = crew.CrewMemberVisaNumber;
- }
- item = rootCREW;
+ CREW crew = message.Elements[i] as CREW;
+ rootCREW.CrewMember[i] = new RootCREWCrewMember();
+ if (crew.CrewMemberDateOfBirth.HasValue)
+ rootCREW.CrewMember[i].CrewMemberDateOfBirth = crew.CrewMemberDateOfBirth.Value;
+ rootCREW.CrewMember[i].CrewMemberDuty = crew.CrewMemberDuty;
+ rootCREW.CrewMember[i].CrewMemberFirstName = crew.CrewMemberFirstName;
+ rootCREW.CrewMember[i].CrewMemberGenderSpecified = crew.CrewMemberGender.HasValue;
+ if (crew.CrewMemberGender.HasValue)
+ rootCREW.CrewMember[i].CrewMemberGender = (RootCREWCrewMemberCrewMemberGender)crew.CrewMemberGender.Value;
+ rootCREW.CrewMember[i].CrewMemberIdentityDocumentId = crew.CrewMemberIdentityDocumentId;
+ if (crew.CrewMemberIdentityDocumentType.HasValue)
+ rootCREW.CrewMember[i].CrewMemberIdentityDocumentType = (RootCREWCrewMemberCrewMemberIdentityDocumentType)crew.CrewMemberIdentityDocumentType.Value;
+ rootCREW.CrewMember[i].CrewMemberLastName = crew.CrewMemberLastName;
+ rootCREW.CrewMember[i].CrewMemberNationality = crew.CrewMemberNationality;
+ rootCREW.CrewMember[i].CrewMemberPlaceOfBirth = crew.CrewMemberPlaceOfBirth;
+ rootCREW.CrewMember[i].CrewMemberVisaNumber = crew.CrewMemberVisaNumber;
}
+ item = rootCREW;
+
}
break;
#endregion
+ #region PAS
+ case Message.NotificationClass.PAS:
+ {
+ RootPAS rootPAS = new RootPAS();
+ rootPAS.Passenger = new RootPASPassenger[message.Elements.Count];
+ for(int i=0;i 0)
+ {
+ l30d.PortOfCallLast30Days = new RootMDHPortsOfCallLast30DaysPortOfCallLast30Days[mdh.PortOfCallLast30Days.Count];
+ for (int i = 0; i < mdh.PortOfCallLast30Days.Count; i++)
+ {
+ l30d.PortOfCallLast30Days[i] = new RootMDHPortsOfCallLast30DaysPortOfCallLast30Days();
+ l30d.PortOfCallLast30Days[i].PortOfCallLast30DaysCrewJoinedShip = new RootMDHPortsOfCallLast30DaysPortOfCallLast30DaysPortOfCallLast30DaysCrewJoinedShip();
+ if (mdh.PortOfCallLast30Days[i].CrewJoinedShip.Count > 0)
+ {
+ l30d.PortOfCallLast30Days[i].PortOfCallLast30DaysCrewJoinedShip.PortOfCallLast30DaysCrewJoinedShipName = new string[mdh.PortOfCallLast30Days[i].CrewJoinedShip.Count];
+ for (int j = 0; j < mdh.PortOfCallLast30Days[i].CrewJoinedShip.Count; j++)
+ {
+ l30d.PortOfCallLast30Days[i].PortOfCallLast30DaysCrewJoinedShip.PortOfCallLast30DaysCrewJoinedShipName[j] = mdh.PortOfCallLast30Days[i].CrewJoinedShip[j].PortOfCallLast30DaysCrewJoinedShipName;
+ }
+ }
+ l30d.PortOfCallLast30Days[i].PortOfCallLast30DaysCrewMembersJoined = mdh.PortOfCallLast30Days[i].PortOfCallLast30DaysCrewMembersJoined ?? false ? RootMDHPortsOfCallLast30DaysPortOfCallLast30DaysPortOfCallLast30DaysCrewMembersJoined.Y : RootMDHPortsOfCallLast30DaysPortOfCallLast30DaysPortOfCallLast30DaysCrewMembersJoined.N;
+ if (mdh.PortOfCallLast30Days[i].PortOfCallLast30DaysDateOfDeparture.HasValue)
+ l30d.PortOfCallLast30Days[i].PortOfCallLast30DaysDateOfDeparture = mdh.PortOfCallLast30Days[i].PortOfCallLast30DaysDateOfDeparture.Value;
+ l30d.PortOfCallLast30Days[i].PortOfCallLast30DaysLocode = mdh.PortOfCallLast30Days[i].PortOfCallLast30DaysLocode;
+ }
+ }
+ }
+
+ item = rootMDH;
+ }
+ break;
+ #endregion
+
+ #region WAS
+ case Message.NotificationClass.WAS:
+ {
+ RootWAS rootWAS = new RootWAS();
+ WAS was = message.Elements[0] as WAS;
+ if (was.WasteDisposalValidExemption ?? false)
+ {
+ rootWAS.Items = new object[1];
+ rootWAS.ItemsElementName = new ItemsChoiceType3[1];
+ rootWAS.ItemsElementName[0] = ItemsChoiceType3.WasteDisposalValidExemption;
+ rootWAS.Items[0] = RootWASWasteDisposalValidExemption.Y;
+ }
+ else
+ {
+ rootWAS.Items = new object[5];
+ rootWAS.ItemsElementName = new ItemsChoiceType3[5];
+
+ rootWAS.ItemsElementName[0] = ItemsChoiceType3.LastWasteDisposalPort;
+ rootWAS.Items[0] = was.LastWasteDisposalPort;
+ rootWAS.ItemsElementName[1] = ItemsChoiceType3.LastWasteDisposalDate;
+ if (was.LastWasteDisposalDate.HasValue)
+ rootWAS.Items[1] = was.LastWasteDisposalDate.Value;
+ rootWAS.ItemsElementName[2] = ItemsChoiceType3.WasteDisposalServiceProviderName;
+ // TODO: Klären wie es nun genau hier aussieht!
+ /*
+ if(was.WasteDisposalServiceProvider.Count > 0) {
+ rootWAS.Items[2] = new string[was.WasteDisposalServiceProvider.Count];
+ for (int i = 0; i < was.WasteDisposalServiceProvider.Count; i++)
+ {
+ rootWAS.Items[2][i] = was.WasteDisposalServiceProvider[i].WasteDisposalServiceProviderName;
+ }
+ }
+
+ */
+ rootWAS.ItemsElementName[3] = ItemsChoiceType3.WasteDisposalDelivery;
+ if (was.WasteDisposalDelivery.HasValue)
+ rootWAS.Items[3] = (RootWASWasteDisposalDelivery)was.WasteDisposalDelivery.Value;
+ rootWAS.ItemsElementName[4] = ItemsChoiceType3.Waste;
+ if (was.Waste.Count > 0)
+ {
+ RootWASWaste[] rww = new RootWASWaste[was.Waste.Count];
+ rootWAS.Items[4] = rww;
+ for (int i = 0; i < was.Waste.Count; i++)
+ {
+ rww[i] = new RootWASWaste();
+ rww[i].WasteDescription = was.Waste[i].WasteDescription;
+ if(was.Waste[i].WasteType.HasValue)
+ rww[i].WasteType = (RootWASWasteWasteType) was.Waste[i].WasteType.Value;
+ if (was.Waste[i].WasteDisposalAmount_MTQ.HasValue)
+ rww[i].WasteDisposalAmount_MTQ = was.Waste[i].WasteDisposalAmount_MTQ.Value;
+ rww[i].WasteDetails = new RootWASWasteWasteDetails();
+ if (was.Waste[i].WasteCapacity_MTQ.HasValue)
+ rww[i].WasteDetails.WasteCapacity_MTQ = was.Waste[i].WasteCapacity_MTQ.Value;
+ if (was.Waste[i].WasteAmountRetained_MTQ.HasValue)
+ rww[i].WasteDetails.WasteAmountRetained_MTQ = was.Waste[i].WasteAmountRetained_MTQ.Value;
+ rww[i].WasteDetails.WasteDisposalPort = was.Waste[i].WasteDisposalPort;
+ if (was.Waste[i].WasteAmountGeneratedTillNextPort_MTQ.HasValue)
+ rww[i].WasteDetails.WasteAmountGeneratedTillNextPort_MTQ = was.Waste[i].WasteAmountGeneratedTillNextPort_MTQ.Value;
+ }
+ }
+ rootWAS.ItemsElementName[5] = ItemsChoiceType3.ConfirmationOfCorrectness;
+ rootWAS.Items[5] = was.ConfirmationOfCorrectness ?? false ? RootWASConfirmationOfCorrectness.Y : RootWASConfirmationOfCorrectness.N;
+
+ }
+
+ item = rootWAS;
+ }
+ break;
+ #endregion
+
+
+ #region TOWA
+ case Message.NotificationClass.TOWA:
+ {
+ RootTOWA rootTowa = new RootTOWA();
+ rootTowa.TowageOnArrival = new RootTOWATowageOnArrival[message.Elements.Count];
+ for (int i = 0; i < message.Elements.Count; i++)
+ {
+ TOWA towa = message.Elements[i] as TOWA;
+ rootTowa.TowageOnArrival[i] = new RootTOWATowageOnArrival();
+ rootTowa.TowageOnArrival[i].TowageOnArrivalName = towa.TowageOnArrivalName;
+ rootTowa.TowageOnArrival[i].TowageOnArrivalFlag = towa.TowageOnArrivalFlag;
+ rootTowa.TowageOnArrival[i].TowageOnArrivalOperator = new RootTOWATowageOnArrivalTowageOnArrivalOperator();
+ rootTowa.TowageOnArrival[i].TowageOnArrivalOperator.TowageOnArrivalOperatorCompanyName = towa.TowageOnArrivalOperatorCompanyName;
+ rootTowa.TowageOnArrival[i].TowageOnArrivalOperator.TowageOnArrivalOperatorStreetAndNumber = towa.TowageOnArrivalOperatorStreetNameAndNumber;
+ rootTowa.TowageOnArrival[i].TowageOnArrivalOperator.TowageOnArrivalOperatorPostalCode = towa.TowageOnArrivalOperatorPostalCode;
+ rootTowa.TowageOnArrival[i].TowageOnArrivalOperator.TowageOnArrivalOperatorCity = towa.TowageOnArrivalOperatorCity;
+ rootTowa.TowageOnArrival[i].TowageOnArrivalOperator.TowageOnArrivalOperatorCountry = towa.TowageOnArrivalOperatorCountry;
+ rootTowa.TowageOnArrival[i].TowageOnArrivalOperator.TowageOnArrivalOperatorPhone = towa.TowageOnArrivalOperatorPhone;
+ rootTowa.TowageOnArrival[i].TowageOnArrivalOperator.TowageOnArrivalOperatorFax = towa.TowageOnArrivalOperatorFax;
+ rootTowa.TowageOnArrival[i].TowageOnArrivalOperator.TowageOnArrivalOperatorEMail = towa.TowageOnArrivalOperatorEmail;
+ if (towa.TowageOnArrivalGrossTonnage.HasValue)
+ rootTowa.TowageOnArrival[i].TowageOnArrivalGrossTonnage = towa.TowageOnArrivalGrossTonnage.Value;
+ if (towa.TowageOnArrivalLengthOverall_MTR.HasValue)
+ rootTowa.TowageOnArrival[i].TowageOnArrivalLengthOverall_MTR = towa.TowageOnArrivalLengthOverall_MTR.Value;
+ if (towa.TowageOnArrivalBeam_MTR.HasValue)
+ rootTowa.TowageOnArrival[i].TowageOnArrivalBeam_MTR = towa.TowageOnArrivalBeam_MTR.Value;
+ rootTowa.TowageOnArrival[i].TowageOnArrivalPurposeOfCall = towa.TowageOnArrivalPurposeOfCall;
+ if (towa.TowageOnArrivalDraught_DMT.HasValue)
+ rootTowa.TowageOnArrival[i].TowageOnArrivalDraught_DMT = towa.TowageOnArrivalDraught_DMT.Value;
+ rootTowa.TowageOnArrival[i].TowageOnArrivalRemarks = towa.TowageOnArrivalRemarks;
+ }
+ item = rootTowa;
+ }
+ break;
+ #endregion
+
+ #region TOWD
+ case Message.NotificationClass.TOWD:
+ {
+ RootTOWD rootTowd = new RootTOWD();
+ rootTowd.TowageOnDeparture = new RootTOWDTowageOnDeparture[message.Elements.Count];
+ for (int i = 0; i < message.Elements.Count; i++)
+ {
+ TOWD towd = message.Elements[i] as TOWD;
+ rootTowd.TowageOnDeparture[i] = new RootTOWDTowageOnDeparture();
+ rootTowd.TowageOnDeparture[i].TowageOnDepartureName = towd.TowageOnDepartureName;
+ rootTowd.TowageOnDeparture[i].TowageOnDepartureFlag = towd.TowageOnDepartureFlag;
+ rootTowd.TowageOnDeparture[i].TowageOnDepartureOperator = new RootTOWDTowageOnDepartureTowageOnDepartureOperator();
+ rootTowd.TowageOnDeparture[i].TowageOnDepartureOperator.TowageOnDepartureOperatorCompanyName = towd.TowageOnDepartureOperatorCompanyName;
+ rootTowd.TowageOnDeparture[i].TowageOnDepartureOperator.TowageOnDepartureOperatorStreetAndNumber = towd.TowageOnDepartureOperatorStreetNameAndNumber;
+ rootTowd.TowageOnDeparture[i].TowageOnDepartureOperator.TowageOnDepartureOperatorPostalCode = towd.TowageOnDepartureOperatorPostalCode;
+ rootTowd.TowageOnDeparture[i].TowageOnDepartureOperator.TowageOnDepartureOperatorCity = towd.TowageOnDepartureOperatorCity;
+ rootTowd.TowageOnDeparture[i].TowageOnDepartureOperator.TowageOnDepartureOperatorCountry = towd.TowageOnDepartureOperatorCountry;
+ rootTowd.TowageOnDeparture[i].TowageOnDepartureOperator.TowageOnDepartureOperatorPhone = towd.TowageOnDepartureOperatorPhone;
+ rootTowd.TowageOnDeparture[i].TowageOnDepartureOperator.TowageOnDepartureOperatorFax = towd.TowageOnDepartureOperatorFax;
+ rootTowd.TowageOnDeparture[i].TowageOnDepartureOperator.TowageOnDepartureOperatorEMail = towd.TowageOnDepartureOperatorEmail;
+ if (towd.TowageOnDepartureLengthOverall_MTR.HasValue)
+ rootTowd.TowageOnDeparture[i].TowageOnDepartureLengthOverall_MTR = towd.TowageOnDepartureLengthOverall_MTR.Value;
+ if (towd.TowageOnDepartureBeam_MTR.HasValue)
+ rootTowd.TowageOnDeparture[i].TowageOnDepartureBeam_MTR = towd.TowageOnDepartureBeam_MTR.Value;
+ if (towd.TowageOnDepartureDraught_DMT.HasValue)
+ rootTowd.TowageOnDeparture[i].TowageOnDepartureDraught_DMT = towd.TowageOnDepartureDraught_DMT.Value;
+ rootTowd.TowageOnDeparture[i].TowageOnDepartureRemarks = towd.TowageOnDepartureRemarks;
+ }
+ item = rootTowd;
+ }
+ break;
+ #endregion
+
+
default:
{
- _log.ErrorFormat("DBH send message: message type {0} not implemented", aMessage.MessageNotificationClass);
- break;
+ _log.ErrorFormat("DBH send message: message type {0} not implemented", message.MessageNotificationClass);
+ return false;
}
}
@@ -290,30 +876,30 @@ namespace bsmd.dbh
items = new object[1];
items[0] = item;
- if (aMessage.MessageCore.IsTransit)
+ if (message.MessageCore.IsTransit)
{
- item = aMessage.MessageCore.TransitId;
+ item = message.MessageCore.TransitId;
itemChoiceType2 = ItemChoiceType2.TransitId;
}
else
{
- item = aMessage.MessageCore.VisitId;
+ item = message.MessageCore.VisitId;
itemChoiceType2 = ItemChoiceType2.VisitId;
}
}
string result = client.Root(
- version,
- timestamp,
+ version,
+ timestamp,
Properties.Settings.Default.Sender, // BSMD sender Kennung (festverdrahtet)
- senderReference,
+ senderReference,
rootType,
- item,
+ item,
itemChoiceType2,
null, // sisnumbers (weglassen)
- rp,
- items,
+ rp,
+ items,
null // violations (weglassen)
);
}
diff --git a/nsw/Source/bsmd.herberg.FormService/Program.cs b/nsw/Source/bsmd.herberg.FormService/Program.cs
index 252b9184..83ab3c76 100644
--- a/nsw/Source/bsmd.herberg.FormService/Program.cs
+++ b/nsw/Source/bsmd.herberg.FormService/Program.cs
@@ -27,8 +27,7 @@ namespace bsmd.herberg.FormService
if (Debugger.IsAttached)
{
// ((FormService)ServicesToRun[0]).Init(null);
- ((FormService)ServicesToRun[0]).DoOnce();
- while (true) ;
+ ((FormService)ServicesToRun[0]).DoOnce();
}
else
{
diff --git a/nsw/Source/bsmd.herberg.FormService/Util.cs b/nsw/Source/bsmd.herberg.FormService/Util.cs
index 30552d76..6f8afd36 100644
--- a/nsw/Source/bsmd.herberg.FormService/Util.cs
+++ b/nsw/Source/bsmd.herberg.FormService/Util.cs
@@ -37,6 +37,8 @@ namespace bsmd.herberg.FormService
for (int i = 0; i < formResponse.formDatasets.Length; i++)
{
Dictionary> groupedVals = new Dictionary>();
+ Dictionary>> groupedRowVals = new Dictionary>>();
+
WebReference.FormDataset fds = formResponse.formDatasets[i];
if (fds.startPeriodSpecified)
@@ -50,10 +52,28 @@ namespace bsmd.herberg.FormService
_log.WarnFormat("Field name {0} has wrong format!", formData.name);
continue;
}
- Trace.WriteLine(string.Format("Set:{0} Type:{1} Name:{2} Value:{3}", i, nElems[0], nElems[1], formData.value));
+
+ // create dictionaries on demand
if (!groupedVals.ContainsKey(nElems[0]))
groupedVals[nElems[0]] = new Dictionary();
- groupedVals[nElems[0]][nElems[1]] = formData.value;
+ if (!groupedRowVals.ContainsKey(nElems[0]))
+ groupedRowVals[nElems[0]] = new Dictionary>();
+ if (!groupedRowVals[nElems[0]].ContainsKey(formData.rowNo))
+ groupedRowVals[nElems[0]][formData.rowNo] = new Dictionary();
+
+ if (formData.rowNoSpecified == false)
+ {
+ // "normale" Felder werden pro Nachrichtentyp in einem Dict abgespeichert
+
+ groupedVals[nElems[0]][nElems[1]] = formData.value;
+ }
+ else
+ {
+ // "1:n" Felder (mit Zeilennummer) werden in einem Dict vDict = groupedVals[messageType];
+ Dictionary> nDict = groupedRowVals[messageType];
+
DatabaseEntity derivedMessage = null;
Message theMessage = null;
if (!messages.ContainsKey(messageType.ToUpper()))
@@ -157,12 +179,12 @@ namespace bsmd.herberg.FormService
{
try
{
- if (vDict.ContainsKey("CallPurposeCode")) noa_nod.CallPurposeCode = Int32.Parse(vDict["CallPurposeCode"]);
+ // if (vDict.ContainsKey("CallPurposeCode")) noa_nod.CallPurposeCode = Int32.Parse(vDict["CallPurposeCode"]);
if (vDict.ContainsKey("ETAToNextPort")) noa_nod.ETAToNextPort = DateTime.Parse(vDict["ETAToNextPort"]);
if (vDict.ContainsKey("ETDFromLastPort")) noa_nod.ETDFromLastPort = DateTime.Parse(vDict["ETDFromLastPort"]);
if (vDict.ContainsKey("ETAToPortOfCall")) noa_nod.ETAToPortOfCall = DateTime.Parse(vDict["ETAToPortOfCall"]);
if (vDict.ContainsKey("ETDFromPortOfCall")) noa_nod.ETDFromPortOfCall = DateTime.Parse(vDict["ETDFromPortOfCall"]);
- if (vDict.ContainsKey("CallPurposeDescription")) noa_nod.CallPurposeDescription = vDict["CallPurposeDescription"];
+ // if (vDict.ContainsKey("CallPurposeDescription")) noa_nod.CallPurposeDescription = vDict["CallPurposeDescription"];
// if(vDict.ContainsKey("CountryOfNextPort")) noa_nod. nicht relevant
if (vDict.ContainsKey("ETAToKielCanal")) noa_nod.ETAToKielCanal = DateTime.Parse(vDict["ETAToKielCanal"]);
if (vDict.ContainsKey("ETDFromKielCanal")) noa_nod.ETDFromKielCanal = DateTime.Parse(vDict["ETDFromKielCanal"]);
@@ -170,6 +192,13 @@ namespace bsmd.herberg.FormService
noa_nod.LastPort = vDict["CountryCodeOfLastPort"] + vDict["LastPortCode"];
if (vDict.ContainsKey("CountryCodeOfNextPort") && vDict.ContainsKey("NextPortCode"))
noa_nod.NextPort = vDict["CountryCodeOfNextPort"] + vDict["NextPortCode"];
+
+ foreach (int rowKey in nDict.Keys)
+ {
+ Dictionary subvDict = nDict[rowKey];
+
+ }
+
}
catch (Exception ex)
{
@@ -331,6 +360,31 @@ namespace bsmd.herberg.FormService
}
}
break;
+ case "CREW":
+ {
+ if (theMessage.Elements.Count == 0)
+ {
+ CREW newCREW = new CREW();
+ newCREW.MessageHeader = theMessage;
+ theMessage.MessageNotificationClass = Message.NotificationClass.CREW;
+ theMessage.Elements.Add(newCREW);
+ }
+ CREW crew = theMessage.Elements[0] as CREW;
+ derivedMessage = crew;
+ if (crew != null)
+ {
+ try
+ {
+ //crew.
+
+ }
+ catch (Exception ex)
+ {
+ _log.ErrorFormat("Error reading CREW fields: {0}", ex.Message);
+ }
+ }
+ }
+ break;
case "BKRD":
{
if (theMessage.Elements.Count == 0)
@@ -357,7 +411,30 @@ namespace bsmd.herberg.FormService
}
break;
case "WAS":
-
+ {
+ if(theMessage.Elements.Count == 0)
+ {
+ WAS newWAS = new WAS();
+ newWAS.MessageHeader = theMessage;
+ theMessage.MessageNotificationClass = Message.NotificationClass.WAS;
+ theMessage.Elements.Add(newWAS);
+ }
+ WAS was = theMessage.Elements[0] as WAS;
+ derivedMessage = was;
+ if(was != null)
+ {
+ try
+ {
+ if (vDict.ContainsKey("WasteDisposalValidExemption")) was.WasteDisposalValidExemption = vDict["WasteDisposalValidExemption"].Equals("Y");
+ if (vDict.ContainsKey("LastWasteDisposalDate")) was.LastWasteDisposalDate = DateTime.Parse(vDict["LastWasteDisposalDate"]);
+ if (vDict.ContainsKey("LastWasteDisposalPort")) was.LastWasteDisposalPort = vDict["LastWasteDisposalPort"];
+ }
+ catch(Exception ex)
+ {
+ _log.ErrorFormat("Error reading WAS fields: {0}", ex.Message);
+ }
+ }
+ }
break;
case "Visit":
{
diff --git a/nsw/dakosy/eDeclaration.xsd b/nsw/dakosy/eDeclaration.xsd
index 73521eeb..81fbf1a4 100644
--- a/nsw/dakosy/eDeclaration.xsd
+++ b/nsw/dakosy/eDeclaration.xsd
@@ -261,10 +261,7 @@
Zugestiegene Besatzungsmitglieder
Joined Crew members
-
-Validierungsregel wenn im Element "MessageType" der Wert "FULL" steht: Die Namen der zugestiegenen Besatzungsmitglieder müssen angegeben werden.
-
-
+ Validierungsregel wenn im Element "MessageType" der Wert "FULL" steht: Die Namen der zugestiegenen Besatzungsmitglieder müssen angegeben werden.
Validation rule if the element "MessageType" is "FULL": The name of the boarded crew members must be specified.
@@ -524,7 +521,7 @@ Validierungsregel wenn im Element "MessageType" der Wert "FULL" steht: Die Namen
- teilweise akzeptiert (partially accepted). Wird verwendet, wenn Meldeklassen teilweise an das NSW gesendet und akzeptiert wurden und teilweise mit Fehlermeldungen abgelehnt wurden. Details zu den abgelehnten Meldeklassen finden Sie im Element "Errors".
+ teilweise akzeptiert (partially accepted). Wird verwendet, wenn Meldeklassen teilweise an das NSW gesendet und akzeptiert wurden und teilweise mit Fehlermeldungen abgelehnt wurden. Details zu den abgelehnten Meldeklassen finden Sie im Element "Errors".
partially accepted: Used when notifications were partially sent to the NSW and accepted and partially rejected with error messages. Details about the rejected notifications can be found in item "Errors".
@@ -2694,7 +2691,7 @@ Alpha-2 code (two-digits flag code) in accordance with the standard ISO 3166-1)
Waste disposal order type
-
+
Schiffsabfälle/Ladungsrückstände (Für jede Art (Schiffsabfälle / Ladungsrückstände) ist genau ein Element anzugeben. Diese Formatvereinfachung dient nur der maschinellen (M2M) Übergabe der Informationen und ist für die Dateneingabe entsprechend der Vorschrift gemäß RL 2000/59 Art. 6 Anhang II umzusetzen.)