diff --git a/Stundensheet.xlsx b/Stundensheet.xlsx
index 9f9dfddb..b6e40248 100644
Binary files a/Stundensheet.xlsx and b/Stundensheet.xlsx differ
diff --git a/nsw/Source/SendNSWMessageService/SendNSWMessageService.csproj b/nsw/Source/SendNSWMessageService/SendNSWMessageService.csproj
index 6de75e28..5e0991d1 100644
--- a/nsw/Source/SendNSWMessageService/SendNSWMessageService.csproj
+++ b/nsw/Source/SendNSWMessageService/SendNSWMessageService.csproj
@@ -31,6 +31,12 @@
prompt
4
+
+ true
+
+
+ ..\bsmdKey.snk
+
..\packages\log4net.2.0.3\lib\net40-full\log4net.dll
@@ -80,6 +86,7 @@
Designer
+
SettingsSingleFileGenerator
diff --git a/nsw/Source/bsmd.dakosy/bsmd.dakosy.csproj b/nsw/Source/bsmd.dakosy/bsmd.dakosy.csproj
index 83567b49..e62c1286 100644
--- a/nsw/Source/bsmd.dakosy/bsmd.dakosy.csproj
+++ b/nsw/Source/bsmd.dakosy/bsmd.dakosy.csproj
@@ -29,6 +29,12 @@
prompt
4
+
+ true
+
+
+ ..\bsmdKey.snk
+
..\packages\log4net.2.0.3\lib\net40-full\log4net.dll
@@ -55,6 +61,7 @@
+
diff --git a/nsw/Source/bsmd.database/BPOL.cs b/nsw/Source/bsmd.database/BPOL.cs
new file mode 100644
index 00000000..90a6b5b8
--- /dev/null
+++ b/nsw/Source/bsmd.database/BPOL.cs
@@ -0,0 +1,98 @@
+//
+// Class: BPOL
+// Current CLR: 4.0.30319.34209
+// System: Microsoft Visual Studio 10.0
+// Author: dani
+// Created: 4/2/2015 9:01:11 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 BPOL : DatabaseEntity, IMessageClass
+ {
+
+ private List poi = new List();
+
+ public BPOL()
+ {
+ this.tablename = "[dbo].[BPOL]";
+ }
+
+ #region Properties
+
+ public Message MessageHeader { get; set; }
+
+ public bool? StowawaysOnBoard { get; set; }
+
+ public List PortOfItineraries { get { return this.poi; } }
+
+ #endregion
+
+ #region DatabaseEntity implementation
+
+ public override void PrepareSave(System.Data.IDbCommand cmd)
+ {
+
+ SqlCommand scmd = cmd as SqlCommand;
+
+ scmd.Parameters.AddWithValue("@P1", this.MessageHeader.Id);
+ scmd.Parameters.AddWithNullableValue("@P2", this.StowawaysOnBoard);
+
+ if (this.IsNew)
+ {
+ scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, StowawaysOnBoard) VALUES ( @P1, @P2 )",
+ this.Tablename);
+ }
+ else
+ {
+ scmd.Parameters.AddWithValue(@"ID", this.Id);
+ scmd.CommandText = string.Format("UPDATE {0} SET StowawaysOnBoard = @P2 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, StowawaysOnBoard FROM {0}", this.Tablename);
+
+ switch (filter)
+ {
+ case Message.LoadFilter.MESSAGEHEADER:
+ query += "WHERE MessageHeaderId = @MHID";
+ ((SqlCommand)cmd).Parameters.AddWithValue("@MHID", 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())
+ {
+ BPOL bpol = new BPOL();
+
+ bpol.id = reader.GetGuid(0);
+ if (!reader.IsDBNull(1)) bpol.StowawaysOnBoard = reader.GetBoolean(1);
+ result.Add(bpol);
+ }
+ reader.Close();
+ return result;
+ }
+
+ #endregion
+
+ }
+}
+
diff --git a/nsw/Source/bsmd.database/DBManager.cs b/nsw/Source/bsmd.database/DBManager.cs
index ebd6c593..92fc2fb2 100644
--- a/nsw/Source/bsmd.database/DBManager.cs
+++ b/nsw/Source/bsmd.database/DBManager.cs
@@ -19,7 +19,7 @@ namespace bsmd.database
{
private SqlConnection _con;
private static DBManager _instance;
- private ILog _log = LogManager.GetLogger(typeof(DBManager));
+ private static ILog _log = LogManager.GetLogger(typeof(DBManager));
#region Properties
@@ -170,6 +170,8 @@ namespace bsmd.database
}
}
+ #region CreateMessage()
+
///
/// factory method for messages by type
///
@@ -178,14 +180,41 @@ namespace bsmd.database
DatabaseEntity result = null;
switch (notificationClass)
{
+ case Message.NotificationClass.NOA_NOD: result = new NOA_NOD(); break;
+ case Message.NotificationClass.ATA: result = new ATA(); break;
+ case Message.NotificationClass.ATD: result = new ATD(); break;
+ case Message.NotificationClass.SEC: result = new SEC(); break;
+ case Message.NotificationClass.POBA: result = new POBA(); break;
+ case Message.NotificationClass.POBD: result = new POBD(); break;
+ case Message.NotificationClass.NAME: result = new NAME(); break;
+ case Message.NotificationClass.TIEFA: result = new TIEFA(); break;
+ case Message.NotificationClass.TIEFD: result = new TIEFD(); break;
+ case Message.NotificationClass.BKRA: result = new BRKA(); break;
+ case Message.NotificationClass.BKRD: result = new BRKD(); break;
case Message.NotificationClass.STAT: result = new STAT(); break;
- case Message.NotificationClass.NOA_NOD: result = new NOA_NOD(); break;
+ case Message.NotificationClass.LADG: result = new LADG(); break;
+ case Message.NotificationClass.INFO: result = new INFO(); break;
+ case Message.NotificationClass.SERV: result = new SERV(); break;
+ case Message.NotificationClass.PRE72H: result = new PRE72H(); break;
case Message.NotificationClass.MDH: result = new MDH(); break;
- default: break;
+ case Message.NotificationClass.WAS: result = new WAS(); break;
+ case Message.NotificationClass.CREW: result = new CREW(); break;
+ case Message.NotificationClass.PAS: result = new PAS(); break;
+ case Message.NotificationClass.BPOL: result = new BPOL(); break;
+ case Message.NotificationClass.TOWA: result = new TOWA(); break;
+ case Message.NotificationClass.TOWD: result = new TOWD(); break;
+
+ case Message.NotificationClass.HAZA:
+ case Message.NotificationClass.HAZD:
+ default:
+ _log.WarnFormat("CreateMessage: message type {0} is not supported", notificationClass.ToString());
+ break;
}
return result;
}
+ #endregion
+
///
/// Loads inner lists / collections
///
@@ -193,32 +222,109 @@ namespace bsmd.database
{
SqlCommand cmd = new SqlCommand();
- if(databaseEntity.GetType().IsAssignableFrom(typeof(MDH)))
+ #region MDH
+
+ if (databaseEntity.GetType().IsAssignableFrom(typeof(MDH)))
{
MDH mdh = databaseEntity as MDH;
- mdh.PrepareLoadCommand(cmd, Message.LoadFilter.MDH_ID);
+ PortOfCallLast30Days poc30 = new PortOfCallLast30Days();
+ poc30.PrepareLoadCommand(cmd, Message.LoadFilter.MDH_ID, mdh.Id);
SqlDataReader reader = this.PerformCommand(cmd);
- List poc30s = mdh.LoadList(reader);
- foreach (PortOfCallLast30Days poc30 in poc30s)
+ List poc30s = poc30.LoadList(reader);
+ foreach (PortOfCallLast30Days apoc30 in poc30s)
{
- mdh.PortOfCallLast30Days.Add(poc30);
- poc30.MDH = mdh;
- this.LoadDependingLists(poc30);
- }
+ mdh.PortOfCallLast30Days.Add(apoc30);
+ apoc30.MDH = mdh;
+ this.LoadDependingLists(apoc30);
+ }
}
- if(databaseEntity.GetType().IsAssignableFrom(typeof(PortOfCallLast30Days)))
+ #endregion
+
+ #region PortOfCallLast30Days
+
+ if (databaseEntity.GetType().IsAssignableFrom(typeof(PortOfCallLast30Days)))
{
PortOfCallLast30Days poc30 = databaseEntity as PortOfCallLast30Days;
- poc30.PrepareLoadCommand(cmd, Message.LoadFilter.POC30_ID);
+ PortOfCallLast30DaysCrewJoinedShip poc30s = new PortOfCallLast30DaysCrewJoinedShip();
+ poc30s.PrepareLoadCommand(cmd, Message.LoadFilter.POC30_ID, poc30.Id);
SqlDataReader reader = this.PerformCommand(cmd);
- List poc30Names = poc30.LoadList(reader);
+ List poc30Names = poc30s.LoadList(reader);
foreach (PortOfCallLast30DaysCrewJoinedShip poc30Name in poc30Names)
{
poc30.CrewJoinedShip.Add(poc30Name);
poc30Name.PortOfCallLast30Days = poc30;
}
}
+
+ #endregion
+
+ #region SEC
+
+ if (databaseEntity.GetType().IsAssignableFrom(typeof(SEC)))
+ {
+ SEC sec = databaseEntity as SEC;
+ LastTenPortFacilitiesCalled ltp = new LastTenPortFacilitiesCalled();
+ ltp.PrepareLoadCommand(cmd, Message.LoadFilter.SEC_ID, sec.Id);
+ SqlDataReader reader = this.PerformCommand(cmd);
+ List ltps = ltp.LoadList(reader);
+ foreach (LastTenPortFacilitiesCalled altp in ltps)
+ {
+ sec.LastTenPortFacilitesCalled.Add(altp);
+ altp.SEC = sec;
+ }
+
+ cmd = new SqlCommand();
+ ShipToShipActivitiesDuringLastTenPortFacilitiesCalled sts = new ShipToShipActivitiesDuringLastTenPortFacilitiesCalled();
+ sts.PrepareLoadCommand(cmd, Message.LoadFilter.SEC_ID, sec.Id);
+ reader = this.PerformCommand(cmd);
+ List stss = sts.LoadList(reader);
+ foreach (ShipToShipActivitiesDuringLastTenPortFacilitiesCalled asts in stss)
+ {
+ sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Add(asts);
+ asts.SEC = sec;
+ }
+ }
+
+ #endregion
+
+ #region WAS
+
+ if(databaseEntity.GetType().IsAssignableFrom(typeof(WAS)))
+ {
+ WAS was = databaseEntity as WAS;
+ WasteDisposalServiceProvider wdsp = new WasteDisposalServiceProvider();
+ wdsp.PrepareLoadCommand(cmd, Message.LoadFilter.WAS_ID, was.Id);
+ SqlDataReader reader = this.PerformCommand(cmd);
+ List wdsps = wdsp.LoadList(reader);
+ foreach (WasteDisposalServiceProvider awdsp in wdsps)
+ {
+ was.WasteDisposalServiceProvider.Add(awdsp);
+ awdsp.WAS = was;
+ this.LoadDependingLists(awdsp);
+ }
+ }
+
+ #endregion
+
+ #region WasteDisposalServiceProvider
+
+ if(databaseEntity.GetType().IsAssignableFrom(typeof(WasteDisposalServiceProvider)))
+ {
+ WasteDisposalServiceProvider wdsp = databaseEntity as WasteDisposalServiceProvider;
+ Waste waste = new Waste();
+ waste.PrepareLoadCommand(cmd, Message.LoadFilter.WDSP_ID, wdsp.Id);
+ SqlDataReader reader = this.PerformCommand(cmd);
+ List wastes = wdsp.LoadList(reader);
+ foreach (Waste aWaste in wastes)
+ {
+ wdsp.Waste.Add(aWaste);
+ aWaste.WasteDisposalServiceProvider = wdsp;
+ }
+ }
+
+ #endregion
+
}
internal void LoadErrorList(Message message)
@@ -243,6 +349,7 @@ namespace bsmd.database
message.ViolationList.Add(violation);
}
+ #region DB access methods
internal SqlDataReader PerformCommand(SqlCommand cmd)
{
@@ -272,9 +379,10 @@ namespace bsmd.database
System.Diagnostics.Trace.WriteLine("SQL Exception:" + ex.Message);
_log.Error("Error performing command", ex);
return -1;
- }
+ }
}
+ #endregion
#endregion
diff --git a/nsw/Source/bsmd.database/LastTenPortFacilitiesCalled.cs b/nsw/Source/bsmd.database/LastTenPortFacilitiesCalled.cs
new file mode 100644
index 00000000..12641649
--- /dev/null
+++ b/nsw/Source/bsmd.database/LastTenPortFacilitiesCalled.cs
@@ -0,0 +1,129 @@
+//
+// Class: LastTenPortFacilitiesCalled
+// Current CLR: 4.0.30319.34209
+// System: Microsoft Visual Studio 10.0
+// Author: dani
+// Created: 4/3/2015 10:11:28 AM
+//
+// 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 LastTenPortFacilitiesCalled : DatabaseEntity
+ {
+
+ public LastTenPortFacilitiesCalled()
+ {
+ this.tablename = "[dbo].[LastTenPortFacilitiesCalled]";
+ }
+
+ #region Properties
+
+ public SEC SEC { get; set; }
+
+ public string PortFacilityPortName { get; set; }
+
+ public string PortFacilityPortCode { get; set; }
+
+ public string PortFacilityPortLoCode { get; set; }
+
+ public DateTime? PortFacilityDateOfArrival { get; set; }
+
+ public DateTime? PortFacilityDateOfDeparture { get; set; }
+
+ public byte? PortFacilityShipSecurityLevel { get; set; }
+
+ public string PortFacilitySecurityMattersToReport { get; set; }
+
+ public string PortFacilityGISISCode { get; set; }
+
+ #endregion
+
+ #region DatabaseEntity implementation
+
+ public override void PrepareSave(System.Data.IDbCommand cmd)
+ {
+
+ SqlCommand scmd = cmd as SqlCommand;
+
+ scmd.Parameters.AddWithValue("@P1", this.SEC.Id);
+ scmd.Parameters.AddWithNullableValue("@P2", this.PortFacilityPortName);
+ scmd.Parameters.AddWithNullableValue("@P3", this.PortFacilityPortCode);
+ scmd.Parameters.AddWithNullableValue("@P4", this.PortFacilityPortLoCode);
+ scmd.Parameters.AddWithNullableValue("@P5", this.PortFacilityDateOfArrival);
+ scmd.Parameters.AddWithNullableValue("@P6", this.PortFacilityDateOfDeparture);
+ scmd.Parameters.AddWithNullableValue("@P7", this.PortFacilityShipSecurityLevel);
+ scmd.Parameters.AddWithNullableValue("@P8", this.PortFacilitySecurityMattersToReport);
+ scmd.Parameters.AddWithNullableValue("@P9", this.PortFacilityGISISCode);
+
+ if (this.IsNew)
+ {
+ scmd.CommandText = string.Format("INSERT INTO {0} (SEC_Id, PortFacilityPortName, PortFacilityPortCode, " +
+ "PortFacilityPortLoCode, PortFacilityDateOfArrival, PortFacilityDateOfDeparture, PortFacilityShipSecurityLevel, " +
+ "PortFacilitySecurityMattersToReport, PortFacilityGISISCode) VALUES ( @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9)",
+ this.Tablename);
+ }
+ else
+ {
+ scmd.Parameters.AddWithValue(@"ID", this.Id);
+ scmd.CommandText = string.Format("UPDATE {0} SET PortFacilityPortName = @P2, PortFacilityPortCode = @P3, " +
+ "PortFacilityPortLoCode = @P4, PortFacilityDateOfArrival = @P5, PortFacilityDateOfDeparture = @P6," +
+ "PortFacilityShipSecurityLevel = @P7, PortFacilitySecurityMattersToReport = @8, PortFacilityGISISCode = @P9 " +
+ " 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, PortFacilityPortName, PortFacilityPortCode, PortFacilityPortLoCode, " +
+ "PortFacilityDateOfArrival, PortFacilityDateOfDeparture, PortFacilityShipSecurityLevel, PortFacilitySecurityMattersToReport, " +
+ "PortFacilityGISISCode FROM {0}", this.Tablename);
+
+ switch (filter)
+ {
+ case Message.LoadFilter.SEC_ID:
+ query += "WHERE SEC_Id = @SECID";
+ ((SqlCommand)cmd).Parameters.AddWithValue("@SECID", 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())
+ {
+ LastTenPortFacilitiesCalled ltpfc = new LastTenPortFacilitiesCalled();
+
+ ltpfc.id = reader.GetGuid(0);
+ if (!reader.IsDBNull(1)) ltpfc.PortFacilityPortName = reader.GetString(1);
+ if (!reader.IsDBNull(2)) ltpfc.PortFacilityPortCode = reader.GetString(2);
+ if (!reader.IsDBNull(3)) ltpfc.PortFacilityPortLoCode = reader.GetString(3);
+ if (!reader.IsDBNull(4)) ltpfc.PortFacilityDateOfArrival = reader.GetDateTime(4);
+ if (!reader.IsDBNull(5)) ltpfc.PortFacilityDateOfDeparture = reader.GetDateTime(5);
+ if (!reader.IsDBNull(6)) ltpfc.PortFacilityShipSecurityLevel = reader.GetByte(6);
+ if (!reader.IsDBNull(7)) ltpfc.PortFacilitySecurityMattersToReport = reader.GetString(7);
+ if (!reader.IsDBNull(8)) ltpfc.PortFacilityGISISCode = reader.GetString(8);
+ result.Add(ltpfc);
+ }
+ reader.Close();
+ return result;
+ }
+
+ #endregion
+
+ }
+}
+
diff --git a/nsw/Source/bsmd.database/Message.cs b/nsw/Source/bsmd.database/Message.cs
index 65492815..cce40054 100644
--- a/nsw/Source/bsmd.database/Message.cs
+++ b/nsw/Source/bsmd.database/Message.cs
@@ -51,7 +51,8 @@ namespace bsmd.database
POC30_ID,
WAS_ID,
WDSP_ID,
- BPOL_ID
+ BPOL_ID,
+ SEC_ID
}
///
@@ -87,7 +88,7 @@ namespace bsmd.database
this.tablename = "[dbo].[MessageHeader]";
}
- #region Properties
+ #region Properties
///
/// Dieser Wert wird vom NSW / HIS vergeben
diff --git a/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs b/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs
index 2fb5c93c..b9c7b103 100644
--- a/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs
+++ b/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs
@@ -2,6 +2,6 @@
[assembly: AssemblyCompany("Informatikbüro Daniel Schick")]
[assembly: AssemblyProduct("bsmd.database")]
-[assembly: AssemblyInformationalVersion("1.0.0")]
+[assembly: AssemblyInformationalVersion("1.0.1")]
[assembly: AssemblyCopyright("Copyright © 2014-2015 Informatikbüro Daniel Schick. All rights reserved.")]
[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 dcb97ccc..c0768bed 100644
--- a/nsw/Source/bsmd.database/Properties/AssemblyProjectInfo.cs
+++ b/nsw/Source/bsmd.database/Properties/AssemblyProjectInfo.cs
@@ -4,5 +4,6 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.*")]
-[assembly: AssemblyFileVersion("1.0.0.*")]
+[assembly: AssemblyVersion("1.0.1.*")]
+// wenn das nicht auskommentiert wird erhalten wir eine Warnung
+// [assembly: AssemblyFileVersion("1.0.0.*")]
diff --git a/nsw/Source/bsmd.database/Properties/AssemblyProjectKeyInfo.cs b/nsw/Source/bsmd.database/Properties/AssemblyProjectKeyInfo.cs
index d446e9b0..cd26f977 100644
--- a/nsw/Source/bsmd.database/Properties/AssemblyProjectKeyInfo.cs
+++ b/nsw/Source/bsmd.database/Properties/AssemblyProjectKeyInfo.cs
@@ -26,6 +26,6 @@ using System.Runtime.CompilerServices;
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
-[assembly: AssemblyDelaySign(false)]
-[assembly: AssemblyKeyFile("")]
-[assembly: AssemblyKeyName("")]
\ No newline at end of file
+// [assembly: AssemblyDelaySign(false)]
+// [assembly: AssemblyKeyFile("..\bsmdKey.snk")]
+// [assembly: AssemblyKeyName("")]
\ No newline at end of file
diff --git a/nsw/Source/bsmd.database/SEC.cs b/nsw/Source/bsmd.database/SEC.cs
new file mode 100644
index 00000000..d608fb1f
--- /dev/null
+++ b/nsw/Source/bsmd.database/SEC.cs
@@ -0,0 +1,172 @@
+//
+// Class: SEC
+// Current CLR: 4.0.30319.34209
+// System: Microsoft Visual Studio 10.0
+// Author: dani
+// Created: 4/3/2015 10:11:02 AM
+//
+// 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 SEC : DatabaseEntity, IMessageClass
+ {
+
+ private List ltpfc = new List();
+
+ private List lsts = new List();
+
+ public SEC()
+ {
+ this.tablename = "[dbo].[SEC]";
+ }
+
+ #region Properties
+
+ public Message MessageHeader { get; set; }
+
+ public string SECSimplification { get; set; }
+
+ public string PortOfCallWhereCompleteSECNotified { get; set; }
+
+ public string CSOLastName { get; set; }
+
+ public string CSOFirstName { get; set; }
+
+ public string CSOPhone { get; set; }
+
+ public string CSOEMail { get; set; }
+
+ public bool? ValidISSCOnBoard { get; set; }
+
+ public string ReasonsForNoValidISSC { get; set; }
+
+ public byte? ISSCType { get; set; }
+
+ public byte? ISSCIssuerType { get; set; }
+
+ public string ISSCIssuerName { get; set; }
+
+ public DateTime? ISSCDateOfExpiration { get; set; }
+
+ public bool? ApprovedSecurityPlanOnBoard { get; set; }
+
+ public byte? CurrentShipSecurityLevel { get; set; }
+
+ public string PortFacilityOfArrival { get; set; }
+
+ public byte? GeneralDescriptionOfCargo { get; set; }
+
+ public List LastTenPortFacilitesCalled { get { return this.ltpfc; } }
+
+ public List ShipToShipActivitiesDuringLastTenPortFacilitiesCalled { get { return this.lsts; } }
+
+ #endregion
+
+ #region DatabaseEntity implementation
+
+ public override void PrepareSave(System.Data.IDbCommand cmd)
+ {
+
+ SqlCommand scmd = cmd as SqlCommand;
+
+ scmd.Parameters.AddWithValue("@P1", this.MessageHeader.Id);
+ scmd.Parameters.AddWithNullableValue("@P2", this.SECSimplification);
+ scmd.Parameters.AddWithNullableValue("@P3", this.PortOfCallWhereCompleteSECNotified);
+ scmd.Parameters.AddWithNullableValue("@P4", this.CSOLastName);
+ scmd.Parameters.AddWithNullableValue("@P5", this.CSOFirstName);
+ scmd.Parameters.AddWithNullableValue("@P6", this.CSOPhone);
+ scmd.Parameters.AddWithNullableValue("@P7", this.CSOEMail);
+ scmd.Parameters.AddWithNullableValue("@P8", this.ValidISSCOnBoard);
+ scmd.Parameters.AddWithNullableValue("@P9", this.ReasonsForNoValidISSC);
+ scmd.Parameters.AddWithNullableValue("@P10", this.ISSCType);
+ scmd.Parameters.AddWithNullableValue("@P11", this.ISSCIssuerType);
+ scmd.Parameters.AddWithNullableValue("@P12", this.ISSCIssuerName);
+ scmd.Parameters.AddWithNullableValue("@P13", this.ISSCDateOfExpiration);
+ scmd.Parameters.AddWithNullableValue("@P14", this.ApprovedSecurityPlanOnBoard);
+ scmd.Parameters.AddWithNullableValue("@P15", this.CurrentShipSecurityLevel);
+ scmd.Parameters.AddWithNullableValue("@P16", this.PortFacilityOfArrival);
+ scmd.Parameters.AddWithNullableValue("@P17", this.GeneralDescriptionOfCargo);
+
+ if (this.IsNew)
+ {
+ scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, SECSimplification, PortOfCallWhereCompleteSECNotified, " +
+ "CSOLastName, CSOFirstName, CSOPhone, CSOEMail, ValidISSCOnBoard, ReasonsForNoValidISSC, " +
+ "ISSCType, ISSCIssuerType, ISSCIssuerName,ISSCDateOfExpiration, ApprovedSecurityPlanOnBoard, " +
+ "CurrentShipSecurityLevel, PortFacilityOfArrival, GeneralDescriptionOfCargo) " +
+ "VALUES ( @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, @P12, @P13, @P14, @P15, @P16, @P17 )", this.Tablename);
+ }
+ else
+ {
+ scmd.Parameters.AddWithValue(@"ID", this.Id);
+ scmd.CommandText = string.Format("UPDATE {0} SET SECSimplification = @P2, PortOfCallWhereCompleteSECNotified = @P3, " +
+ "CSOLastName = @P4, CSOFirstName = @P5, CSOPhone = @P6," +
+ "CSOEMail = @P7, ValidISSCOnBoard = @8, ReasonsForNoValidISSC = @P9, " +
+ "ISSCType = @P10, ISSCIssuerType = @P11, ISSCIssuerName = @P12, ISSCDateOfExpiration = @P13, " +
+ "ApprovedSecurityPlanOnBoard = @P14, CurrentShipSecurityLevel = @P15, PortFacilityOfArrival = @P16, " +
+ "GeneralDescriptionOfCargo = @P17 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, SECSimplification, PortOfCallWhereCompleteSECNotified, CSOLastName, " +
+ "CSOFirstName, CSOPhone, CSOEMail, ValidISSCOnBoard, ReasonsForNoValidISSC, " +
+ "ISSCType, ISSCIssuerType, ISSCIssuerName, ISSCDateOfExpiration, ApprovedSecurityPlanOnBoard, " +
+ "CurrentShipSecurityLevel, PortFacilityOfArrival, GeneralDescriptionOfCargo FROM {0}", this.Tablename);
+
+ switch (filter)
+ {
+ case Message.LoadFilter.MESSAGEHEADER:
+ query += "WHERE MessageHeaderId = @MHID";
+ ((SqlCommand)cmd).Parameters.AddWithValue("@MHID", 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())
+ {
+ SEC sec = new SEC();
+
+ sec.id = reader.GetGuid(0);
+ if (!reader.IsDBNull(1)) sec.SECSimplification = reader.GetString(1);
+ if (!reader.IsDBNull(2)) sec.PortOfCallWhereCompleteSECNotified = reader.GetString(2);
+ if (!reader.IsDBNull(3)) sec.CSOLastName = reader.GetString(3);
+ if (!reader.IsDBNull(4)) sec.CSOFirstName = reader.GetString(4);
+ if (!reader.IsDBNull(5)) sec.CSOPhone = reader.GetString(5);
+ if (!reader.IsDBNull(6)) sec.CSOEMail = reader.GetString(6);
+ if (!reader.IsDBNull(7)) sec.ValidISSCOnBoard = reader.GetBoolean(7);
+ if (!reader.IsDBNull(8)) sec.ReasonsForNoValidISSC = reader.GetString(8);
+ if (!reader.IsDBNull(9)) sec.ISSCType = reader.GetByte(9);
+ if (!reader.IsDBNull(9)) sec.ISSCIssuerType = reader.GetByte(9);
+ if (!reader.IsDBNull(9)) sec.ISSCIssuerName = reader.GetString(9);
+ if (!reader.IsDBNull(9)) sec.ISSCDateOfExpiration = reader.GetDateTime(9);
+ if (!reader.IsDBNull(9)) sec.ApprovedSecurityPlanOnBoard = reader.GetBoolean(9);
+ if (!reader.IsDBNull(9)) sec.CurrentShipSecurityLevel = reader.GetByte(9);
+ if (!reader.IsDBNull(9)) sec.PortFacilityOfArrival = reader.GetString(9);
+ if (!reader.IsDBNull(9)) sec.GeneralDescriptionOfCargo = reader.GetByte(9);
+ result.Add(sec);
+ }
+ reader.Close();
+ return result;
+ }
+
+ #endregion
+
+ }
+}
diff --git a/nsw/Source/bsmd.database/ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.cs b/nsw/Source/bsmd.database/ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.cs
new file mode 100644
index 00000000..a8b3a581
--- /dev/null
+++ b/nsw/Source/bsmd.database/ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.cs
@@ -0,0 +1,128 @@
+//
+// Class: ShipToShipActivitiesDuringLastTenPortFacilitiesCalled
+// Current CLR: 4.0.30319.34209
+// System: Microsoft Visual Studio 10.0
+// Author: dani
+// Created: 4/3/2015 12:01:28 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 ShipToShipActivitiesDuringLastTenPortFacilitiesCalled : DatabaseEntity
+ {
+
+ public ShipToShipActivitiesDuringLastTenPortFacilitiesCalled()
+ {
+ this.tablename = "[dbo].[ShipToShipActivitiesDuringLastTenPortFacilitiesCalled]";
+ }
+
+ #region Properties
+
+ public SEC SEC { get; set; }
+
+ public string ShipToShipActivityLocationName { get; set; }
+
+ public string ShipToShipActivityLocationLoCode { get; set; }
+
+ public int? ShipToShipActivityLocationCoordinatesLatitude { get; set; }
+
+ public int? ShipToShipActivityLocationCoordinatesLongitude { get; set; }
+
+ public DateTime? ShipToShipActivityDateFrom { get; set; }
+
+ public DateTime? ShipToShipActivityDateTo { get; set; }
+
+ public string ShipToShipActivityType { get; set; }
+
+ public string ShipToShipActivitySecurityMattersToReport { get; set; }
+
+ #endregion
+
+ #region DatabaseEntity implementation
+
+ public override void PrepareSave(System.Data.IDbCommand cmd)
+ {
+
+ SqlCommand scmd = cmd as SqlCommand;
+
+ scmd.Parameters.AddWithValue("@P1", this.SEC.Id);
+ scmd.Parameters.AddWithNullableValue("@P2", this.ShipToShipActivityLocationName);
+ scmd.Parameters.AddWithNullableValue("@P3", this.ShipToShipActivityLocationLoCode);
+ scmd.Parameters.AddWithNullableValue("@P4", this.ShipToShipActivityLocationCoordinatesLatitude);
+ scmd.Parameters.AddWithNullableValue("@P5", this.ShipToShipActivityLocationCoordinatesLongitude);
+ scmd.Parameters.AddWithNullableValue("@P6", this.ShipToShipActivityDateFrom);
+ scmd.Parameters.AddWithNullableValue("@P7", this.ShipToShipActivityDateTo);
+ scmd.Parameters.AddWithNullableValue("@P8", this.ShipToShipActivityType);
+ scmd.Parameters.AddWithNullableValue("@P9", this.ShipToShipActivitySecurityMattersToReport);
+
+ if (this.IsNew)
+ {
+ scmd.CommandText = string.Format("INSERT INTO {0} (SEC_Id, ShipToShipActivityLocationName, ShipToShipActivityLocationLoCode, " +
+ "ShipToShipActivityLocationCoordinatesLatitude, ShipToShipActivityLocationCoordinatesLongitude, ShipToShipActivityDateFrom, ShipToShipActivityDateTo, " +
+ "ShipToShipActivityType, ShipToShipActivitySecurityMattersToReport) VALUES ( @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9)",
+ this.Tablename);
+ }
+ else
+ {
+ scmd.Parameters.AddWithValue(@"ID", this.Id);
+ scmd.CommandText = string.Format("UPDATE {0} SET ShipToShipActivityLocationName = @P2, ShipToShipActivityLocationLoCode = @P3, " +
+ "ShipToShipActivityLocationCoordinatesLatitude = @P4, ShipToShipActivityLocationCoordinatesLongitude = @P5, ShipToShipActivityDateFrom = @P6," +
+ "ShipToShipActivityDateTo = @P7, ShipToShipActivityType = @8, ShipToShipActivitySecurityMattersToReport = @P9 " +
+ " 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, ShipToShipActivityLocationName, ShipToShipActivityLocationLoCode, ShipToShipActivityLocationCoordinatesLatitude, " +
+ "ShipToShipActivityLocationCoordinatesLongitude, ShipToShipActivityDateFrom, ShipToShipActivityDateTo, ShipToShipActivityType, " +
+ "ShipToShipActivitySecurityMattersToReport FROM {0}", this.Tablename);
+
+ switch (filter)
+ {
+ case Message.LoadFilter.SEC_ID:
+ query += "WHERE SEC_Id = @SECID";
+ ((SqlCommand)cmd).Parameters.AddWithValue("@SECID", 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())
+ {
+ ShipToShipActivitiesDuringLastTenPortFacilitiesCalled sts = new ShipToShipActivitiesDuringLastTenPortFacilitiesCalled();
+
+ sts.id = reader.GetGuid(0);
+ if (!reader.IsDBNull(1)) sts.ShipToShipActivityLocationName = reader.GetString(1);
+ if (!reader.IsDBNull(2)) sts.ShipToShipActivityLocationLoCode = reader.GetString(2);
+ if (!reader.IsDBNull(3)) sts.ShipToShipActivityLocationCoordinatesLatitude = reader.GetInt32(3);
+ if (!reader.IsDBNull(4)) sts.ShipToShipActivityLocationCoordinatesLongitude = reader.GetInt32(4);
+ if (!reader.IsDBNull(5)) sts.ShipToShipActivityDateFrom = reader.GetDateTime(5);
+ if (!reader.IsDBNull(6)) sts.ShipToShipActivityDateTo = reader.GetDateTime(6);
+ if (!reader.IsDBNull(7)) sts.ShipToShipActivityType = reader.GetString(7);
+ if (!reader.IsDBNull(8)) sts.ShipToShipActivitySecurityMattersToReport = reader.GetString(8);
+ result.Add(sts);
+ }
+ reader.Close();
+ return result;
+ }
+
+ #endregion
+
+ }
+}
\ No newline at end of file
diff --git a/nsw/Source/bsmd.database/bsmd.database.csproj b/nsw/Source/bsmd.database/bsmd.database.csproj
index bdb16dd4..9cdabfe6 100644
--- a/nsw/Source/bsmd.database/bsmd.database.csproj
+++ b/nsw/Source/bsmd.database/bsmd.database.csproj
@@ -29,6 +29,12 @@
prompt
4
+
+ true
+
+
+ ..\bsmdKey.snk
+
..\packages\log4net.2.0.3\lib\net40-full\log4net.dll
@@ -45,6 +51,7 @@
+
@@ -75,7 +82,9 @@
+
+
@@ -88,6 +97,7 @@
+
diff --git a/nsw/Source/bsmd.dbh/bsmd.dbh.csproj b/nsw/Source/bsmd.dbh/bsmd.dbh.csproj
index d5726798..06c9c83d 100644
--- a/nsw/Source/bsmd.dbh/bsmd.dbh.csproj
+++ b/nsw/Source/bsmd.dbh/bsmd.dbh.csproj
@@ -29,6 +29,12 @@
prompt
4
+
+ true
+
+
+ ..\bsmdKey.snk
+
..\packages\log4net.2.0.3\lib\net40-full\log4net.dll
@@ -64,6 +70,7 @@
+
diff --git a/nsw/Source/bsmdKey.snk b/nsw/Source/bsmdKey.snk
new file mode 100644
index 00000000..fd20ba24
Binary files /dev/null and b/nsw/Source/bsmdKey.snk differ