2.4.18 Korrekturen und Arbeit an Excel Reader
This commit is contained in:
parent
e3de127046
commit
6215d1b77a
17
nsw/Source/SQL/Update_2.4.14_To_3.0.sql
Normal file
17
nsw/Source/SQL/Update_2.4.14_To_3.0.sql
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
CREATE TABLE [dbo].[AGNT] (
|
||||||
|
[Id] UNIQUEIDENTIFIER CONSTRAINT [DF_AGNT_Id] DEFAULT (newid()) ROWGUIDCOL NOT NULL,
|
||||||
|
[MessageHeaderId] UNIQUEIDENTIFIER NULL,
|
||||||
|
[AgentCompanyName] NVARCHAR (100) NULL,
|
||||||
|
[AgentStreetAndNumber] NVARCHAR (100) NULL,
|
||||||
|
[AgentPostalCode] NVARCHAR (25) NULL,
|
||||||
|
[AgentCity] NVARCHAR (100) NULL,
|
||||||
|
[AgentCountry] NVARCHAR (100) NULL,
|
||||||
|
[AgentLastName] NVARCHAR (100) NULL,
|
||||||
|
[AgentFirstName] NVARCHAR (100) NULL,
|
||||||
|
[AgentPhone] NVARCHAR (100) NULL,
|
||||||
|
[AgentFax] NVARCHAR (100) NULL,
|
||||||
|
[AgentEMail] NVARCHAR (100) NULL,
|
||||||
|
|
||||||
|
CONSTRAINT [PK_AGNT] PRIMARY KEY CLUSTERED ([Id] ASC),
|
||||||
|
CONSTRAINT [FK_AGNT_MessageHeader] FOREIGN KEY ([MessageHeaderId]) REFERENCES [dbo].[MessageHeader] ([Id])
|
||||||
|
);
|
||||||
@ -37,15 +37,15 @@ namespace bsmd.ExcelReadService
|
|||||||
{
|
{
|
||||||
// scan for transit messages
|
// scan for transit messages
|
||||||
|
|
||||||
// AGNT
|
ScanAGNT(messages, messageCore, reader);
|
||||||
|
|
||||||
// NOA_NOD
|
// NOA_NOD
|
||||||
|
|
||||||
// SEC
|
// SEC
|
||||||
|
|
||||||
// POBA
|
ScanPOBA(messages, messageCore, reader);
|
||||||
|
|
||||||
// POBD
|
ScanPOBD(messages, messageCore, reader);
|
||||||
|
|
||||||
ScanTIEFA(messages, messageCore, reader);
|
ScanTIEFA(messages, messageCore, reader);
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ namespace bsmd.ExcelReadService
|
|||||||
{
|
{
|
||||||
// scan for visit messages
|
// scan for visit messages
|
||||||
|
|
||||||
// AGNT
|
ScanAGNT(messages, messageCore, reader);
|
||||||
|
|
||||||
// NOA_NOD
|
// NOA_NOD
|
||||||
|
|
||||||
@ -82,9 +82,9 @@ namespace bsmd.ExcelReadService
|
|||||||
|
|
||||||
// SEC
|
// SEC
|
||||||
|
|
||||||
// POBA
|
ScanPOBA(messages, messageCore, reader);
|
||||||
|
|
||||||
// POBD
|
ScanPOBD(messages, messageCore, reader);
|
||||||
|
|
||||||
ScanNAME(messages, messageCore, reader);
|
ScanNAME(messages, messageCore, reader);
|
||||||
|
|
||||||
@ -129,19 +129,18 @@ namespace bsmd.ExcelReadService
|
|||||||
//string sheetVersion = reader.GetCell("Portcall", 2, 1) as string;
|
//string sheetVersion = reader.GetCell("Portcall", 2, 1) as string;
|
||||||
//messageCore.SietasSheetVersion = sheetVersion;
|
//messageCore.SietasSheetVersion = sheetVersion;
|
||||||
|
|
||||||
|
DBManager.Instance.Save(messageCore);
|
||||||
|
|
||||||
// save all messages now
|
// save all messages now
|
||||||
|
|
||||||
foreach(Message message in messages)
|
foreach(Message message in messages)
|
||||||
{
|
{
|
||||||
DBManager.Instance.Save(message);
|
DBManager.Instance.Save(message);
|
||||||
|
|
||||||
// TODO: Die abhängigen Listen müssen auch gespeichert werden
|
message.SaveElements();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DBManager.Instance.Save(messageCore);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,6 +239,46 @@ namespace bsmd.ExcelReadService
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region POBA
|
||||||
|
|
||||||
|
static void ScanPOBA(List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
||||||
|
{
|
||||||
|
Message pobaMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.POBA);
|
||||||
|
if(pobaMessage.Elements.Count == 0)
|
||||||
|
{
|
||||||
|
POBA newPoba = new POBA();
|
||||||
|
newPoba.MessageHeader = pobaMessage;
|
||||||
|
pobaMessage.Elements.Add(newPoba);
|
||||||
|
}
|
||||||
|
|
||||||
|
POBA poba = pobaMessage.Elements[0] as POBA;
|
||||||
|
Util.ScanMessage(poba, reader);
|
||||||
|
if (((poba.TotalPersonsOnBoardUponArrival ?? 0) == 0) && poba.IsNew)
|
||||||
|
messages.Remove(pobaMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region POBD
|
||||||
|
|
||||||
|
static void ScanPOBD(List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
||||||
|
{
|
||||||
|
Message pobdMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.POBD);
|
||||||
|
if(pobdMessage.Elements.Count == 0)
|
||||||
|
{
|
||||||
|
POBD newPobd = new POBD();
|
||||||
|
newPobd.MessageHeader = pobdMessage;
|
||||||
|
pobdMessage.Elements.Add(newPobd);
|
||||||
|
}
|
||||||
|
|
||||||
|
POBD pobd = pobdMessage.Elements[0] as POBD;
|
||||||
|
Util.ScanMessage(pobd, reader);
|
||||||
|
if (((pobd.TotalPersonsOnBoardUponDeparture ?? 0) == 0) && pobd.IsNew)
|
||||||
|
messages.Remove(pobdMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region STAT
|
#region STAT
|
||||||
|
|
||||||
static void ScanSTAT(List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
static void ScanSTAT(List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
||||||
@ -268,6 +307,88 @@ namespace bsmd.ExcelReadService
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region AGNT
|
||||||
|
|
||||||
|
static void ScanAGNT(List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
||||||
|
{
|
||||||
|
Message agntMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.AGNT);
|
||||||
|
if(agntMessage.Elements.Count == 0)
|
||||||
|
{
|
||||||
|
AGNT newAgnt = new AGNT();
|
||||||
|
newAgnt.MessageHeader = agntMessage;
|
||||||
|
agntMessage.Elements.Add(newAgnt);
|
||||||
|
}
|
||||||
|
AGNT agnt = agntMessage.Elements[0] as AGNT;
|
||||||
|
Util.ScanMessage(agnt, reader);
|
||||||
|
// wird nicht mehr entfernt, egal welche Felder gelesen werden
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region MDH
|
||||||
|
|
||||||
|
static void ScanMDH(List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
||||||
|
{
|
||||||
|
Message mdhMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.MDH);
|
||||||
|
if(mdhMessage.Elements.Count == 0)
|
||||||
|
{
|
||||||
|
MDH newMDH = new MDH();
|
||||||
|
newMDH.MessageHeader = mdhMessage;
|
||||||
|
mdhMessage.Elements.Add(newMDH);
|
||||||
|
}
|
||||||
|
MDH mdh = mdhMessage.Elements[0] as MDH;
|
||||||
|
Util.ScanMessage(mdh, reader);
|
||||||
|
|
||||||
|
// POC last 30 days
|
||||||
|
for (int i = 0; i < 15; i++)
|
||||||
|
{
|
||||||
|
string portName = string.Format("MDH.PortOfCallLast30DaysPort_{0}", i + 1);
|
||||||
|
string portCountry = string.Format("MDH.PortOfCallLast30DaysCountry_{0}", i + 1);
|
||||||
|
string locode = string.Format("MDH.PortOfCallLast30DaysLocode_{0}", i + 1);
|
||||||
|
string crewJoined = string.Format("MDH.PortOfCallLast30DaysCrewMembersJoined_{0}", i + 1);
|
||||||
|
string crewName = string.Format("MDH.PortOfCallLast30DaysCrewJoinedShipName_{0}", i + 1);
|
||||||
|
string depDate = string.Format("MDH.PortOfCallLast30DaysDateOfDeparture_{0}", i + 1);
|
||||||
|
|
||||||
|
PortOfCallLast30Days poc30d = mdh.GetSublistElementWithIdentifier((i + 1).ToString()) as PortOfCallLast30Days;
|
||||||
|
if (poc30d == null)
|
||||||
|
{
|
||||||
|
poc30d = new PortOfCallLast30Days();
|
||||||
|
poc30d.Identifier = (i + 1).ToString();
|
||||||
|
poc30d.MessageHeader = mdhMessage;
|
||||||
|
mdh.PortOfCallLast30Days.Add(poc30d);
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO! geht nicht weil sich der Index ändert und das Namensattribut konstant ist
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Util.ScanMessage(poc30d, reader);
|
||||||
|
|
||||||
|
// Leer/def. Zeilen entfernen
|
||||||
|
if (!poc30d.PortOfCallLast30DaysDateOfDeparture.HasValue && (poc30d.PortOfCallLast30DaysLocode == null))
|
||||||
|
mdh.PortOfCallLast30Days.Remove(poc30d);
|
||||||
|
|
||||||
|
string crewJoinedText = reader.ReadText(crewName);
|
||||||
|
if (!crewJoinedText.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
PortOfCallLast30DaysCrewJoinedShip poc30C = mdh.GetSublistElementWithIdentifier("1") as PortOfCallLast30DaysCrewJoinedShip;
|
||||||
|
if (poc30C == null)
|
||||||
|
{
|
||||||
|
poc30C = new PortOfCallLast30DaysCrewJoinedShip();
|
||||||
|
poc30C.PortOfCallLast30Days = poc30d;
|
||||||
|
poc30d.CrewJoinedShip.Add(poc30C);
|
||||||
|
}
|
||||||
|
poc30C.PortOfCallLast30DaysCrewJoinedShipName = crewJoinedText;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// wird nicht wieder entfernt falls keine Daten vorliegen
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region BKRA
|
#region BKRA
|
||||||
|
|
||||||
static void ScanBKRA(List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
static void ScanBKRA(List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
||||||
|
|||||||
@ -236,13 +236,24 @@ namespace bsmd.ReportGenerator
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Einzelne Seite in Landscape für PAS Meldung
|
||||||
|
if ((message != null) && (message.MessageNotificationClass == Message.NotificationClass.PAS))
|
||||||
|
{
|
||||||
|
// Landscape!
|
||||||
|
BSMDDocument.DefineContentSection(document, Orientation.Landscape, false);
|
||||||
|
|
||||||
|
document.LastSection.AddParagraph(messageParagraph.Title, "Heading2");
|
||||||
|
document.LastSection.AddParagraph(messageParagraph.Subtitle, "Heading3");
|
||||||
|
|
||||||
|
BSMDDocument.CreatePassengerTable(document, message);
|
||||||
|
|
||||||
|
BSMDDocument.DefineContentSection(document, Orientation.Portrait, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
document.LastSection.AddParagraph(messageParagraph.Title, "Heading2");
|
document.LastSection.AddParagraph(messageParagraph.Title, "Heading2");
|
||||||
document.LastSection.AddParagraph(messageParagraph.Subtitle, "Heading3");
|
document.LastSection.AddParagraph(messageParagraph.Subtitle, "Heading3");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Spezialbehandlung WAS Meldung
|
// Spezialbehandlung WAS Meldung
|
||||||
if ((message != null) && (message.MessageNotificationClass == Message.NotificationClass.WAS))
|
if ((message != null) && (message.MessageNotificationClass == Message.NotificationClass.WAS))
|
||||||
{
|
{
|
||||||
@ -353,6 +364,75 @@ namespace bsmd.ReportGenerator
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region PAS
|
||||||
|
private static void CreatePassengerTable(Document document, Message message)
|
||||||
|
{
|
||||||
|
Table table = document.LastSection.AddTable();
|
||||||
|
table.Rows.VerticalAlignment = VerticalAlignment.Center;
|
||||||
|
table.Borders.Visible = true;
|
||||||
|
|
||||||
|
Column column = table.AddColumn();
|
||||||
|
column.Width = Unit.FromCentimeter(0.8);
|
||||||
|
column = table.AddColumn();
|
||||||
|
column.Width = Unit.FromCentimeter(3);
|
||||||
|
column = table.AddColumn();
|
||||||
|
column.Width = Unit.FromCentimeter(3);
|
||||||
|
column = table.AddColumn();
|
||||||
|
column.Width = Unit.FromCentimeter(3);
|
||||||
|
column = table.AddColumn();
|
||||||
|
column.Width = Unit.FromCentimeter(2);
|
||||||
|
column = table.AddColumn();
|
||||||
|
column.Width = Unit.FromCentimeter(2);
|
||||||
|
column = table.AddColumn();
|
||||||
|
column.Width = Unit.FromCentimeter(1);
|
||||||
|
column = table.AddColumn();
|
||||||
|
column.Width = Unit.FromCentimeter(2);
|
||||||
|
column = table.AddColumn();
|
||||||
|
column.Width = Unit.FromCentimeter(3);
|
||||||
|
column = table.AddColumn();
|
||||||
|
column.Width = Unit.FromCentimeter(1.8);
|
||||||
|
column = table.AddColumn();
|
||||||
|
column.Width = Unit.FromCentimeter(1.5);
|
||||||
|
column = table.AddColumn();
|
||||||
|
column.Width = Unit.FromCentimeter(1.5);
|
||||||
|
column = table.AddColumn();
|
||||||
|
column.Width = Unit.FromCentimeter(0.5);
|
||||||
|
|
||||||
|
Row hRow = table.AddRow();
|
||||||
|
hRow.Cells[1].AddParagraph("Last name");
|
||||||
|
hRow.Cells[2].AddParagraph("First name");
|
||||||
|
hRow.Cells[3].AddParagraph("Place of birth");
|
||||||
|
hRow.Cells[4].AddParagraph("Date of birth");
|
||||||
|
hRow.Cells[5].AddParagraph("Gender");
|
||||||
|
hRow.Cells[6].AddParagraph("Nat.");
|
||||||
|
hRow.Cells[7].AddParagraph("Id doc. type");
|
||||||
|
hRow.Cells[8].AddParagraph("Id doc. number");
|
||||||
|
hRow.Cells[9].AddParagraph("Visa number");
|
||||||
|
hRow.Cells[10].AddParagraph("Emb.");
|
||||||
|
hRow.Cells[11].AddParagraph("Disemb.");
|
||||||
|
hRow.Cells[12].AddParagraph("T");
|
||||||
|
|
||||||
|
for (int i = 0; i < message.Elements.Count; i++)
|
||||||
|
{
|
||||||
|
PAS pas = message.Elements[i] as PAS;
|
||||||
|
Row row = table.AddRow();
|
||||||
|
row.Cells[0].AddParagraph((i + 1).ToString());
|
||||||
|
row.Cells[1].AddParagraph(pas.PassengerLastName ?? "");
|
||||||
|
row.Cells[2].AddParagraph(pas.PassengerFirstName ?? "");
|
||||||
|
row.Cells[3].AddParagraph(pas.PassengerPlaceOfBirth ?? "");
|
||||||
|
row.Cells[4].AddParagraph(pas.PassengerDateOfBirthDisplay);
|
||||||
|
row.Cells[5].AddParagraph(pas.PassengerGenderDisplay);
|
||||||
|
row.Cells[6].AddParagraph(pas.PassengerNationality ?? "");
|
||||||
|
row.Cells[7].AddParagraph(pas.PassengerIdentityDocumentTypeDisplay);
|
||||||
|
row.Cells[8].AddParagraph(pas.PassengerIdentityDocumentId ?? "");
|
||||||
|
row.Cells[9].AddParagraph(pas.PassengerVisaNumber ?? "");
|
||||||
|
row.Cells[10].AddParagraph(pas.PassengerPortOfEmbarkation ?? "");
|
||||||
|
row.Cells[11].AddParagraph(pas.PassengerPortOfDisembarkation ?? "");
|
||||||
|
row.Cells[12].AddParagraph(pas.PassengerInTransit ?? false ? "X" : "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region MDH
|
#region MDH
|
||||||
|
|
||||||
private static void CreatePoCLast30DaysTable(Document document, Message message)
|
private static void CreatePoCLast30DaysTable(Document document, Message message)
|
||||||
|
|||||||
170
nsw/Source/bsmd.database/AGNT.cs
Normal file
170
nsw/Source/bsmd.database/AGNT.cs
Normal file
@ -0,0 +1,170 @@
|
|||||||
|
//
|
||||||
|
// Class: AGNT
|
||||||
|
// Current CLR: 4.0.30319.42000
|
||||||
|
// System: Microsoft Visual Studio 10.0
|
||||||
|
// Author: dani
|
||||||
|
// Created: 1/31/2016 8:08:31 PM
|
||||||
|
//
|
||||||
|
// Copyright (c) 2016 Informatikbüro Daniel Schick. All rights reserved.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
|
||||||
|
namespace bsmd.database
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// message class for ship agent, new in NSW 3.0 (March 2016)
|
||||||
|
/// </summary>
|
||||||
|
public class AGNT : DatabaseEntity
|
||||||
|
{
|
||||||
|
|
||||||
|
#region Construction
|
||||||
|
|
||||||
|
public AGNT()
|
||||||
|
{
|
||||||
|
this.tablename = "[dbo].[AGNT]";
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Properties
|
||||||
|
|
||||||
|
[ShowReport]
|
||||||
|
[Validation2(ValidationCode.NOT_NULL)]
|
||||||
|
[LookupName("AGNT.AgentCompanyName")]
|
||||||
|
public string AgentCompanyName { get; set; }
|
||||||
|
|
||||||
|
[ShowReport]
|
||||||
|
[LookupName("AGNT.AgentStreetAndNumber")]
|
||||||
|
public string AgentStreetAndNumber { get; set; }
|
||||||
|
|
||||||
|
[ShowReport]
|
||||||
|
[LookupName("AGNT.AgentPostalCode")]
|
||||||
|
public string AgentPostalCode { get; set; }
|
||||||
|
|
||||||
|
[ShowReport]
|
||||||
|
[LookupName("AGNT.AgentCity")]
|
||||||
|
public string AgentCity { get; set; }
|
||||||
|
|
||||||
|
[ShowReport]
|
||||||
|
[LookupName("AGNT.AgentCountry")]
|
||||||
|
public string AgentCountry { get; set; }
|
||||||
|
|
||||||
|
[ShowReport]
|
||||||
|
[LookupName("AGNT.AgentLastName")]
|
||||||
|
[Validation2(ValidationCode.NOT_NULL)]
|
||||||
|
public string AgentLastName { get; set; }
|
||||||
|
|
||||||
|
[ShowReport]
|
||||||
|
[LookupName("AGNT.AgentFirstName")]
|
||||||
|
public string AgentFirstName { get; set; }
|
||||||
|
|
||||||
|
[ShowReport]
|
||||||
|
[Validation2(ValidationCode.NOT_NULL)]
|
||||||
|
[LookupName("AGNT.AgentPhone")]
|
||||||
|
public string AgentPhone { get; set; }
|
||||||
|
|
||||||
|
[ShowReport]
|
||||||
|
[LookupName("AGNT.AgentFax")]
|
||||||
|
public string AgentFax { get; set; }
|
||||||
|
|
||||||
|
[ShowReport]
|
||||||
|
[LookupName("AGNT.AgentEMail")]
|
||||||
|
public string AgentEMail { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region DatabaseEntity implementation
|
||||||
|
|
||||||
|
public override void PrepareSave(System.Data.IDbCommand cmd)
|
||||||
|
{
|
||||||
|
SqlCommand scmd = cmd as SqlCommand;
|
||||||
|
|
||||||
|
scmd.Parameters.AddWithValue("@P1", this.MessageHeader.Id);
|
||||||
|
if (this.AgentCompanyName != null) scmd.Parameters.AddWithValue("@P2", this.AgentCompanyName);
|
||||||
|
else scmd.Parameters.AddWithValue("@P2", DBNull.Value);
|
||||||
|
if (this.AgentStreetAndNumber != null) scmd.Parameters.AddWithValue("@P3", this.AgentStreetAndNumber);
|
||||||
|
else scmd.Parameters.AddWithValue("@P3", DBNull.Value);
|
||||||
|
if (this.AgentPostalCode != null) scmd.Parameters.AddWithValue("@P4", this.AgentPostalCode);
|
||||||
|
else scmd.Parameters.AddWithValue("@P4", DBNull.Value);
|
||||||
|
if (this.AgentCity != null) scmd.Parameters.AddWithValue("@P5", this.AgentCity);
|
||||||
|
else scmd.Parameters.AddWithValue("@P5", DBNull.Value);
|
||||||
|
if (this.AgentCountry != null) scmd.Parameters.AddWithValue("@P6", this.AgentCountry);
|
||||||
|
else scmd.Parameters.AddWithValue("@P6", DBNull.Value);
|
||||||
|
if (this.AgentLastName != null) scmd.Parameters.AddWithValue("@P7", this.AgentLastName);
|
||||||
|
else scmd.Parameters.AddWithValue("@P7", DBNull.Value);
|
||||||
|
if (this.AgentFirstName != null) scmd.Parameters.AddWithValue("@P8", this.AgentFirstName);
|
||||||
|
else scmd.Parameters.AddWithValue("@P8", DBNull.Value);
|
||||||
|
if (this.AgentPhone != null) scmd.Parameters.AddWithValue("@P9", this.AgentPhone);
|
||||||
|
else scmd.Parameters.AddWithValue("@P9", DBNull.Value);
|
||||||
|
if (this.AgentFax != null) scmd.Parameters.AddWithValue("@P10", this.AgentFax);
|
||||||
|
else scmd.Parameters.AddWithValue("@P10", DBNull.Value);
|
||||||
|
if (this.AgentEMail != null) scmd.Parameters.AddWithValue("@P11", this.AgentEMail);
|
||||||
|
else scmd.Parameters.AddWithValue("@P11", DBNull.Value);
|
||||||
|
|
||||||
|
if (this.IsNew)
|
||||||
|
{
|
||||||
|
cmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, AgentCompanyName, AgentStreetAndNumber, " +
|
||||||
|
"AgentPostalCode, AgentCity, AgentCountry, AgentLastName, AgentFirstName, AgentPhone, AgentFax, " +
|
||||||
|
"AgentEMail) VALUES (@P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11)", this.Tablename);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cmd.CommandText = string.Format("UPDATE {0} SET AgentCompanyName = @P2, AgentStreetAndNumber = @P3, AgentPostalCode = @P4, AgentCity = @P5, " +
|
||||||
|
"AgentCountry = @P6, AgentLastName = @P7, AgentFirstName = @P8, AgentPhone = @P9, AgentFax = @P10, " +
|
||||||
|
"AgentEMail = @P11 WHERE Id = @ID", this.Tablename);
|
||||||
|
scmd.Parameters.AddWithValue("@ID", this.Id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void PrepareLoadCommand(System.Data.IDbCommand cmd, Message.LoadFilter filter, params object[] criteria)
|
||||||
|
{
|
||||||
|
string query = string.Format("SELECT Id, AgentCompanyName, AgentStreetAndNumber, AgentPostalCode, AgentCity, AgentCountry, " +
|
||||||
|
"AgentLastName, AgentFirstName, AgentPhone, AgentFax, AgentEMail 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<DatabaseEntity> LoadList(System.Data.IDataReader reader)
|
||||||
|
{
|
||||||
|
List<DatabaseEntity> result = new List<DatabaseEntity>();
|
||||||
|
|
||||||
|
while(reader.Read())
|
||||||
|
{
|
||||||
|
AGNT agnt = new AGNT();
|
||||||
|
agnt.id = reader.GetGuid(0);
|
||||||
|
if(!reader.IsDBNull(1)) agnt.AgentCompanyName = reader.GetString(1);
|
||||||
|
if (!reader.IsDBNull(2)) agnt.AgentStreetAndNumber = reader.GetString(2);
|
||||||
|
if (!reader.IsDBNull(3)) agnt.AgentPostalCode = reader.GetString(3);
|
||||||
|
if (!reader.IsDBNull(4)) agnt.AgentCity = reader.GetString(4);
|
||||||
|
if (!reader.IsDBNull(5)) agnt.AgentCountry = reader.GetString(5);
|
||||||
|
if (!reader.IsDBNull(6)) agnt.AgentLastName = reader.GetString(6);
|
||||||
|
if (!reader.IsDBNull(7)) agnt.AgentFirstName = reader.GetString(7);
|
||||||
|
if (!reader.IsDBNull(8)) agnt.AgentPhone = reader.GetString(8);
|
||||||
|
if (!reader.IsDBNull(9)) agnt.AgentFax = reader.GetString(9);
|
||||||
|
if (!reader.IsDBNull(10)) agnt.AgentEMail = reader.GetString(10);
|
||||||
|
|
||||||
|
result.Add(agnt);
|
||||||
|
}
|
||||||
|
reader.Close();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -110,6 +110,14 @@ namespace bsmd.database
|
|||||||
get { return 1; }
|
get { return 1; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SaveElements()
|
||||||
|
{
|
||||||
|
foreach (PortOfItinerary poi in this.PortOfItineraries)
|
||||||
|
{
|
||||||
|
DBManager.Instance.Save(poi);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region IMessageParagraph implementation
|
#region IMessageParagraph implementation
|
||||||
|
|||||||
@ -444,6 +444,7 @@ namespace bsmd.database
|
|||||||
case Message.NotificationClass.TOWD: result = new TOWD(); break;
|
case Message.NotificationClass.TOWD: result = new TOWD(); break;
|
||||||
case Message.NotificationClass.HAZA: result = new HAZ(); break;
|
case Message.NotificationClass.HAZA: result = new HAZ(); break;
|
||||||
case Message.NotificationClass.HAZD: result = new HAZ(); ((HAZ)result).IsDeparture = true; break;
|
case Message.NotificationClass.HAZD: result = new HAZ(); ((HAZ)result).IsDeparture = true; break;
|
||||||
|
case Message.NotificationClass.AGNT: result = new AGNT(); break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break; // VISIT, TRANSIT
|
break; // VISIT, TRANSIT
|
||||||
|
|||||||
@ -246,6 +246,21 @@ namespace bsmd.database
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SaveElements()
|
||||||
|
{
|
||||||
|
foreach (IMDGPosition imdg in this.IMDGPositions)
|
||||||
|
DBManager.Instance.Save(imdg);
|
||||||
|
foreach (IMSBCPosition imsbc in this.IMSBCPositions)
|
||||||
|
DBManager.Instance.Save(imsbc);
|
||||||
|
foreach (IBCPosition ibc in this.IBCPositions)
|
||||||
|
DBManager.Instance.Save(ibc);
|
||||||
|
foreach (IGCPosition igc in this.IGCPositions)
|
||||||
|
DBManager.Instance.Save(igc);
|
||||||
|
foreach (MARPOL_Annex_I_Position marpol in this.MARPOLPositions)
|
||||||
|
DBManager.Instance.Save(marpol);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region IMessageParagraph implementation
|
#region IMessageParagraph implementation
|
||||||
|
|||||||
@ -23,6 +23,11 @@ namespace bsmd.database
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
int NumberOfExcelRows { get; }
|
int NumberOfExcelRows { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Ruft die Speicherfunktion für alle untergeordneten Elemente (rekursiv) auf
|
||||||
|
/// </summary>
|
||||||
|
void SaveElements();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -29,65 +29,89 @@ namespace bsmd.database
|
|||||||
public List<PortOfCallLast30Days> PortOfCallLast30Days { get { return this.portOfCallLast30Days; } }
|
public List<PortOfCallLast30Days> PortOfCallLast30Days { get { return this.portOfCallLast30Days; } }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation1(ValidationCode.NOT_NULL)]
|
[Validation1(ValidationCode.NOT_NULL)]
|
||||||
|
[LookupName("MDH.ValidSanitaryControlExemptionOrCertificateOnBoard")]
|
||||||
public bool? MDHSimplification { get; set; }
|
public bool? MDHSimplification { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation1(ValidationCode.LOCODE_GER)]
|
[Validation1(ValidationCode.LOCODE_GER)]
|
||||||
|
[LookupName("MDH.PlaceOfIssue")]
|
||||||
public string PortOfCallWhereCompleteMDHNotified { get; set; }
|
public string PortOfCallWhereCompleteMDHNotified { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation2(ValidationCode.NOT_NULL)]
|
[Validation2(ValidationCode.NOT_NULL)]
|
||||||
|
[LookupName("MDH.DateOfIssue")]
|
||||||
public bool? NonAccidentalDeathsDuringVoyage { get; set; }
|
public bool? NonAccidentalDeathsDuringVoyage { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
|
[LookupName("MDH.NonAccidentialDeathsDuringVoyageCount")]
|
||||||
public int? NonAccidentalDeathsDuringVoyageCount { get; set; }
|
public int? NonAccidentalDeathsDuringVoyageCount { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation2(ValidationCode.NOT_NULL)]
|
[Validation2(ValidationCode.NOT_NULL)]
|
||||||
|
[LookupName("MDH.SuspisionInfectiousNature")]
|
||||||
public bool? SuspisionInfectiousNature { get; set; }
|
public bool? SuspisionInfectiousNature { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation2(ValidationCode.NOT_NULL)]
|
[Validation2(ValidationCode.NOT_NULL)]
|
||||||
|
[LookupName("MDH.NumberOfIllPersonsHigherThanExpected")]
|
||||||
public bool? NumberOfIllPersonsHigherThanExpected { get; set; }
|
public bool? NumberOfIllPersonsHigherThanExpected { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
|
[LookupName("MDH.NumberOfIllPersons")]
|
||||||
public int? NumberOfIllPersons { get; set; }
|
public int? NumberOfIllPersons { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation2(ValidationCode.NOT_NULL)]
|
[Validation2(ValidationCode.NOT_NULL)]
|
||||||
|
[LookupName("MDH.SickPersonsOnBoard")]
|
||||||
public bool? SickPersonsOnBoard { get; set; }
|
public bool? SickPersonsOnBoard { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation2(ValidationCode.NOT_NULL)]
|
[Validation2(ValidationCode.NOT_NULL)]
|
||||||
|
[LookupName("MDH.MedicalConsulted")]
|
||||||
public bool? MedicalConsulted { get; set; }
|
public bool? MedicalConsulted { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation2(ValidationCode.NOT_NULL)]
|
[Validation2(ValidationCode.NOT_NULL)]
|
||||||
|
[LookupName("MDH.AwareOfConditionsForFurtherInfections")]
|
||||||
public bool? AwareOfFurtherInfections { get; set; }
|
public bool? AwareOfFurtherInfections { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation2(ValidationCode.NOT_NULL)]
|
[Validation2(ValidationCode.NOT_NULL)]
|
||||||
|
[LookupName("MDH.SanitaryMeasuresApplied")]
|
||||||
public bool? SanitaryMeasuresApplied { get; set; }
|
public bool? SanitaryMeasuresApplied { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
|
[LookupName("MDH.SanitaryMeasuresType_1")] // TODO: NSW 3.0: wird ein Array
|
||||||
public string SanitaryMeasuresType { get; set; }
|
public string SanitaryMeasuresType { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
|
[LookupName("MDH.SanitaryMeasuresLocation_1")]
|
||||||
public string SanitaryMeasuresLocation { get; set; }
|
public string SanitaryMeasuresLocation { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
|
[LookupName("MDH.SanitaryMeasuresDate_1")]
|
||||||
public DateTime? SanitaryMeasuresDate { get; set; }
|
public DateTime? SanitaryMeasuresDate { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation2(ValidationCode.NOT_NULL)]
|
[Validation2(ValidationCode.NOT_NULL)]
|
||||||
|
[LookupName("MDH.StowawaysDetected")]
|
||||||
public bool? StowawaysDetected { get; set; }
|
public bool? StowawaysDetected { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
|
[LookupName("MDH.StowawaysJoiningLocation_1")] // TODO: NSW 3.0: wird ein Array
|
||||||
public string StowawaysJoiningLocation { get; set; }
|
public string StowawaysJoiningLocation { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation2(ValidationCode.NOT_NULL)]
|
[Validation2(ValidationCode.NOT_NULL)]
|
||||||
|
[LookupName("MDH.SickAnimalOrPetOnBoard")]
|
||||||
public bool? SickAnimalOrPetOnBoard { get; set; }
|
public bool? SickAnimalOrPetOnBoard { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation2(ValidationCode.NOT_NULL)]
|
[Validation2(ValidationCode.NOT_NULL)]
|
||||||
|
[LookupName("MDH.ValidSanitaryControlExemptionOrCertificateOnBoard")]
|
||||||
public bool? ValidSanitaryControlExemptionOrCertificateOnBoard { get; set; }
|
public bool? ValidSanitaryControlExemptionOrCertificateOnBoard { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
|
[LookupName("MDH.PlaceOfIssue")]
|
||||||
public string PlaceOfIssue { get; set; }
|
public string PlaceOfIssue { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
|
[LookupName("MDH.DateOfIssue")]
|
||||||
public DateTime? DateOfIssue { get; set; }
|
public DateTime? DateOfIssue { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation2(ValidationCode.NOT_NULL)]
|
[Validation2(ValidationCode.NOT_NULL)]
|
||||||
|
[LookupName("SanitaryControlReinspectionRequired")]
|
||||||
public bool? SanitaryControlReinspectionRequired { get; set; }
|
public bool? SanitaryControlReinspectionRequired { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation2(ValidationCode.NOT_NULL)]
|
[Validation2(ValidationCode.NOT_NULL)]
|
||||||
|
[LookupName("MDH.InfectedAreaVisited")]
|
||||||
public bool? InfectedAreaVisited { get; set; }
|
public bool? InfectedAreaVisited { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
|
[LookupName("MDH.InfectedAreaPort_1")] // TODO: NSW 3.0: wird ein Array
|
||||||
public string InfectedAreaPort { get; set; }
|
public string InfectedAreaPort { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
|
[LookupName("MDH.InfectedAreaDate_1")]
|
||||||
public DateTime? InfectedAreaDate { get; set; }
|
public DateTime? InfectedAreaDate { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -233,6 +257,15 @@ namespace bsmd.database
|
|||||||
get { return 15; }
|
get { return 15; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SaveElements()
|
||||||
|
{
|
||||||
|
foreach(PortOfCallLast30Days poc30d in this.PortOfCallLast30Days)
|
||||||
|
{
|
||||||
|
DBManager.Instance.Save(poc30d);
|
||||||
|
((ISublistContainer)poc30d).SaveElements();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region IMessageParagraph implementation
|
#region IMessageParagraph implementation
|
||||||
|
|||||||
@ -55,7 +55,8 @@ namespace bsmd.database
|
|||||||
NotificationClass.HAZD,
|
NotificationClass.HAZD,
|
||||||
NotificationClass.WAS,
|
NotificationClass.WAS,
|
||||||
NotificationClass.ATA,
|
NotificationClass.ATA,
|
||||||
NotificationClass.ATD
|
NotificationClass.ATD,
|
||||||
|
NotificationClass.AGNT
|
||||||
});
|
});
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -93,7 +94,8 @@ namespace bsmd.database
|
|||||||
TOWA,
|
TOWA,
|
||||||
TOWD,
|
TOWD,
|
||||||
HAZA, // 25
|
HAZA, // 25
|
||||||
HAZD
|
HAZD,
|
||||||
|
AGNT
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum MessageStatus
|
public enum MessageStatus
|
||||||
@ -426,6 +428,18 @@ namespace bsmd.database
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SaveElements()
|
||||||
|
{
|
||||||
|
foreach (DatabaseEntity dbEntity in this.Elements)
|
||||||
|
{
|
||||||
|
DBManager.Instance.Save(dbEntity);
|
||||||
|
if (dbEntity is ISublistContainer)
|
||||||
|
{
|
||||||
|
((ISublistContainer)dbEntity).SaveElements();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region IMessageParagraph implementation
|
#region IMessageParagraph implementation
|
||||||
@ -482,6 +496,7 @@ namespace bsmd.database
|
|||||||
case NotificationClass.PRE72H:
|
case NotificationClass.PRE72H:
|
||||||
case NotificationClass.SEC:
|
case NotificationClass.SEC:
|
||||||
case NotificationClass.STAT:
|
case NotificationClass.STAT:
|
||||||
|
case NotificationClass.AGNT:
|
||||||
case NotificationClass.TIEFA:
|
case NotificationClass.TIEFA:
|
||||||
case NotificationClass.TIEFD:
|
case NotificationClass.TIEFD:
|
||||||
case NotificationClass.WAS:
|
case NotificationClass.WAS:
|
||||||
@ -539,6 +554,7 @@ namespace bsmd.database
|
|||||||
case NotificationClass.PRE72H:
|
case NotificationClass.PRE72H:
|
||||||
case NotificationClass.SEC:
|
case NotificationClass.SEC:
|
||||||
case NotificationClass.STAT:
|
case NotificationClass.STAT:
|
||||||
|
case NotificationClass.AGNT:
|
||||||
case NotificationClass.TIEFA:
|
case NotificationClass.TIEFA:
|
||||||
case NotificationClass.TIEFD:
|
case NotificationClass.TIEFD:
|
||||||
case NotificationClass.WAS:
|
case NotificationClass.WAS:
|
||||||
|
|||||||
@ -145,6 +145,14 @@ namespace bsmd.database
|
|||||||
get { return 1; }
|
get { return 1; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SaveElements()
|
||||||
|
{
|
||||||
|
foreach(CallPurpose cp in this.CallPurposes)
|
||||||
|
{
|
||||||
|
DBManager.Instance.Save(cp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region IMessageParagraph implementation
|
#region IMessageParagraph implementation
|
||||||
|
|||||||
@ -80,7 +80,7 @@ namespace bsmd.database
|
|||||||
[Validation(ValidationCode.NOT_NULL)]
|
[Validation(ValidationCode.NOT_NULL)]
|
||||||
public string PassengerPortOfEmbarkation { get; set; }
|
public string PassengerPortOfEmbarkation { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[ReportDisplayName("Port od disembarkation")]
|
[ReportDisplayName("Port of disembarkation")]
|
||||||
[Validation(ValidationCode.NOT_NULL)]
|
[Validation(ValidationCode.NOT_NULL)]
|
||||||
public string PassengerPortOfDisembarkation { get; set; }
|
public string PassengerPortOfDisembarkation { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
|
|||||||
@ -25,15 +25,19 @@ namespace bsmd.database
|
|||||||
#region Properties
|
#region Properties
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation(ValidationCode.INT_GT_ZERO)]
|
[Validation(ValidationCode.INT_GT_ZERO)]
|
||||||
|
[LookupName("POBA.TotalPersonsOnBoardUponArrival")]
|
||||||
public int? TotalPersonsOnBoardUponArrival { get; set; }
|
public int? TotalPersonsOnBoardUponArrival { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation(ValidationCode.INT_GT_ZERO)]
|
[Validation(ValidationCode.INT_GT_ZERO)]
|
||||||
|
[LookupName("POBA.TotalCrewMembersOnBoardUponArrival")]
|
||||||
public int? TotalCrewMembersOnBoardUponArrival { get; set; }
|
public int? TotalCrewMembersOnBoardUponArrival { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation(ValidationCode.NOT_NULL)]
|
[Validation(ValidationCode.NOT_NULL)]
|
||||||
|
[LookupName("POBA.TotalPassengersOnBoardUponArrival")]
|
||||||
public int? TotalPassengersOnBoardUponArrival { get; set; }
|
public int? TotalPassengersOnBoardUponArrival { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation(ValidationCode.NOT_NULL)]
|
[Validation(ValidationCode.NOT_NULL)]
|
||||||
|
[LookupName("POBA.TotalStowawaysOnBoardUponArrival")]
|
||||||
public int? TotalStowawaysOnBoardUponArrival { get; set; }
|
public int? TotalStowawaysOnBoardUponArrival { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@ -25,15 +25,19 @@ namespace bsmd.database
|
|||||||
#region Properties
|
#region Properties
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation(ValidationCode.INT_GT_ZERO)]
|
[Validation(ValidationCode.INT_GT_ZERO)]
|
||||||
|
[LookupName("POBD.TotalPersonsOnBoardUponDeparture")]
|
||||||
public int? TotalPersonsOnBoardUponDeparture { get; set; }
|
public int? TotalPersonsOnBoardUponDeparture { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation(ValidationCode.INT_GT_ZERO)]
|
[Validation(ValidationCode.INT_GT_ZERO)]
|
||||||
|
[LookupName("POBD.TotalCrewMembersOnBoardUponDeparture")]
|
||||||
public int? TotalCrewMembersOnBoardUponDeparture { get; set; }
|
public int? TotalCrewMembersOnBoardUponDeparture { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation(ValidationCode.NOT_NULL)]
|
[Validation(ValidationCode.NOT_NULL)]
|
||||||
|
[LookupName("POBD.TotalPassengersOnBoardUponDeparture")]
|
||||||
public int? TotalPassengersOnBoardUponDeparture { get; set; }
|
public int? TotalPassengersOnBoardUponDeparture { get; set; }
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation(ValidationCode.NOT_NULL)]
|
[Validation(ValidationCode.NOT_NULL)]
|
||||||
|
[LookupName("POBD.TotalStowawaysOnBoardUponDeparture")]
|
||||||
public int? TotalStowawaysOnBoardUponDeparture { get; set; }
|
public int? TotalStowawaysOnBoardUponDeparture { get; set; }
|
||||||
|
|
||||||
public override string Subtitle
|
public override string Subtitle
|
||||||
|
|||||||
@ -126,6 +126,14 @@ namespace bsmd.database
|
|||||||
get { return 1; }
|
get { return 1; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SaveElements()
|
||||||
|
{
|
||||||
|
foreach (PortOfCallLast30DaysCrewJoinedShip cjs in this.CrewJoinedShip)
|
||||||
|
{
|
||||||
|
DBManager.Instance.Save(cjs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region IMessageParagraph implementation
|
#region IMessageParagraph implementation
|
||||||
|
|||||||
@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
[assembly: AssemblyCompany("Informatikbüro Daniel Schick")]
|
[assembly: AssemblyCompany("Informatikbüro Daniel Schick")]
|
||||||
[assembly: AssemblyProduct("BSMD NSW interface")]
|
[assembly: AssemblyProduct("BSMD NSW interface")]
|
||||||
[assembly: AssemblyInformationalVersion("2.4.16")]
|
[assembly: AssemblyInformationalVersion("2.4.18")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2014-2015 Informatikbüro Daniel Schick. All rights reserved.")]
|
[assembly: AssemblyCopyright("Copyright © 2014-2015 Informatikbüro Daniel Schick. All rights reserved.")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyVersion("2.4.16.*")]
|
[assembly: AssemblyVersion("2.4.18.*")]
|
||||||
|
|
||||||
|
|||||||
@ -296,6 +296,7 @@ namespace bsmd.database
|
|||||||
{
|
{
|
||||||
// individuelle Fehler nach Nachrichtenklasse prüfen
|
// individuelle Fehler nach Nachrichtenklasse prüfen
|
||||||
derivedEntity.MessageCore = entity.MessageCore; // some instance we need info from core (NOA / Transit)
|
derivedEntity.MessageCore = entity.MessageCore; // some instance we need info from core (NOA / Transit)
|
||||||
|
if ((derivedEntity is LADG) && entity.MessageCore.IsTransit) continue; // kein error reporting für LADG bei Transit (CH, 1.2.16)
|
||||||
RuleEngine.ValidateProperties(derivedEntity, errors);
|
RuleEngine.ValidateProperties(derivedEntity, errors);
|
||||||
derivedEntity.Validate(errors, violations);
|
derivedEntity.Validate(errors, violations);
|
||||||
|
|
||||||
|
|||||||
@ -138,6 +138,14 @@ namespace bsmd.database
|
|||||||
get { return 9; }
|
get { return 9; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SaveElements()
|
||||||
|
{
|
||||||
|
foreach(Waste waste in this.Waste)
|
||||||
|
{
|
||||||
|
DBManager.Instance.Save(waste);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region IMessageParagraph implementation
|
#region IMessageParagraph implementation
|
||||||
|
|||||||
@ -54,6 +54,7 @@
|
|||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="AGNT.cs" />
|
||||||
<Compile Include="CallPurpose.cs" />
|
<Compile Include="CallPurpose.cs" />
|
||||||
<Compile Include="Customer.cs" />
|
<Compile Include="Customer.cs" />
|
||||||
<Compile Include="Extensions.cs" />
|
<Compile Include="Extensions.cs" />
|
||||||
|
|||||||
@ -148,20 +148,20 @@ namespace bsmd.herberg.FormService
|
|||||||
|
|
||||||
public static byte? ParseFlashpointInformation(string val)
|
public static byte? ParseFlashpointInformation(string val)
|
||||||
{
|
{
|
||||||
if (val.Equals("NF")) return 0;
|
if (val.Equals("NF", StringComparison.InvariantCultureIgnoreCase)) return 0;
|
||||||
if (val.Equals("GT60CEL")) return 1;
|
if (val.Equals("GT60CEL", StringComparison.InvariantCultureIgnoreCase)) return 1;
|
||||||
if (val.Equals("LE60CEL")) return 2;
|
if (val.Equals("LE60CEL", StringComparison.InvariantCultureIgnoreCase)) return 2;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static byte? ParseGender(string val)
|
public static byte? ParseGender(string val)
|
||||||
{
|
{
|
||||||
if (val.Equals("MALE")) return 0;
|
if (val.Equals("MALE", StringComparison.InvariantCultureIgnoreCase)) return 0;
|
||||||
if (val.Equals("M")) return 0;
|
if (val.Equals("M", StringComparison.InvariantCultureIgnoreCase)) return 0;
|
||||||
if (val.Equals("FEMALE")) return 1;
|
if (val.Equals("FEMALE", StringComparison.InvariantCultureIgnoreCase)) return 1;
|
||||||
if (val.Equals("F")) return 1;
|
if (val.Equals("F", StringComparison.InvariantCultureIgnoreCase)) return 1;
|
||||||
if (val.Equals("OTHER")) return 2;
|
if (val.Equals("OTHER", StringComparison.InvariantCultureIgnoreCase)) return 2;
|
||||||
if (val.Equals("O")) return 2;
|
if (val.Equals("O", StringComparison.InvariantCultureIgnoreCase)) return 2;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1181,7 +1181,13 @@ namespace bsmd.herberg.FormService
|
|||||||
_log.WarnFormat("PortFacilityGISISCode invalid: {0}, replacing with 0000", poc.PortFacilityGISISCode);
|
_log.WarnFormat("PortFacilityGISISCode invalid: {0}, replacing with 0000", poc.PortFacilityGISISCode);
|
||||||
poc.PortFacilityGISISCode = "0000";
|
poc.PortFacilityGISISCode = "0000";
|
||||||
if (poc.PortFacilitySecurityMattersToReport.IsNullOrEmpty()) poc.PortFacilitySecurityMattersToReport = string.Format("Remark: Reported GISIS-Code: {0}", sDict["PortFacilityGISISCode"] ?? "");
|
if (poc.PortFacilitySecurityMattersToReport.IsNullOrEmpty()) poc.PortFacilitySecurityMattersToReport = string.Format("Remark: Reported GISIS-Code: {0}", sDict["PortFacilityGISISCode"] ?? "");
|
||||||
else poc.PortFacilitySecurityMattersToReport = string.Format("{0} - Remark: Reported GISIS-Code: {1}", poc.PortFacilitySecurityMattersToReport, sDict["PortFacilityGISISCode"] ?? "");
|
else
|
||||||
|
{
|
||||||
|
if (!poc.PortFacilitySecurityMattersToReport.Contains("Remark: Reported GISIS-Code:"))
|
||||||
|
{
|
||||||
|
poc.PortFacilitySecurityMattersToReport = string.Format("{0} - Remark: Reported GISIS-Code: {1}", poc.PortFacilitySecurityMattersToReport, sDict["PortFacilityGISISCode"] ?? "");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,8 +49,8 @@ namespace bsmd.hisnord
|
|||||||
|
|
||||||
if (messages[0].MessageCore.Customer != null)
|
if (messages[0].MessageCore.Customer != null)
|
||||||
{
|
{
|
||||||
_nsw.conveyance.owner_sender.name_short = messages[0].MessageCore.Customer.Name;
|
_nsw.conveyance.owner_sender.name_short = @"BSMD"; // messages[0].MessageCore.Customer.Name;
|
||||||
_nsw.conveyance.owner_sender.name_long = messages[0].MessageCore.Customer.Name;
|
_nsw.conveyance.owner_sender.name_long = @"BSMD"; // messages[0].MessageCore.Customer.Name;
|
||||||
|
|
||||||
_nsw.conveyance.owner_sender.address = new addresstype();
|
_nsw.conveyance.owner_sender.address = new addresstype();
|
||||||
_nsw.conveyance.owner_sender.address.StreetNumber = messages[0].MessageCore.Customer.StreetAndNumber;
|
_nsw.conveyance.owner_sender.address.StreetNumber = messages[0].MessageCore.Customer.StreetAndNumber;
|
||||||
@ -597,7 +597,7 @@ namespace bsmd.hisnord
|
|||||||
lu.CargoCodeNST = ladg.CargoCodeNST;
|
lu.CargoCodeNST = ladg.CargoCodeNST;
|
||||||
if (ladg.CargoGrossQuantity_TNE.HasValue)
|
if (ladg.CargoGrossQuantity_TNE.HasValue)
|
||||||
lu.CargoGrossQuantity_TNE = (float)ladg.CargoGrossQuantity_TNE.Value;
|
lu.CargoGrossQuantity_TNE = (float)ladg.CargoGrossQuantity_TNE.Value;
|
||||||
if (ladg.CargoNumberOfItems.HasValue)
|
if ((ladg.CargoNumberOfItems ?? 0) > 0)
|
||||||
lu.CargoNumberOfItems = ladg.CargoNumberOfItems.Value.ToString();
|
lu.CargoNumberOfItems = ladg.CargoNumberOfItems.Value.ToString();
|
||||||
if (ladg.CargoHandlingType.HasValue)
|
if (ladg.CargoHandlingType.HasValue)
|
||||||
lu.HandlingCode = (handlingcodetype)ladg.CargoHandlingType.Value;
|
lu.HandlingCode = (handlingcodetype)ladg.CargoHandlingType.Value;
|
||||||
@ -680,18 +680,22 @@ namespace bsmd.hisnord
|
|||||||
_mdh.SickAnimalOrPetOnBoard = mdh.SickAnimalOrPetOnBoard.Value ? yorntype.Y : yorntype.N;
|
_mdh.SickAnimalOrPetOnBoard = mdh.SickAnimalOrPetOnBoard.Value ? yorntype.Y : yorntype.N;
|
||||||
if (mdh.SickPersonsOnBoard.HasValue)
|
if (mdh.SickPersonsOnBoard.HasValue)
|
||||||
_mdh.SickPersonOnBoard = mdh.SickPersonsOnBoard.Value ? yorntype.Y : yorntype.N;
|
_mdh.SickPersonOnBoard = mdh.SickPersonsOnBoard.Value ? yorntype.Y : yorntype.N;
|
||||||
_mdh.StowawayJoiningLocation = mdh.StowawaysJoiningLocation;
|
|
||||||
if (mdh.StowawaysDetected.HasValue)
|
_mdh.StowawaysDetected = (mdh.StowawaysDetected ?? false) ? yorntype.Y : yorntype.N;
|
||||||
_mdh.StowawaysDetected = mdh.StowawaysDetected.Value ? yorntype.Y : yorntype.N;
|
if(_mdh.StowawaysDetected == yorntype.Y)
|
||||||
|
_mdh.StowawayJoiningLocation = mdh.StowawaysJoiningLocation;
|
||||||
|
|
||||||
if (mdh.SuspisionInfectiousNature.HasValue)
|
if (mdh.SuspisionInfectiousNature.HasValue)
|
||||||
_mdh.SuspisionInfectiousNature = mdh.SuspisionInfectiousNature.Value ? yorntype.Y : yorntype.N;
|
_mdh.SuspisionInfectiousNature = mdh.SuspisionInfectiousNature.Value ? yorntype.Y : yorntype.N;
|
||||||
if (mdh.ValidSanitaryControlExemptionOrCertificateOnBoard.HasValue)
|
|
||||||
_mdh.ValidSanitaryControlExemptionOrCertificateOnBoard = mdh.ValidSanitaryControlExemptionOrCertificateOnBoard.Value ? yorntype.Y : yorntype.N;
|
|
||||||
_mdh.ValidSanitaryControlExemptionOrCertificate = new sanitarycertificate();
|
|
||||||
if (mdh.DateOfIssue.HasValue)
|
|
||||||
_mdh.ValidSanitaryControlExemptionOrCertificate.DateOfIssue = mdh.DateOfIssue.Value;
|
|
||||||
_mdh.ValidSanitaryControlExemptionOrCertificate.PlaceOfIssue = mdh.PlaceOfIssue;
|
|
||||||
|
|
||||||
|
_mdh.ValidSanitaryControlExemptionOrCertificateOnBoard = (mdh.ValidSanitaryControlExemptionOrCertificateOnBoard ?? false) ? yorntype.Y : yorntype.N;
|
||||||
|
if (_mdh.ValidSanitaryControlExemptionOrCertificateOnBoard == yorntype.Y)
|
||||||
|
{
|
||||||
|
_mdh.ValidSanitaryControlExemptionOrCertificate = new sanitarycertificate();
|
||||||
|
if (mdh.DateOfIssue.HasValue)
|
||||||
|
_mdh.ValidSanitaryControlExemptionOrCertificate.DateOfIssue = mdh.DateOfIssue.Value;
|
||||||
|
_mdh.ValidSanitaryControlExemptionOrCertificate.PlaceOfIssue = mdh.PlaceOfIssue;
|
||||||
|
}
|
||||||
_nsw.conveyance.Items3[0] = _mdh;
|
_nsw.conveyance.Items3[0] = _mdh;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -721,12 +725,14 @@ namespace bsmd.hisnord
|
|||||||
if (noa_nod.ETDFromLastPort.HasValue)
|
if (noa_nod.ETDFromLastPort.HasValue)
|
||||||
_transit.LastPort.ETD = noa_nod.ETDFromLastPort.Value;
|
_transit.LastPort.ETD = noa_nod.ETDFromLastPort.Value;
|
||||||
_transit.LastPort.ETDSpecified = noa_nod.ETDFromLastPort.HasValue;
|
_transit.LastPort.ETDSpecified = noa_nod.ETDFromLastPort.HasValue;
|
||||||
_transit.LastPort.Locode = noa_nod.LastPort;
|
if((noa_nod.LastPort != null) && (noa_nod.LastPort.Trim() != ""))
|
||||||
|
_transit.LastPort.Locode = noa_nod.LastPort;
|
||||||
|
|
||||||
_transit.NextPort = new nextporthazmat();
|
_transit.NextPort = new nextporthazmat();
|
||||||
if (noa_nod.ETAToNextPort.HasValue)
|
if (noa_nod.ETAToNextPort.HasValue)
|
||||||
_transit.NextPort.ETA = noa_nod.ETAToNextPort.Value;
|
_transit.NextPort.ETA = noa_nod.ETAToNextPort.Value;
|
||||||
_transit.NextPort.ETASpecified = noa_nod.ETAToNextPort.HasValue;
|
_transit.NextPort.ETASpecified = noa_nod.ETAToNextPort.HasValue;
|
||||||
|
if ((noa_nod.NextPort != null) && (noa_nod.NextPort.Trim() != ""))
|
||||||
_transit.NextPort.Locode = noa_nod.NextPort;
|
_transit.NextPort.Locode = noa_nod.NextPort;
|
||||||
}
|
}
|
||||||
else if (message.MessageCore.Incoming) // einlaufend
|
else if (message.MessageCore.Incoming) // einlaufend
|
||||||
@ -742,13 +748,15 @@ namespace bsmd.hisnord
|
|||||||
if (noa_nod.ETDFromLastPort.HasValue)
|
if (noa_nod.ETDFromLastPort.HasValue)
|
||||||
_import.LastPort.ETD = noa_nod.ETDFromLastPort.Value;
|
_import.LastPort.ETD = noa_nod.ETDFromLastPort.Value;
|
||||||
_import.LastPort.ETDSpecified = noa_nod.ETDFromLastPort.HasValue;
|
_import.LastPort.ETDSpecified = noa_nod.ETDFromLastPort.HasValue;
|
||||||
_import.LastPort.Locode = noa_nod.LastPort;
|
if ((noa_nod.LastPort != null) && (noa_nod.LastPort.Trim() != ""))
|
||||||
|
_import.LastPort.Locode = noa_nod.LastPort;
|
||||||
_import.PortOfCall = new portofcallhazmat();
|
_import.PortOfCall = new portofcallhazmat();
|
||||||
if (noa_nod.ETAToPortOfCall.HasValue)
|
if (noa_nod.ETAToPortOfCall.HasValue)
|
||||||
_import.PortOfCall.ETA = noa_nod.ETAToPortOfCall.Value;
|
_import.PortOfCall.ETA = noa_nod.ETAToPortOfCall.Value;
|
||||||
if (noa_nod.ETDFromPortOfCall.HasValue)
|
if (noa_nod.ETDFromPortOfCall.HasValue)
|
||||||
_import.PortOfCall.ETD = noa_nod.ETDFromPortOfCall.Value;
|
_import.PortOfCall.ETD = noa_nod.ETDFromPortOfCall.Value;
|
||||||
_import.PortOfCall.Locode = message.MessageCore.PoC;
|
if ((message.MessageCore.PoC != null) && (message.MessageCore.PoC.Trim() != ""))
|
||||||
|
_import.PortOfCall.Locode = message.MessageCore.PoC;
|
||||||
|
|
||||||
}
|
}
|
||||||
else // auslaufend
|
else // auslaufend
|
||||||
@ -764,13 +772,15 @@ namespace bsmd.hisnord
|
|||||||
if (noa_nod.ETAToNextPort.HasValue)
|
if (noa_nod.ETAToNextPort.HasValue)
|
||||||
_export.NextPort.ETA = noa_nod.ETAToNextPort.Value;
|
_export.NextPort.ETA = noa_nod.ETAToNextPort.Value;
|
||||||
_export.NextPort.ETASpecified = noa_nod.ETAToNextPort.HasValue;
|
_export.NextPort.ETASpecified = noa_nod.ETAToNextPort.HasValue;
|
||||||
_export.NextPort.Locode = noa_nod.NextPort;
|
if ((noa_nod.NextPort != null) && (noa_nod.NextPort.Trim() != ""))
|
||||||
|
_export.NextPort.Locode = noa_nod.NextPort;
|
||||||
_export.PortOfCall = new portofcallhazmat();
|
_export.PortOfCall = new portofcallhazmat();
|
||||||
if (noa_nod.ETAToPortOfCall.HasValue)
|
if (noa_nod.ETAToPortOfCall.HasValue)
|
||||||
_export.PortOfCall.ETA = noa_nod.ETAToPortOfCall.Value;
|
_export.PortOfCall.ETA = noa_nod.ETAToPortOfCall.Value;
|
||||||
if (noa_nod.ETDFromPortOfCall.HasValue)
|
if (noa_nod.ETDFromPortOfCall.HasValue)
|
||||||
_export.PortOfCall.ETD = noa_nod.ETDFromPortOfCall.Value;
|
_export.PortOfCall.ETD = noa_nod.ETDFromPortOfCall.Value;
|
||||||
_export.PortOfCall.Locode = message.MessageCore.PoC;
|
if ((message.MessageCore.PoC != null) && (message.MessageCore.PoC.Trim() != ""))
|
||||||
|
_export.PortOfCall.Locode = message.MessageCore.PoC;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user