ENI PDF Report Implementierung

This commit is contained in:
Daniel Schick 2021-05-18 10:01:13 +00:00
parent ca290f55e6
commit 231f17c959
21 changed files with 503 additions and 59 deletions

View File

@ -26,12 +26,12 @@
<value>1000</value> <value>1000</value>
</setting> </setting>
<setting name="LockingServerAddress" serializeAs="String"> <setting name="LockingServerAddress" serializeAs="String">
<value>http://192.168.2.24/LockingService/LockingService.svc</value> <!--value>http://192.168.2.24/LockingService/LockingService.svc</value-->
<!--value>http://heupferd/bsmd.LockingService/LockingService.svc</value--> <value>http://heupferd/bsmd.LockingService/LockingService.svc</value>
</setting> </setting>
<setting name="ConnectionString" serializeAs="String"> <setting name="ConnectionString" serializeAs="String">
<value>Initial Catalog=nsw;Data Source=192.168.2.24\SQLEXPRESS;Uid=dfuser;pwd=dfpasswd;Persist Security Info=False;Connection Reset=false</value> <!--value>Initial Catalog=nsw;Data Source=192.168.2.24\SQLEXPRESS;Uid=dfuser;pwd=dfpasswd;Persist Security Info=False;Connection Reset=false</value-->
<!--value>Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=E:\DATA\DB\NSW.MDF;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False</value--> <value>Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=E:\DATA\DB\NSW.MDF;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False</value>
</setting> </setting>
</ENI2.Properties.Settings> </ENI2.Properties.Settings>
</applicationSettings> </applicationSettings>

View File

@ -35,7 +35,7 @@
<CreateWebPageOnPublish>true</CreateWebPageOnPublish> <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage> <WebPage>publish.html</WebPage>
<ApplicationRevision>0</ApplicationRevision> <ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>6.2.0.%2a</ApplicationVersion> <ApplicationVersion>6.2.1.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut> <CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted> <PublishWizardCompleted>true</PublishWizardCompleted>

View File

@ -91,8 +91,8 @@ namespace ENI2
string name = null; string name = null;
if (!reader.IsDBNull(0)) code = reader.GetString(0); if (!reader.IsDBNull(0)) code = reader.GetString(0);
if (!reader.IsDBNull(1)) name = reader.GetString(1); if (!reader.IsDBNull(1)) name = reader.GetString(1);
if((code != null) && (name != null)) if ((code != null) && (name != null))
result[code] = string.Format("{0} {1}", code, name); result[code] = name; // string.Format("{0} {1}", code, name);
} }
reader.Close(); reader.Close();
return result; return result;

Binary file not shown.

View File

@ -11,10 +11,10 @@
<applicationSettings> <applicationSettings>
<bsmd.ReportGenerator.Properties.Settings> <bsmd.ReportGenerator.Properties.Settings>
<setting name="ConnectionString" serializeAs="String"> <setting name="ConnectionString" serializeAs="String">
<value>replace me!</value> <value>Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=E:\DATA\DB\NSW.MDF;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False</value>
</setting> </setting>
<setting name="OutputDirectory" serializeAs="String"> <setting name="OutputDirectory" serializeAs="String">
<value /> <value>E:\temp</value>>
</setting> </setting>
<setting name="SleepSeconds" serializeAs="String"> <setting name="SleepSeconds" serializeAs="String">
<value>300</value> <value>300</value>
@ -43,7 +43,7 @@
<value>donotreply@bsmd.de</value> <value>donotreply@bsmd.de</value>
</setting> </setting>
<setting name="LogoPath" serializeAs="String"> <setting name="LogoPath" serializeAs="String">
<value /> <value>E:\svnlager\BSMD\nsw\Source\misc\EUREPORT.png</value>
</setting> </setting>
<setting name="DeleteFileAfterSend" serializeAs="String"> <setting name="DeleteFileAfterSend" serializeAs="String">
<value>False</value> <value>False</value>

View File

@ -86,7 +86,7 @@ namespace bsmd.ReportGenerator
MigraDoc.DocumentObjectModel.IO.DdlWriter.WriteToFile(document, migraTempFile); MigraDoc.DocumentObjectModel.IO.DdlWriter.WriteToFile(document, migraTempFile);
// TODO Test font embedding (-> filesize!) // TODO Test font embedding (-> filesize!)
PdfDocumentRenderer renderer = new PdfDocumentRenderer(true, PdfSharp.Pdf.PdfFontEmbedding.None); PdfDocumentRenderer renderer = new PdfDocumentRenderer(true);
renderer.Document = document; renderer.Document = document;
renderer.RenderDocument(); renderer.RenderDocument();
@ -281,10 +281,10 @@ namespace bsmd.ReportGenerator
Column col = table.AddColumn(90); // die Bildspalte Column col = table.AddColumn(90); // die Bildspalte
col.Format.Alignment = ParagraphAlignment.Center; col.Format.Alignment = ParagraphAlignment.Center;
col = table.AddColumn(70); table.AddColumn(70);
col = table.AddColumn(140); table.AddColumn(140);
col = table.AddColumn(60); table.AddColumn(60);
col = table.AddColumn(140); table.AddColumn(140);
Row row = table.AddRow(); Row row = table.AddRow();
Image logoImage = row.Cells[0].AddImage(Properties.Settings.Default.LogoPath); Image logoImage = row.Cells[0].AddImage(Properties.Settings.Default.LogoPath);
@ -438,6 +438,42 @@ namespace bsmd.ReportGenerator
#endregion #endregion
#region Einzelne Seite in Landscape für TOWA Meldung
if ((message != null) && (message.MessageNotificationClass == Message.NotificationClass.TOWA))
{
// Landscape!
BSMDDocument.DefineContentSection(document, Orientation.Landscape, false);
document.LastSection.AddParagraph(BSMDDocument.ReplaceTitle(messageParagraph.Title), "Heading2");
document.LastSection.AddParagraph(BSMDDocument.ReplaceTitle(messageParagraph.Subtitle), "Heading3");
BSMDDocument.CreateTOWATable(document, message);
BSMDDocument.DefineContentSection(document, Orientation.Portrait, false);
return;
}
#endregion
#region Einzelne Seite in Landscape für TOWD Meldung
if ((message != null) && (message.MessageNotificationClass == Message.NotificationClass.TOWD))
{
// Landscape!
BSMDDocument.DefineContentSection(document, Orientation.Landscape, false);
document.LastSection.AddParagraph(BSMDDocument.ReplaceTitle(messageParagraph.Title), "Heading2");
document.LastSection.AddParagraph(BSMDDocument.ReplaceTitle(messageParagraph.Subtitle), "Heading3");
BSMDDocument.CreateTOWDTable(document, message);
BSMDDocument.DefineContentSection(document, Orientation.Portrait, false);
return;
}
#endregion
document.LastSection.AddParagraph(BSMDDocument.ReplaceTitle(messageParagraph.Title), "Heading2"); document.LastSection.AddParagraph(BSMDDocument.ReplaceTitle(messageParagraph.Title), "Heading2");
document.LastSection.AddParagraph(BSMDDocument.ReplaceTitle(messageParagraph.Subtitle), "Heading3"); document.LastSection.AddParagraph(BSMDDocument.ReplaceTitle(messageParagraph.Subtitle), "Heading3");
@ -489,22 +525,34 @@ namespace bsmd.ReportGenerator
if((message != null) && (message.MessageNotificationClass == Message.NotificationClass.SEC)) if((message != null) && (message.MessageNotificationClass == Message.NotificationClass.SEC))
{ {
BSMDDocument.CreateLast10PortFacilitiesTable(document, message); BSMDDocument.CreateLast10PortFacilitiesTable(document, message);
BSMDDocument.CreateShip2ShipActivitiesTable(document, message);
return; return;
} }
#endregion #endregion
#region BPOL
if((message != null) && (message.MessageNotificationClass == Message.NotificationClass.BPOL))
{
BSMDDocument.CreatePortOfItineraryTable(document, message);
}
#endregion
#region MDH #region MDH
if((message != null) && (message.MessageNotificationClass == Message.NotificationClass.MDH)) if ((message != null) && (message.MessageNotificationClass == Message.NotificationClass.MDH))
{ {
BSMDDocument.CreatePoCLast30DaysTable(document, message); BSMDDocument.CreateSanitaryMeasuresTable(document, message);
BSMDDocument.CreateInfectedAreaTable(document, message);
BSMDDocument.CreatePoCLast30DaysTable(document, message);
return; return;
} }
#endregion #endregion
#region Child paragraphs (1:n message CREW, PAS,..) #region Child paragraphs (untergeordnete Tabellen..)
if (messageParagraph.ChildParagraphs != null) if (messageParagraph.ChildParagraphs != null)
{ {
@ -686,10 +734,78 @@ namespace bsmd.ReportGenerator
} }
} }
private static void CreateSanitaryMeasuresTable(Document document, Message message)
{
MDH mdh = message.Elements[0] as MDH;
if(mdh.SanitaryMeasuresApplied ?? false)
{
document.LastSection.AddParagraph("Sanitary measures", "Heading3");
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(2);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(3);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1.5);
Row hRow = table.AddRow();
hRow.Cells[1].AddParagraph("Type");
hRow.Cells[2].AddParagraph("Location");
hRow.Cells[3].AddParagraph("Date");
for (int i = 0; i < mdh.SanitaryMeasuresDetails.Count; i++)
{
Row row = table.AddRow();
row.Cells[0].AddParagraph(mdh.SanitaryMeasuresDetails[i].Identifier);
row.Cells[1].AddParagraph(mdh.SanitaryMeasuresDetails[i].SanitaryMeasuresType);
row.Cells[2].AddParagraph(mdh.SanitaryMeasuresDetails[i].SanitaryMeasuresLocation);
row.Cells[3].AddParagraph(mdh.SanitaryMeasuresDetails[i].SanitaryMeasuresDate.HasValue ? mdh.SanitaryMeasuresDetails[i].SanitaryMeasuresDate.Value.ToShortDateString() : "");
}
}
}
private static void CreateInfectedAreaTable(Document document, Message message)
{
MDH mdh = message.Elements[0] as MDH;
if (mdh.InfectedAreaVisited ?? false)
{
document.LastSection.AddParagraph("Infected areas", "Heading3");
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(2);
Row hRow = table.AddRow();
hRow.Cells[1].AddParagraph("Port");
hRow.Cells[2].AddParagraph("Date");
for (int i = 0; i < mdh.InfectedAreas.Count; i++)
{
Row row = table.AddRow();
row.Cells[0].AddParagraph(mdh.InfectedAreas[i].Identifier);
row.Cells[1].AddParagraph(mdh.InfectedAreas[i].InfectedAreaPort);
row.Cells[2].AddParagraph(mdh.InfectedAreas[i].InfectedAreaDate.HasValue ? mdh.InfectedAreas[i].InfectedAreaDate.Value.ToShortDateString() : "");
}
}
}
private static void SetPoCLast30Days(PortOfCallLast30Days portOfCallLast30Days, Row row) private static void SetPoCLast30Days(PortOfCallLast30Days portOfCallLast30Days, Row row)
{ {
row.Cells[0].AddParagraph(portOfCallLast30Days.Identifier); row.Cells[0].AddParagraph(portOfCallLast30Days.Identifier);
row.Cells[1].AddParagraph(portOfCallLast30Days.PortOfCallLast30DaysLocode ?? "");
row.Cells[1].AddParagraph(LocodeDB.LocationNameFromLocode(portOfCallLast30Days.PortOfCallLast30DaysLocode) ?? "");
row.Cells[2].AddParagraph(portOfCallLast30Days.PortOfCallLast30DaysDateOfDeparture.HasValue ? row.Cells[2].AddParagraph(portOfCallLast30Days.PortOfCallLast30DaysDateOfDeparture.HasValue ?
portOfCallLast30Days.PortOfCallLast30DaysDateOfDeparture.Value.ToShortDateString() : ""); portOfCallLast30Days.PortOfCallLast30DaysDateOfDeparture.Value.ToShortDateString() : "");
row.Cells[3].AddParagraph(portOfCallLast30Days.PortOfCallLast30DaysCrewMembersJoined.HasValue ? row.Cells[3].AddParagraph(portOfCallLast30Days.PortOfCallLast30DaysCrewMembersJoined.HasValue ?
@ -769,7 +885,7 @@ namespace bsmd.ReportGenerator
column = table.AddColumn(); column = table.AddColumn();
column.Width = Unit.FromCentimeter(0.8); column.Width = Unit.FromCentimeter(0.8);
column = table.AddColumn(); column = table.AddColumn();
column.Width = Unit.FromCentimeter(2); column.Width = Unit.FromCentimeter(4);
column = table.AddColumn(); column = table.AddColumn();
column.Width = Unit.FromCentimeter(1); column.Width = Unit.FromCentimeter(1);
@ -781,7 +897,7 @@ namespace bsmd.ReportGenerator
hRow.Cells[4].AddParagraph("Arr."); hRow.Cells[4].AddParagraph("Arr.");
hRow.Cells[5].AddParagraph("Dep."); hRow.Cells[5].AddParagraph("Dep.");
hRow.Cells[6].AddParagraph("Ship sec. level"); hRow.Cells[6].AddParagraph("Ship sec. level");
hRow.Cells[7].AddParagraph("sec. matter to report"); hRow.Cells[7].AddParagraph("Sec. matter to report");
hRow.Cells[8].AddParagraph("GISIS"); hRow.Cells[8].AddParagraph("GISIS");
for(int i=0;i<sec.LastTenPortFacilitesCalled.Count;i++) { for(int i=0;i<sec.LastTenPortFacilitesCalled.Count;i++) {
@ -804,6 +920,105 @@ namespace bsmd.ReportGenerator
row.Cells[8].AddParagraph(lastTenPortFacilitiesCalled.PortFacilityGISISCode ?? ""); row.Cells[8].AddParagraph(lastTenPortFacilitiesCalled.PortFacilityGISISCode ?? "");
} }
private static void CreateShip2ShipActivitiesTable(Document document, Message message)
{
SEC sec = message.Elements[0] as SEC;
if(sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Count > 0)
{
document.LastSection.AddParagraph("Ship-to-ship Activities", "Heading3");
Table table = document.LastSection.AddTable();
table.Format.Font.Size = 8;
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.9);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1.5);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
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(1.5);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(3);
Row hRow = table.AddRow();
hRow.Cells[1].AddParagraph("Location");
hRow.Cells[1].MergeRight = 3;
hRow = table.AddRow();
hRow.Cells[0].AddParagraph("No.");
hRow.Cells[1].AddParagraph("Name");
hRow.Cells[2].AddParagraph("LoCode");
hRow.Cells[3].AddParagraph("Lat");
hRow.Cells[4].AddParagraph("Lon");
hRow.Cells[5].AddParagraph("From");
hRow.Cells[6].AddParagraph("To");
hRow.Cells[7].AddParagraph("Activity");
hRow.Cells[8].AddParagraph("Sec. matter to report");
for (int i = 0; i < sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Count; i++)
{
Row row = table.AddRow();
BSMDDocument.SetShip2ShipActivity((i + 1), ((ShipToShipActivitiesDuringLastTenPortFacilitiesCalled)sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i]), row);
}
}
}
private static void SetShip2ShipActivity(int p, ShipToShipActivitiesDuringLastTenPortFacilitiesCalled s2sActivity, Row row)
{
row.Cells[0].AddParagraph(p.ToString());
row.Cells[1].AddParagraph(s2sActivity.ShipToShipActivityLocationName ?? "");
row.Cells[2].AddParagraph(s2sActivity.ShipToShipActivityLocationLoCode ?? "");
row.Cells[3].AddParagraph(s2sActivity.ShipToShipActivityLocationCoordinatesLatitude.HasValue ? s2sActivity.ShipToShipActivityLocationCoordinatesLatitude.ToString() : "");
row.Cells[4].AddParagraph(s2sActivity.ShipToShipActivityLocationCoordinatesLongitude.HasValue ? s2sActivity.ShipToShipActivityLocationCoordinatesLongitude.ToString() : "");
row.Cells[5].AddParagraph(s2sActivity.ShipToShipActivityDateFrom.HasValue ? s2sActivity.ShipToShipActivityDateFrom.Value.ToShortDateString() : "");
row.Cells[6].AddParagraph(s2sActivity.ShipToShipActivityDateTo.HasValue ? s2sActivity.ShipToShipActivityDateTo.Value.ToShortDateString() : "");
row.Cells[7].AddParagraph(s2sActivity.ShipToShipActivityType ?? "");
row.Cells[8].AddParagraph(s2sActivity.ShipToShipActivitySecurityMattersToReport ?? "");
}
private static void CreatePortOfItineraryTable(Document document, Message message)
{
BPOL bpol = message.Elements[0] as BPOL;
if ((bpol.CruiseShip ?? false) && (bpol.PortOfItineraries.Count > 0))
{
document.LastSection.AddParagraph("Port of itinerary (cruise)", "Heading3");
Table table = document.LastSection.AddTable();
table.Format.Font.Size = 8;
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(5);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1.5);
column = table.AddColumn();
Row hRow = table.AddRow();
hRow.Cells[0].AddParagraph("No.");
hRow.Cells[1].AddParagraph("Name");
hRow.Cells[2].AddParagraph("ETA");
for (int i = 0; i < bpol.PortOfItineraries.Count; i++)
{
Row row = table.AddRow();
row.Cells[0].AddParagraph((i+1).ToString());
row.Cells[1].AddParagraph(bpol.PortOfItineraries[i].PortOfItineraryName ?? "");
row.Cells[2].AddParagraph(bpol.PortOfItineraries[i].PortOfItineraryETA.HasValue ? bpol.PortOfItineraries[i].PortOfItineraryETA.Value.ToString() : "");
}
}
}
#endregion #endregion
#region BKRD #region BKRD
@ -1011,6 +1226,174 @@ namespace bsmd.ReportGenerator
#endregion #endregion
#region TOWA
private static void CreateTOWATable(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(2);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
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(1);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
Row opRow = table.AddRow();
opRow.Cells[2].AddParagraph("Operator");
opRow.Cells[2].MergeRight = 8;
Row hRow = table.AddRow();
hRow.Cells[1].AddParagraph("Name");
hRow.Cells[2].AddParagraph("Flag");
hRow.Cells[3].AddParagraph("Company Name");
hRow.Cells[4].AddParagraph("Street / No.");
hRow.Cells[5].AddParagraph("Postal Code");
hRow.Cells[6].AddParagraph("Country");
hRow.Cells[7].AddParagraph("Phone");
hRow.Cells[8].AddParagraph("Fax");
hRow.Cells[9].AddParagraph("Email");
hRow.Cells[10].AddParagraph("Gross ton.");
hRow.Cells[11].AddParagraph("Length(m)");
hRow.Cells[12].AddParagraph("Beam(m)");
hRow.Cells[13].AddParagraph("Purpose of call");
hRow.Cells[14].AddParagraph("Draft(m)");
hRow.Cells[15].AddParagraph("Remarks");
for (int i = 0; i < message.Elements.Count; i++)
{
TOWA towa = message.Elements[i] as TOWA;
Row row = table.AddRow();
row.Cells[0].AddParagraph((i + 1).ToString());
row.Cells[1].AddParagraph(towa.TowageOnArrivalName ?? "");
row.Cells[2].AddParagraph(towa.TowageOnArrivalFlag ?? "");
row.Cells[3].AddParagraph(towa.TowageOnArrivalOperatorCompanyName ?? "");
row.Cells[4].AddParagraph(towa.TowageOnArrivalOperatorStreetNameAndNumber);
row.Cells[5].AddParagraph(towa.TowageOnArrivalOperatorPostalCode);
row.Cells[6].AddParagraph(towa.TowageOnArrivalOperatorCountry ?? "");
row.Cells[7].AddParagraph(towa.TowageOnArrivalOperatorPhone);
row.Cells[8].AddParagraph(towa.TowageOnArrivalOperatorFax ?? "");
row.Cells[9].AddParagraph(towa.TowageOnArrivalOperatorEmail ?? "");
row.Cells[10].AddParagraph(towa.TowageOnArrivalGrossTonnage.HasValue ? towa.TowageOnArrivalGrossTonnage.Value.ToString() : "");
row.Cells[11].AddParagraph(towa.TowageOnArrivalLengthOverall_MTR.HasValue ? towa.TowageOnArrivalLengthOverall_MTR.Value.ToString() : "");
row.Cells[12].AddParagraph(towa.TowageOnArrivalBeam_MTR.HasValue ? towa.TowageOnArrivalBeam_MTR.Value.ToString() : "");
row.Cells[13].AddParagraph(towa.TowageOnArrivalPurposeOfCall ?? "");
row.Cells[14].AddParagraph(towa.TowageOnArrivalDraught_DMT.HasValue ? towa.TowageOnArrivalDraught_DMT.Value.ToString() : "");
row.Cells[15].AddParagraph(towa.TowageOnArrivalRemarks ?? "");
}
}
#endregion
#region TOWD
private static void CreateTOWDTable(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(2);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
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(1);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
Row opRow = table.AddRow();
opRow.Cells[2].AddParagraph("Operator");
opRow.Cells[2].MergeRight = 8;
Row hRow = table.AddRow();
hRow.Cells[1].AddParagraph("Name");
hRow.Cells[2].AddParagraph("Flag");
hRow.Cells[3].AddParagraph("Company Name");
hRow.Cells[4].AddParagraph("Street / No.");
hRow.Cells[5].AddParagraph("Postal Code");
hRow.Cells[6].AddParagraph("Country");
hRow.Cells[7].AddParagraph("Phone");
hRow.Cells[8].AddParagraph("Fax");
hRow.Cells[9].AddParagraph("Email");
hRow.Cells[10].AddParagraph("Length(m)");
hRow.Cells[11].AddParagraph("Beam(m)");
hRow.Cells[12].AddParagraph("Draft(m)");
hRow.Cells[13].AddParagraph("Remarks");
for (int i = 0; i < message.Elements.Count; i++)
{
TOWD towd = message.Elements[i] as TOWD;
Row row = table.AddRow();
row.Cells[0].AddParagraph((i + 1).ToString());
row.Cells[1].AddParagraph(towd.TowageOnDepartureName ?? "");
row.Cells[2].AddParagraph(towd.TowageOnDepartureFlag ?? "");
row.Cells[3].AddParagraph(towd.TowageOnDepartureOperatorCompanyName ?? "");
row.Cells[4].AddParagraph(towd.TowageOnDepartureOperatorStreetNameAndNumber);
row.Cells[5].AddParagraph(towd.TowageOnDepartureOperatorPostalCode);
row.Cells[6].AddParagraph(towd.TowageOnDepartureOperatorCountry ?? "");
row.Cells[7].AddParagraph(towd.TowageOnDepartureOperatorPhone);
row.Cells[8].AddParagraph(towd.TowageOnDepartureOperatorFax ?? "");
row.Cells[9].AddParagraph(towd.TowageOnDepartureOperatorEmail ?? "");
row.Cells[10].AddParagraph(towd.TowageOnDepartureLengthOverall_MTR.HasValue ? towd.TowageOnDepartureLengthOverall_MTR.Value.ToString() : "");
row.Cells[11].AddParagraph(towd.TowageOnDepartureBeam_MTR.HasValue ? towd.TowageOnDepartureBeam_MTR.Value.ToString() : "");
row.Cells[12].AddParagraph(towd.TowageOnDepartureDraught_DMT.HasValue ? towd.TowageOnDepartureDraught_DMT.Value.ToString() : "");
row.Cells[13].AddParagraph(towd.TowageOnDepartureRemarks ?? "");
}
}
#endregion
private static void AddActualTableParagraph(Document document, IMessageParagraph paragraph, bool isSubTable) private static void AddActualTableParagraph(Document document, IMessageParagraph paragraph, bool isSubTable)
{ {
@ -1145,6 +1528,19 @@ namespace bsmd.ReportGenerator
} }
} }
break; break;
case "General Description of Cargo":
{
switch(value)
{
case "0": result = "Container"; break;
case "1": result = "Vehicles"; break;
case "2": result = "Conventional general cargo"; break;
case "3": result = "Dry cargo in bulk"; break;
case "4": result = "Liquid cargo in bulk"; break;
default: result = "empty"; break;
}
}
break;
default: default:
break; break;
} }
@ -1152,13 +1548,14 @@ namespace bsmd.ReportGenerator
if(propertyName.Contains("flag", StringComparison.OrdinalIgnoreCase)) if(propertyName.Contains("flag", StringComparison.OrdinalIgnoreCase))
if (LocalizedLookup.getNationalities().ContainsKey(value)) if (LocalizedLookup.getNationalities().ContainsKey(value))
result = LocalizedLookup.getNationalities()[value]; result = LocalizedLookup.getNationalities()[value];
if(propertyName.Contains("port", StringComparison.OrdinalIgnoreCase)) if(propertyName.Contains("port", StringComparison.OrdinalIgnoreCase))
{ {
string portName = LocodeDB.PortNameFromLocode(value); string portName = LocodeDB.PortNameFromLocode(value);
if (!portName.IsNullOrEmpty()) if (!portName.IsNullOrEmpty())
{ {
result = string.Format("{0} - {1}", value, portName); result = portName;
//result = string.Format("{0} - {1}", value, portName);
} }
} }

View File

@ -13,7 +13,7 @@ namespace bsmd.ReportGenerator
/// </summary> /// </summary>
public class LabelStorage public class LabelStorage
{ {
private static SQLiteConnection _con; private static readonly SQLiteConnection _con;
private const string _locode_DB_NAME = "report.db"; private const string _locode_DB_NAME = "report.db";
private static Dictionary<string, string> _collectionLabelDict = null; private static Dictionary<string, string> _collectionLabelDict = null;

View File

@ -45,32 +45,32 @@
<ItemGroup> <ItemGroup>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath> <HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="MigraDoc.DocumentObjectModel"> <Reference Include="MigraDoc.DocumentObjectModel-gdi, Version=1.50.5147.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>..\packages\PDFsharp-MigraDoc-GDI.1.32.4334.0\lib\net20\MigraDoc.DocumentObjectModel.dll</HintPath> <HintPath>..\packages\PDFsharp-MigraDoc-gdi.1.50.5147\lib\net20\MigraDoc.DocumentObjectModel-gdi.dll</HintPath>
</Reference> </Reference>
<Reference Include="MigraDoc.Rendering"> <Reference Include="MigraDoc.Rendering-gdi, Version=1.50.5147.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>..\packages\PDFsharp-MigraDoc-GDI.1.32.4334.0\lib\net20\MigraDoc.Rendering.dll</HintPath> <HintPath>..\packages\PDFsharp-MigraDoc-gdi.1.50.5147\lib\net20\MigraDoc.Rendering-gdi.dll</HintPath>
</Reference> </Reference>
<Reference Include="MigraDoc.RtfRendering"> <Reference Include="MigraDoc.RtfRendering-gdi, Version=1.50.5147.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>..\packages\PDFsharp-MigraDoc-GDI.1.32.4334.0\lib\net20\MigraDoc.RtfRendering.dll</HintPath> <HintPath>..\packages\PDFsharp-MigraDoc-gdi.1.50.5147\lib\net20\MigraDoc.RtfRendering-gdi.dll</HintPath>
</Reference> </Reference>
<Reference Include="PdfSharp"> <Reference Include="PdfSharp-gdi, Version=1.50.5147.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>..\packages\PDFsharp-MigraDoc-GDI.1.32.4334.0\lib\net20\PdfSharp.dll</HintPath> <HintPath>..\packages\PDFsharp-MigraDoc-gdi.1.50.5147\lib\net20\PdfSharp-gdi.dll</HintPath>
</Reference> </Reference>
<Reference Include="PdfSharp.Charting"> <Reference Include="PdfSharp.Charting-gdi, Version=1.50.5147.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>..\packages\PDFsharp-MigraDoc-GDI.1.32.4334.0\lib\net20\PdfSharp.Charting.dll</HintPath> <HintPath>..\packages\PDFsharp-MigraDoc-gdi.1.50.5147\lib\net20\PdfSharp.Charting-gdi.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration.Install" /> <Reference Include="System.Configuration.Install" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Data.SQLite, Version=1.0.106.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL"> <Reference Include="System.Data.SQLite, Version=1.0.113.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SQLite.Core.1.0.106.0\lib\net45\System.Data.SQLite.dll</HintPath> <HintPath>..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.113.3\lib\net45\System.Data.SQLite.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Management" /> <Reference Include="System.Management" />
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
@ -161,12 +161,12 @@
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" /> <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Import Project="..\packages\System.Data.SQLite.Core.1.0.106.0\build\net45\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.106.0\build\net45\System.Data.SQLite.Core.targets')" /> <Import Project="..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.113.3\build\net45\Stub.System.Data.SQLite.Core.NetFramework.targets" Condition="Exists('..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.113.3\build\net45\Stub.System.Data.SQLite.Core.NetFramework.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.106.0\build\net45\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.106.0\build\net45\System.Data.SQLite.Core.targets'))" /> <Error Condition="!Exists('..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.113.3\build\net45\Stub.System.Data.SQLite.Core.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.113.3\build\net45\Stub.System.Data.SQLite.Core.NetFramework.targets'))" />
</Target> </Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

Binary file not shown.

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="log4net" version="2.0.8" targetFramework="net45" /> <package id="log4net" version="2.0.8" targetFramework="net45" />
<package id="PDFsharp-MigraDoc-GDI" version="1.32.4334.0" targetFramework="net45" /> <package id="PDFsharp-MigraDoc-gdi" version="1.50.5147" targetFramework="net45" />
<package id="System.Data.SQLite.Core" version="1.0.106.0" targetFramework="net45" /> <package id="Stub.System.Data.SQLite.Core.NetFramework" version="1.0.113.3" targetFramework="net45" />
<package id="System.Data.SQLite.Core" version="1.0.113.7" targetFramework="net45" />
</packages> </packages>

View File

@ -1,4 +1,45 @@
Es gibt zwei unterschiedliche Verfahren: Änderung/Erweiterung:
Bearbeitet:
- "Flag" Code entfernt in Länderdarstellung
- Tabelle Ship2ShipActivities ergänzt
- Tabelle PortOfItinerary statt fortlaufende Einträge
- Tabelle MDH - Sanitary Measures
- Tabelle MDH - Infected Areas
- PoCL30Days - Port name statt Locode
05/2021: Überarbeitung des PDF Reports
Siehe die in "misc" hinterlegten Vorlagen / Änderungswünsche
Daher hier einmal die aktuellen Auszüge mit Anmerkungen dazu:
MUMBAI_MAERSK_DEBKE-2020-RVKWTH_TOWA_TOWD_SEC_BPOL_MDH.docx
MUMBAI_MAERSK_DEBKE-2020-RVKWTH_TIEFA_POBA_BKRA_TOWA_NOA_NOD_STAT_NAME_INFO_SERV_LADG_TIEFD_POBD_BKRD_TOWD_SEC_PRE72H_BPOL_CREW_PAS_MDH_HAZA_HAZD_WAS_ATA_ATD_AGNT.docx
Gelb = Nur Klartext (Keine Codierung)
Rot = Felder ganz raus aus dem Report
Grün = Als Tabelle
Türkis = Umwandlung in Klartext
Und besteht generell die Möglichkeit, dass leere Felder gar nicht im Report angezeigt werden?
Was das Gefahrgut angeht:
Wenn es eine Tabelle werden würde wäre es vermutlich schon ausreichend.
Es muss ja nicht zwangsläufig identich zum DAKOSY-Auszug aufgebaut sein, oder @bastianguttner ?
Alte Notizen:
PDF Library
___________
Es gibt zwei unterschiedliche Verfahren:
1) MigraDoc Document (MigraDoc.*.dll) 1) MigraDoc Document (MigraDoc.*.dll)
Das erfolgt im HTML Style bei dem man einfach Paragrafen an ein Dokument anfügt und der Das erfolgt im HTML Style bei dem man einfach Paragrafen an ein Dokument anfügt und der

View File

@ -35,7 +35,7 @@ namespace bsmd.database
[Browsable(false)] [Browsable(false)]
public NOA_NOD NOA_NOD { get; set; } public NOA_NOD NOA_NOD { get; set; }
[ShowReport] // [ShowReport]
[ENI2Validation] [ENI2Validation]
[DataMember] [DataMember]
public int CallPurposeCode { get; set; } public int CallPurposeCode { get; set; }

View File

@ -1365,11 +1365,11 @@ namespace bsmd.database
if (core == null) return; if (core == null) return;
using (SqlCommand cmd = new SqlCommand()) using (SqlCommand cmd = new SqlCommand())
{ {
cmd.CommandText = "SELECT COUNT(*) FROM MessageHeader WHERE MessageHeader.MessageCoreId = @ID"; cmd.CommandText = "SELECT COUNT(*) FROM MessageHeader WHERE MessageHeader.MessageCoreId = @ID AND MessageHeader.NotificationClass > 2 AND MessageHeader.NotificationClass < 28";
cmd.Parameters.AddWithValue("@ID", core.Id); cmd.Parameters.AddWithValue("@ID", core.Id);
int total = this.PerformReadIntQuery(cmd) ?? 0; int total = this.PerformReadIntQuery(cmd) ?? 0;
cmd.CommandText = "SELECT COUNT(*) FROM MessageHeader WHERE MessageHeader.MessageCoreId = @ID AND MessageHeader.BSMDStatus = 3"; cmd.CommandText = "SELECT COUNT(*) FROM MessageHeader WHERE MessageHeader.MessageCoreId = @ID AND MessageHeader.BSMDStatus = 5 AND MessageHeader.NotificationClass > 2 AND MessageHeader.NotificationClass < 28"; // compare "CONFIRMED"
int sent = this.PerformReadIntQuery(cmd) ?? 0; int sent = this.PerformReadIntQuery(cmd) ?? 0;
core.NumberSent = string.Format("{0}/{1}", sent, total); core.NumberSent = string.Format("{0}/{1}", sent, total);

View File

@ -17,7 +17,8 @@ namespace bsmd.database
[DataContract] [DataContract]
public class INFO : DatabaseEntity public class INFO : DatabaseEntity
{ {
private static ILog _log = LogManager.GetLogger(typeof(INFO)); // private static ILog _log = LogManager.GetLogger(typeof(INFO));
public INFO() public INFO()
{ {
this.tablename = "[dbo].[INFO]"; this.tablename = "[dbo].[INFO]";
@ -219,6 +220,15 @@ namespace bsmd.database
if(this.MessageCore.PoC != "DEHAM") if(this.MessageCore.PoC != "DEHAM")
errors.Add(RuleEngine.CreateError(ValidationCode.PORTAREA, "PortArea", this.PortArea ?? "", "INFO", "", this.Tablename)); errors.Add(RuleEngine.CreateError(ValidationCode.PORTAREA, "PortArea", this.PortArea ?? "", "INFO", "", this.Tablename));
} }
if(DeplacementSummerDraught_TNE.HasValue)
{
if(DeplacementSummerDraught_TNE < 100)
{
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "DeadWeightSummer_TNE valid?", null, this.Title, null, this.Tablename));
}
}
} }
#endregion #endregion

View File

@ -99,20 +99,17 @@ namespace bsmd.database
[LookupName("MDH.SanitaryMeasuresApplied")] [LookupName("MDH.SanitaryMeasuresApplied")]
[ENI2Validation] [ENI2Validation]
public bool? SanitaryMeasuresApplied { get; set; } public bool? SanitaryMeasuresApplied { get; set; }
[ShowReport]
[LookupName("MDH.SanitaryMeasuresType_1")] // TODO: NSW 3.0: wird ein Array [LookupName("MDH.SanitaryMeasuresType_1")] // TODO: NSW 3.0: wird ein Array
[MaxLength(100)] [MaxLength(100)]
[ENI2Validation] [ENI2Validation]
public string SanitaryMeasuresType { get; set; } public string SanitaryMeasuresType { get; set; }
[ShowReport]
[LookupName("MDH.SanitaryMeasuresLocation_1")] [LookupName("MDH.SanitaryMeasuresLocation_1")]
[MaxLength(100)] [MaxLength(100)]
[ENI2Validation] [ENI2Validation]
public string SanitaryMeasuresLocation { get; set; } public string SanitaryMeasuresLocation { get; set; }
[ShowReport]
[LookupName("MDH.SanitaryMeasuresDate_1")] [LookupName("MDH.SanitaryMeasuresDate_1")]
[ENI2Validation] [ENI2Validation]
public DateTime? SanitaryMeasuresDate { get; set; } public DateTime? SanitaryMeasuresDate { get; set; }
@ -165,14 +162,12 @@ namespace bsmd.database
[LookupName("MDH.InfectedAreaVisited")] [LookupName("MDH.InfectedAreaVisited")]
[ENI2Validation] [ENI2Validation]
public bool? InfectedAreaVisited { get; set; } public bool? InfectedAreaVisited { get; set; }
[ShowReport]
[LookupName("MDH.InfectedAreaPort_1")] // TODO: NSW 3.0: wird ein Array [LookupName("MDH.InfectedAreaPort_1")] // TODO: NSW 3.0: wird ein Array
[MaxLength(100)] [MaxLength(100)]
[ENI2Validation] [ENI2Validation]
public string InfectedAreaPort { get; set; } public string InfectedAreaPort { get; set; }
[ShowReport]
[LookupName("MDH.InfectedAreaDate_1")] [LookupName("MDH.InfectedAreaDate_1")]
[ENI2Validation] [ENI2Validation]
public DateTime? InfectedAreaDate { get; set; } public DateTime? InfectedAreaDate { get; set; }

View File

@ -2,6 +2,6 @@
[assembly: AssemblyCompany("schick Informatik")] [assembly: AssemblyCompany("schick Informatik")]
[assembly: AssemblyProduct("BSMD NSW interface")] [assembly: AssemblyProduct("BSMD NSW interface")]
[assembly: AssemblyInformationalVersion("6.2.0")] [assembly: AssemblyInformationalVersion("6.2.1")]
[assembly: AssemblyCopyright("Copyright © 2014-2021 schick Informatik")] [assembly: AssemblyCopyright("Copyright © 2014-2021 schick Informatik")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]

View File

@ -1,4 +1,4 @@
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("6.2.0.*")] [assembly: AssemblyVersion("6.2.1.*")]

View File

@ -340,7 +340,7 @@ namespace bsmd.database
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Length valid?", null, this.Title, null, this.Tablename)); violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Length valid?", null, this.Title, null, this.Tablename));
if (this.Beam_MTR.HasValue && ((this.Beam_MTR.Value < 5) || (this.Beam_MTR.Value > 65))) if (this.Beam_MTR.HasValue && ((this.Beam_MTR.Value < 5) || (this.Beam_MTR.Value > 65)))
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Beam valid?", null, this.Title, null, this.Tablename)); violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Beam valid?", null, this.Title, null, this.Tablename));
if (this.GrossTonnage.HasValue && ((this.GrossTonnage.Value < 50) || (this.GrossTonnage > 500000))) if (this.GrossTonnage.HasValue && ((this.GrossTonnage.Value < 100) || (this.GrossTonnage > 500000)))
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Gross tonnage valid?", null, this.Title, null, this.Tablename)); violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Gross tonnage valid?", null, this.Title, null, this.Tablename));
if((this.PortOfRegistry?.Length > 1) && (this.Flag?.Length == 2)) if((this.PortOfRegistry?.Length > 1) && (this.Flag?.Length == 2))