Zwischenstand arbeiten an NSW 3.0

This commit is contained in:
Daniel Schick 2016-03-21 17:44:43 +00:00
parent 8d57ed7042
commit 936415f772
15 changed files with 13672 additions and 14269 deletions

Binary file not shown.

Binary file not shown.

View File

@ -1,19 +1,11 @@
using System;
using bsmd.database;
using log4net;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.IO;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;
using System.Timers;
using log4net;
using bsmd.database;
using bsmd.dbh;
using bsmd.hisnord;
namespace SendNSWMessageService
{

View File

@ -1,10 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Linq;
using System.Threading.Tasks;
using System.ComponentModel;
namespace SendNSWMessageService
{

File diff suppressed because it is too large Load Diff

View File

@ -15,7 +15,8 @@ using bsmd.database;
using bsmd.dbh.DBHWebReference;
namespace bsmd.dbh
{
{
public class Request
{
private static ILog _log = LogManager.GetLogger(typeof(Request));
@ -91,7 +92,11 @@ namespace bsmd.dbh
}
rootVisit.PortOfCall = message.MessageCore.PoC;
rootVisit.ETAPortOfCall = message.MessageCore.ETA.Value;
if (message.MessageCore.ETA.HasValue)
rootVisit.ETAPortOfCall = message.MessageCore.ETA.Value.ToDBHDateString();
else
rootVisit.ETAPortOfCall = null;
item = rootVisit;
break;
@ -116,7 +121,10 @@ namespace bsmd.dbh
rootTransit.Item = message.MessageCore.ENI;
}
rootTransit.ETAKielCanal = message.MessageCore.ETA.Value;
if (message.MessageCore.ETA.HasValue)
rootTransit.ETAKielCanal = message.MessageCore.ETA.Value.ToDBHDateString();
else
rootTransit.ETAKielCanal = null;
item = rootTransit;
break;
@ -150,13 +158,13 @@ namespace bsmd.dbh
if (noa_nod.ETAToKielCanal.HasValue)
{
choiceList.Add(ItemsChoiceType.ETAToKielCanal);
choices.Add(noa_nod.ETAToKielCanal.Value);
choices.Add(noa_nod.ETAToKielCanal.Value.ToDBHDateString());
}
if (noa_nod.ETDFromKielCanal.HasValue)
{
choiceList.Add(ItemsChoiceType.ETDFromKielCanal);
choices.Add(noa_nod.ETDFromKielCanal.Value);
choices.Add(noa_nod.ETDFromKielCanal.Value.ToDBHDateString());
}
}
else
@ -164,13 +172,13 @@ namespace bsmd.dbh
if (noa_nod.ETAToPortOfCall.HasValue)
{
choiceList.Add(ItemsChoiceType.ETAToPortOfCall);
choices.Add(noa_nod.ETAToPortOfCall.Value);
choices.Add(noa_nod.ETAToPortOfCall.Value.ToDBHDateString());
}
if (noa_nod.ETDFromPortOfCall.HasValue)
{
choiceList.Add(ItemsChoiceType.ETDFromPortOfCall);
choices.Add(noa_nod.ETDFromPortOfCall.Value);
choices.Add(noa_nod.ETDFromPortOfCall.Value.ToDBHDateString());
}
for (int i = 0; i < noa_nod.CallPurposes.Count; i++)
@ -262,7 +270,7 @@ namespace bsmd.dbh
if (sec.SECSimplification ?? false)
{
rootSEC.ItemsElementName[0] = ItemsChoiceType1.SECSimplification;
rootSEC.Items[0] = RootSECSECSimplification.Y;
rootSEC.Items[0] = "Y";
rootSEC.ItemsElementName[1] = ItemsChoiceType1.PortOfCallWhereCompleteSECNotified;
rootSEC.Items[1] = sec.PortOfCallWhereCompleteSECNotified;
}
@ -279,24 +287,24 @@ namespace bsmd.dbh
rootSEC.ItemsElementName[4] = ItemsChoiceType1.ValidISSCOnBoard;
rootSEC.Items[4] = sec.ValidISSCOnBoard ?? false ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N;
rootSEC.ItemsElementName[5] = ItemsChoiceType1.ISSCType;
rootSEC.Items[5] = (RootSECISSCType) (sec.ISSCType ?? 0);
rootSEC.Items[5] = (ISSCType) (sec.ISSCType ?? 0);
rootSEC.ItemsElementName[6] = ItemsChoiceType1.ISSCIssuerName;
rootSEC.Items[6] = sec.ISSCIssuerName;
rootSEC.ItemsElementName[7] = ItemsChoiceType1.ISSCDateOfExpiration;
if(sec.ISSCDateOfExpiration.HasValue)
rootSEC.Items[7] = sec.ISSCDateOfExpiration.Value;
rootSEC.ItemsElementName[8] = ItemsChoiceType1.ApprovedSecurityPlanOnBoard;
rootSEC.Items[8] = sec.ApprovedSecurityPlanOnBoard ?? false ? RootSECApprovedSecurityPlanOnBoard.Y : RootSECApprovedSecurityPlanOnBoard.N;
rootSEC.Items[8] = sec.ApprovedSecurityPlanOnBoard ?? false ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N;
rootSEC.ItemsElementName[9] = ItemsChoiceType1.PortFacilityOfArrival;
rootSEC.Items[9] = sec.PortFacilityOfArrival;
rootSEC.ItemsElementName[10] = ItemsChoiceType1.GeneralDescriptionOfCargo;
if (sec.GeneralDescriptionOfCargo.HasValue)
rootSEC.Items[10] = (RootSECGeneralDescriptionOfCargo)sec.GeneralDescriptionOfCargo.Value;
rootSEC.Items[10] = (CargoDescription)sec.GeneralDescriptionOfCargo.Value;
rootSEC.ItemsElementName[11] = ItemsChoiceType1.ReasonsForNoValidISSC;
rootSEC.Items[11] = sec.ReasonsForNoValidISSC;
rootSEC.ItemsElementName[12] = ItemsChoiceType1.ISSCIssuerType;
rootSEC.Items[12] = (RootSECISSCIssuerType) (sec.ISSCIssuerType ?? 0);
rootSEC.Items[12] = (ISSCIssuerType) (sec.ISSCIssuerType ?? 0);
rootSEC.ItemsElementName[13] = ItemsChoiceType1.CSOEMail;
rootSEC.Items[13] = sec.CSOEMail;
@ -322,12 +330,12 @@ namespace bsmd.dbh
for (int i = 0; i < sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Count; index++, i++ )
{
rootSEC.ItemsElementName[index] = ItemsChoiceType1.ShipToShipActivities;
RootSECShipToShipActivitiesDuringLastTenPortFacilitiesCalled s2s = new RootSECShipToShipActivitiesDuringLastTenPortFacilitiesCalled();
RootSECShipToShipActivities s2s = new RootSECShipToShipActivities();
rootSEC.Items[index] = s2s;
s2s.ShipToShipActivityLocation = new RootSECShipToShipActivitiesDuringLastTenPortFacilitiesCalledShipToShipActivityLocation();
s2s.ShipToShipActivityLocation = new RootSECShipToShipActivitiesShipToShipActivityLocation();
s2s.ShipToShipActivityLocation.ShipToShipActivityLocationName = sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityLocationName;
s2s.ShipToShipActivityLocation.ShipToShipActivityLocationLoCode = sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityLocationLoCode;
s2s.ShipToShipActivityLocation.ShipToShipActivityLocationCoordinates = new RootSECShipToShipActivitiesDuringLastTenPortFacilitiesCalledShipToShipActivityLocationShipToShipActivityLocationCoordinates();
s2s.ShipToShipActivityLocation.ShipToShipActivityLocationCoordinates = new RootSECShipToShipActivitiesShipToShipActivityLocationShipToShipActivityLocationCoordinates();
if (sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityLocationCoordinatesLatitude.HasValue)
s2s.ShipToShipActivityLocation.ShipToShipActivityLocationCoordinates.ShipToShipActivityLocationCoordinatesLatitude = sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityLocationCoordinatesLatitude.Value;
if (sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityLocationCoordinatesLongitude.HasValue)
@ -693,7 +701,7 @@ namespace bsmd.dbh
rootMDH.Items = new object[2];
rootMDH.ItemsElementName = new ItemsChoiceType2[2];
rootMDH.ItemsElementName[0] = ItemsChoiceType2.MDHSimplification;
rootMDH.Items[0] = RootMDHMDHSimplification.Y;
rootMDH.Items[0] = "Y";
rootMDH.ItemsElementName[1] = ItemsChoiceType2.PortOfCallWhereCompleteMDHNotified;
rootMDH.Items[1] = mdh.PortOfCallWhereCompleteMDHNotified;
}
@ -704,7 +712,7 @@ namespace bsmd.dbh
List<ItemsChoiceType2> choiceTypes2 = new List<ItemsChoiceType2>();
choiceTypes2.Add(ItemsChoiceType2.NonAccidentialDeathsDuringVoyage);
mdhItems.Add((mdh.NonAccidentalDeathsDuringVoyage ?? false) ? RootMDHNonAccidentialDeathsDuringVoyage.Y : RootMDHNonAccidentialDeathsDuringVoyage.N);
mdhItems.Add((mdh.NonAccidentalDeathsDuringVoyage ?? false) ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N);
if (mdh.NonAccidentalDeathsDuringVoyage ?? false)
{
@ -713,10 +721,10 @@ namespace bsmd.dbh
}
choiceTypes2.Add(ItemsChoiceType2.SuspisionInfectiousNature);
mdhItems.Add(mdh.SuspisionInfectiousNature ?? false ? RootMDHSuspisionInfectiousNature.Y : RootMDHSuspisionInfectiousNature.N);
mdhItems.Add(mdh.SuspisionInfectiousNature ?? false ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N);
choiceTypes2.Add(ItemsChoiceType2.NumberOfIllPersonsHigherThanExpected);
mdhItems.Add(mdh.NumberOfIllPersonsHigherThanExpected ?? false ? RootMDHNumberOfIllPersonsHigherThanExpected.Y : RootMDHNumberOfIllPersonsHigherThanExpected.N);
mdhItems.Add(mdh.NumberOfIllPersonsHigherThanExpected ?? false ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N);
if (mdh.NumberOfIllPersonsHigherThanExpected ?? false)
{
@ -725,16 +733,16 @@ namespace bsmd.dbh
}
choiceTypes2.Add(ItemsChoiceType2.SickPersonsOnBoard);
mdhItems.Add(mdh.SickPersonsOnBoard ?? false ? RootMDHSickPersonsOnBoard.Y : RootMDHSickPersonsOnBoard.N);
mdhItems.Add(mdh.SickPersonsOnBoard ?? false ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N);
choiceTypes2.Add(ItemsChoiceType2.MedicalConsulted);
mdhItems.Add(mdh.MedicalConsulted ?? false ? RootMDHMedicalConsulted.Y : RootMDHMedicalConsulted.N);
mdhItems.Add(mdh.MedicalConsulted ?? false ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N);
choiceTypes2.Add(ItemsChoiceType2.AwareOfConditionsForFurtherInfections);
mdhItems.Add(mdh.AwareOfFurtherInfections ?? false ? RootMDHAwareOfConditionsForFurtherInfections.Y : RootMDHAwareOfConditionsForFurtherInfections.N);
mdhItems.Add(mdh.AwareOfFurtherInfections ?? false ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N);
choiceTypes2.Add(ItemsChoiceType2.SanitaryMeasuresApplied);
mdhItems.Add(mdh.SanitaryMeasuresApplied ?? false ? RootMDHSanitaryMeasuresApplied.Y : RootMDHSanitaryMeasuresApplied.N);
mdhItems.Add(mdh.SanitaryMeasuresApplied ?? false ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N);
if (mdh.SanitaryMeasuresApplied ?? false)
{
@ -751,7 +759,7 @@ namespace bsmd.dbh
}
choiceTypes2.Add(ItemsChoiceType2.StowawaysDetected);
mdhItems.Add(mdh.StowawaysDetected ?? false ? RootMDHStowawaysDetected.Y : RootMDHStowawaysDetected.N);
mdhItems.Add(mdh.StowawaysDetected ?? false ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N);
foreach(StowawaysJoiningLocation sjl in mdh.StowawaysJoiningLocations)
{
@ -760,10 +768,10 @@ namespace bsmd.dbh
}
choiceTypes2.Add(ItemsChoiceType2.SickAnimalOrPetOnBoard);
mdhItems.Add(mdh.SickAnimalOrPetOnBoard ?? false ? RootMDHSickAnimalOrPetOnBoard.Y : RootMDHSickAnimalOrPetOnBoard.N);
mdhItems.Add(mdh.SickAnimalOrPetOnBoard ?? false ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N);
choiceTypes2.Add(ItemsChoiceType2.ValidSanitaryControlExemptionOrCertificateOnBoard);
mdhItems.Add(mdh.ValidSanitaryControlExemptionOrCertificateOnBoard ?? false ? RootMDHValidSanitaryControlExemptionOrCertificateOnBoard.Y : RootMDHValidSanitaryControlExemptionOrCertificateOnBoard.N);
mdhItems.Add(mdh.ValidSanitaryControlExemptionOrCertificateOnBoard ?? false ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N);
if (mdh.DateOfIssue.HasValue && !mdh.PlaceOfIssue.IsNullOrEmpty())
{
@ -775,10 +783,10 @@ namespace bsmd.dbh
}
choiceTypes2.Add(ItemsChoiceType2.SanitaryControlReinspectionRequired);
mdhItems.Add(mdh.SanitaryControlReinspectionRequired ?? false ? RootMDHSanitaryControlReinspectionRequired.Y : RootMDHSanitaryControlReinspectionRequired.N);
mdhItems.Add(mdh.SanitaryControlReinspectionRequired ?? false ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N);
choiceTypes2.Add(ItemsChoiceType2.InfectedAreaVisited);
mdhItems.Add(mdh.InfectedAreaVisited ?? false ? RootMDHInfectedAreaVisited.Y : RootMDHInfectedAreaVisited.N);
mdhItems.Add(mdh.InfectedAreaVisited ?? false ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N);
foreach (InfectedArea ia in mdh.InfectedAreas)
{
@ -838,7 +846,7 @@ namespace bsmd.dbh
rootWAS.Items = new object[1];
rootWAS.ItemsElementName = new ItemsChoiceType3[1];
rootWAS.ItemsElementName[0] = ItemsChoiceType3.WasteDisposalValidExemption;
rootWAS.Items[0] = RootWASWasteDisposalValidExemption.Y;
rootWAS.Items[0] = "Y";
}
else
{
@ -846,7 +854,7 @@ namespace bsmd.dbh
rootWAS.ItemsElementName = new ItemsChoiceType3[14];
rootWAS.ItemsElementName[0] = ItemsChoiceType3.ConfirmationOfCorrectness;
rootWAS.Items[0] = was.ConfirmationOfCorrectness ?? false ? RootWASConfirmationOfCorrectness.Y : RootWASConfirmationOfCorrectness.N;
rootWAS.Items[0] = was.ConfirmationOfCorrectness ?? false ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N;
rootWAS.ItemsElementName[1] = ItemsChoiceType3.LastWasteDisposalDate;
if (was.LastWasteDisposalDate.HasValue)
@ -858,7 +866,7 @@ namespace bsmd.dbh
rootWAS.ItemsElementName[3] = ItemsChoiceType3.WasteDisposalDelivery;
if (was.WasteDisposalDelivery.HasValue)
rootWAS.Items[3] = (RootWASWasteDisposalDelivery)was.WasteDisposalDelivery.Value;
rootWAS.Items[3] = (DisposalType)was.WasteDisposalDelivery.Value;
rootWAS.ItemsElementName[4] = ItemsChoiceType3.WasteDisposalServiceProviderName;
if (was.WasteDisposalServiceProvider.Count > 0)
@ -989,27 +997,32 @@ namespace bsmd.dbh
if (haz.NoDPGOnBoardOnArrival ?? false)
{
rootHAZA.Items = new object[1];
rootHAZA.Items[0] = RootHAZANoDPGOnBoardOnArrival.Y;
rootHAZA.Items[0] = "Y";
rootHAZA.ItemsElementName = new ItemsChoiceType5[1];
rootHAZA.ItemsElementName[0] = ItemsChoiceType5.NoDPGOnBoardOnArrival;
}
else
{
rootHAZA.Items = new object[3];
rootHAZA.ItemsElementName = new ItemsChoiceType5[3];
// if(haz.DPGManifestOnBoardOnArrival.HasValue)
rootHAZA.Items[0] = (haz.DPGManifestOnBoardOnArrival ?? false) ? RootHAZADPGManifestOnBoardOnArrival.Y : RootHAZADPGManifestOnBoardOnArrival.N;
rootHAZA.ItemsElementName[0] = ItemsChoiceType5.DPGManifestOnBoardOnArrival;
rootHAZA.Items[0] = (haz.DPGManifestOnBoardOnArrival ?? false) ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N;
#region HAZ positions
rootHAZA.ItemsElementName[1] = ItemsChoiceType5.DPGOnArrival;
RootHAZADPGOnArrival dpgOnArrival = new RootHAZADPGOnArrival();
#region IMDG
if (haz.IMDGPositions.Count > 0)
{
dpgOnArrival.DPGItemIMDG = new IMDGPosition[haz.IMDGPositions.Count];
dpgOnArrival.DPGItemIMDG = new bsmd.dbh.DBHWebReference.IMDGPosition[haz.IMDGPositions.Count];
for (int i = 0; i < haz.IMDGPositions.Count; i++)
{
bsmd.database.IMDGPosition imdgPos = haz.IMDGPositions[i];
IMDGPosition rootIMDG = new IMDGPosition();
bsmd.dbh.DBHWebReference.IMDGPosition rootIMDG = new bsmd.dbh.DBHWebReference.IMDGPosition();
rootIMDG.UNNumber = imdgPos.UNNumber;
if (imdgPos.PackingGroup.HasValue)
@ -1083,10 +1096,10 @@ namespace bsmd.dbh
#region IBC
if (haz.IBCPositions.Count > 0)
{
dpgOnArrival.DPGItemIBC = new IBCPosition[haz.IBCPositions.Count];
dpgOnArrival.DPGItemIBC = new bsmd.dbh.DBHWebReference.IBCPosition[haz.IBCPositions.Count];
for (int i = 0; i < haz.IBCPositions.Count; i++)
{
IBCPosition rootIBC = new IBCPosition();
bsmd.dbh.DBHWebReference.IBCPosition rootIBC = new bsmd.dbh.DBHWebReference.IBCPosition();
bsmd.database.IBCPosition ibcPos = haz.IBCPositions[i];
rootIBC.ProductName = ibcPos.ProductName;
@ -1116,10 +1129,10 @@ namespace bsmd.dbh
#region IGC
if (haz.IGCPositions.Count > 0)
{
dpgOnArrival.DPGItemIGC = new IGCPosition[haz.IGCPositions.Count];
dpgOnArrival.DPGItemIGC = new bsmd.dbh.DBHWebReference.IGCPosition[haz.IGCPositions.Count];
for (int i = 0; i < haz.IGCPositions.Count; i++)
{
IGCPosition rootIGC = new IGCPosition();
bsmd.dbh.DBHWebReference.IGCPosition rootIGC = new bsmd.dbh.DBHWebReference.IGCPosition();
bsmd.database.IGCPosition igcPos = haz.IGCPositions[i];
rootIGC.UNNumber = igcPos.UNNumber;
@ -1140,10 +1153,10 @@ namespace bsmd.dbh
#region IMSBC
if (haz.IMSBCPositions.Count > 0)
{
dpgOnArrival.DPGItemIMSBC = new IMSBCPosition[haz.IMSBCPositions.Count];
dpgOnArrival.DPGItemIMSBC = new bsmd.dbh.DBHWebReference.IMSBCPosition[haz.IMSBCPositions.Count];
for (int i = 0; i < haz.IMSBCPositions.Count; i++)
{
IMSBCPosition rootIMSBC = new IMSBCPosition();
bsmd.dbh.DBHWebReference.IMSBCPosition rootIMSBC = new bsmd.dbh.DBHWebReference.IMSBCPosition();
bsmd.database.IMSBCPosition imsbcPos = haz.IMSBCPositions[i];
rootIMSBC.BulkCargoShippingName = imsbcPos.BulkCargoShippingName;
@ -1177,7 +1190,7 @@ namespace bsmd.dbh
rootMarpol.FlashpointInformation = (FlashpointInfoType)marpolPos.FlashpointInformation.Value;
rootMarpol.Flashpoint_CEL = marpolPos.Flashpoint_CEL;
if (marpolPos.Quantity_KGM.HasValue)
rootMarpol.Quantity_KGM = (decimal) marpolPos.Quantity_KGM.Value;
rootMarpol.Quantity_KGM = (decimal)marpolPos.Quantity_KGM.Value;
rootMarpol.StowagePosition = marpolPos.StowagePosition;
rootMarpol.PortOfLoading = marpolPos.PortOfLoading;
rootMarpol.PortOfDischarge = marpolPos.PortOfDischarge;
@ -1192,9 +1205,11 @@ namespace bsmd.dbh
#endregion
rootHAZA.ItemsElementName[2] = ItemsChoiceType5.INFShipClass;
if (haz.INFShipClass.HasValue)
{
RootHAZAINFShipClass infShipClass = (RootHAZAINFShipClass)haz.INFShipClass.Value;
INFClassType infShipClass = (INFClassType) haz.INFShipClass.Value;
rootHAZA.Items[2] = infShipClass;
}
}
@ -1213,16 +1228,21 @@ namespace bsmd.dbh
if (haz.NoDPGOnBoardOnArrival ?? false)
{
rootHAZD.ItemsElementName = new ItemsChoiceType6[1];
rootHAZD.ItemsElementName[0] = ItemsChoiceType6.NoDPGOnBoardOnDeparture;
rootHAZD.Items = new object[1];
rootHAZD.Items[3] = RootHAZDNoDPGOnBoardOnDeparture.Y;
rootHAZD.Items[0] = "Y";
}
else
{
rootHAZD.Items = new object[3];
rootHAZD.ItemsElementName = new ItemsChoiceType6[3];
rootHAZD.ItemsElementName[0] = ItemsChoiceType6.DPGManifestOnBoardOnDeparture;
if (haz.DPGManifestOnBoardOnArrival.HasValue)
rootHAZD.Items[0] = haz.DPGManifestOnBoardOnArrival.Value ? RootHAZDDPGManifestOnBoardOnDeparture.Y : RootHAZDDPGManifestOnBoardOnDeparture.N;
rootHAZD.Items[0] = haz.DPGManifestOnBoardOnArrival.Value ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N;
#region HAZ positions
@ -1231,11 +1251,11 @@ namespace bsmd.dbh
#region IMDG
if (haz.IMDGPositions.Count > 0)
{
dpgOnDeparture.DPGItemIMDG = new IMDGPosition[haz.IMDGPositions.Count];
dpgOnDeparture.DPGItemIMDG = new bsmd.dbh.DBHWebReference.IMDGPosition[haz.IMDGPositions.Count];
for (int i = 0; i < haz.IMDGPositions.Count; i++)
{
bsmd.database.IMDGPosition imdgPos = haz.IMDGPositions[i];
IMDGPosition rootIMDG = new IMDGPosition();
bsmd.dbh.DBHWebReference.IMDGPosition rootIMDG = new bsmd.dbh.DBHWebReference.IMDGPosition();
rootIMDG.UNNumber = imdgPos.UNNumber;
if (imdgPos.PackingGroup.HasValue)
@ -1309,10 +1329,10 @@ namespace bsmd.dbh
#region IBC
if (haz.IBCPositions.Count > 0)
{
dpgOnDeparture.DPGItemIBC = new IBCPosition[haz.IBCPositions.Count];
dpgOnDeparture.DPGItemIBC = new bsmd.dbh.DBHWebReference.IBCPosition[haz.IBCPositions.Count];
for (int i = 0; i < haz.IBCPositions.Count; i++)
{
IBCPosition rootIBC = new IBCPosition();
bsmd.dbh.DBHWebReference.IBCPosition rootIBC = new bsmd.dbh.DBHWebReference.IBCPosition();
bsmd.database.IBCPosition ibcPos = haz.IBCPositions[i];
rootIBC.ProductName = ibcPos.ProductName;
@ -1342,10 +1362,10 @@ namespace bsmd.dbh
#region IGC
if (haz.IGCPositions.Count > 0)
{
dpgOnDeparture.DPGItemIGC = new IGCPosition[haz.IGCPositions.Count];
dpgOnDeparture.DPGItemIGC = new bsmd.dbh.DBHWebReference.IGCPosition[haz.IGCPositions.Count];
for (int i = 0; i < haz.IGCPositions.Count; i++)
{
IGCPosition rootIGC = new IGCPosition();
bsmd.dbh.DBHWebReference.IGCPosition rootIGC = new bsmd.dbh.DBHWebReference.IGCPosition();
bsmd.database.IGCPosition igcPos = haz.IGCPositions[i];
rootIGC.UNNumber = igcPos.UNNumber;
@ -1366,10 +1386,10 @@ namespace bsmd.dbh
#region IMSBC
if (haz.IMSBCPositions.Count > 0)
{
dpgOnDeparture.DPGItemIMSBC = new IMSBCPosition[haz.IMSBCPositions.Count];
dpgOnDeparture.DPGItemIMSBC = new bsmd.dbh.DBHWebReference.IMSBCPosition[haz.IMSBCPositions.Count];
for (int i = 0; i < haz.IMSBCPositions.Count; i++)
{
IMSBCPosition rootIMSBC = new IMSBCPosition();
bsmd.dbh.DBHWebReference.IMSBCPosition rootIMSBC = new bsmd.dbh.DBHWebReference.IMSBCPosition();
bsmd.database.IMSBCPosition imsbcPos = haz.IMSBCPositions[i];
rootIMSBC.BulkCargoShippingName = imsbcPos.BulkCargoShippingName;
@ -1414,13 +1434,16 @@ namespace bsmd.dbh
}
#endregion
rootHAZD.ItemsElementName[1] = ItemsChoiceType6.DPGOnDeparture;
rootHAZD.Items[1] = dpgOnDeparture;
#endregion
rootHAZD.ItemsElementName[2] = ItemsChoiceType6.INFShipClass;
if (haz.INFShipClass.HasValue)
{
RootHAZDINFShipClass infShipClass = (RootHAZDINFShipClass)haz.INFShipClass.Value;
INFClassType infShipClass = (INFClassType)haz.INFShipClass.Value;
rootHAZD.Items[2] = infShipClass;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<DiscoveryClientResultsFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Results>
<DiscoveryClientResult referenceType="System.Web.Services.Discovery.ContractReference" url="file:///E:/work/bsmd/nsw/dbh/answ-osis-extern.wsdl" filename="answ-osis-extern.wsdl" />
<DiscoveryClientResult referenceType="System.Web.Services.Discovery.SchemaReference" url="file:///E:/work/bsmd/nsw/dbh/NSWRequest.xsd" filename="NSWRequest.xsd" />
<DiscoveryClientResult referenceType="System.Web.Services.Discovery.ContractReference" url="file:///E:/svnlager/bsmd/nsw/dbh/answ-osis-extern.wsdl" filename="answ-osis-extern.wsdl" />
<DiscoveryClientResult referenceType="System.Web.Services.Discovery.SchemaReference" url="file:///E:/svnlager/bsmd/nsw/dbh/NSWRequest.xsd" filename="NSWRequest.xsd" />
</Results>
</DiscoveryClientResultsFile>

View File

@ -112,10 +112,10 @@
<WebReferences Include="Web References\" />
</ItemGroup>
<ItemGroup>
<WebReferenceUrl Include="E:\work\bsmd\nsw\dbh\answ-osis-extern.wsdl">
<WebReferenceUrl Include="E:\svnlager\bsmd\nsw\dbh\answ-osis-extern.wsdl">
<UrlBehavior>Dynamic</UrlBehavior>
<RelPath>Web References\DBHWebReference\</RelPath>
<UpdateFromURL>E:\work\bsmd\nsw\dbh\answ-osis-extern.wsdl</UpdateFromURL>
<UpdateFromURL>E:\svnlager\bsmd\nsw\dbh\answ-osis-extern.wsdl</UpdateFromURL>
<ServiceLocationURL>
</ServiceLocationURL>
<CachedDynamicPropName>

View File

@ -43,8 +43,9 @@
<AssemblyOriginatorKeyFile>..\bsmdKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net">
<HintPath>..\packages\log4net.2.0.3\lib\net40-full\log4net.dll</HintPath>
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.5\lib\net45-full\log4net.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration.Install" />
@ -161,10 +162,10 @@
<WebReferences Include="Web References\" />
</ItemGroup>
<ItemGroup>
<WebReferenceUrl Include="C:\work\bsmd\nsw\Herberg\WSAPIFormData.wsdl">
<WebReferenceUrl Include="E:\svnlager\bsmd\nsw\Herberg\WSAPIFormData.wsdl">
<UrlBehavior>Dynamic</UrlBehavior>
<RelPath>Web References\WebReference\</RelPath>
<UpdateFromURL>C:\work\bsmd\nsw\Herberg\WSAPIFormData.wsdl</UpdateFromURL>
<UpdateFromURL>E:\svnlager\bsmd\nsw\Herberg\WSAPIFormData.wsdl</UpdateFromURL>
<ServiceLocationURL>
</ServiceLocationURL>
<CachedDynamicPropName>

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.3" targetFramework="net45" />
</packages>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,244 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--Created with Liquid XML Studio - FREE Community Edition 7.0.3.780 (http://www.liquid-technologies.com)-->
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Root">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="Version">
<xs:annotation>
<xs:documentation>Version number of schema</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:maxLength value="5" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="MessageId" type="xs:string">
<xs:annotation>
<xs:documentation>Unique message identifier.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="VisitId">
<xs:annotation>
<xs:documentation>Required when TransitId is missing and field "Type" is not "VISIT or "TRANSIT"</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="(DE)([A-Z]{3})-([0-9]{4})-([A-Z]{6})" />
<xs:length value="17" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="TransitId">
<xs:annotation>
<xs:documentation>Required when VisitId is missing and field "Type" is not "VISIT or "TRANSIT"</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="(ZZNOK)-([0-9]{4})-([A-Z]{6})" />
<xs:length value="17" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="SisNumbers">
<xs:annotation>
<xs:documentation>A list of SIS numbers. An empty list means that all sent numbers will be deleted. Sending a new list overwrites existing ones completely.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="SisNumber">
<xs:annotation>
<xs:documentation>One SIS number</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z0-9]{4}" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Timestamp" type="xs:dateTime">
<xs:annotation>
<xs:documentation>Timestamp, when the message is sent</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="SenderReference">
<xs:annotation>
<xs:documentation>A customer reference that can be freely filled and will be send back in the following response. No checks are made on this field. When a new Visit- or TransitId is obtained, it should be used as a reference to match the response to its corresponding request.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="35" />
<xs:minLength value="0" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Type">
<xs:annotation>
<xs:documentation>The message type (should be the same as in the request message):
- VISIT: Creates a new declaration with the application for a VisitId. It's allowed to send further data in one or more reporting classes
- TRANSIT: same with TransitId
- DATA: Only data for one or more reporting classes are included
- RESET: The data of one or more reporting classes are deleted
- CANCEL: The whole declaration is cancelled</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="VISIT" />
<xs:enumeration value="TRANSIT" />
<xs:enumeration value="DATA" />
<xs:enumeration value="RESET" />
<xs:enumeration value="CANCEL" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="ReportingClassesFull">
<xs:annotation>
<xs:documentation>Reporting classes that are received with all necessary data.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="ReportingClass" type="ReportingClassCode">
<xs:annotation>
<xs:documentation>The code of a reporting class.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="ReportingClassesPartial">
<xs:annotation>
<xs:documentation>Reporting classes that are received with some data missing (see Messages for errors/violations).</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="ReportingClass" type="ReportingClassCode">
<xs:annotation>
<xs:documentation>The code of a reporting class.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="ReportingClassesError">
<xs:annotation>
<xs:documentation>Reporting classes that are received with some data missing (see Messages for errors/violations).</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="ReportingClass" type="ReportingClassCode">
<xs:annotation>
<xs:documentation>The code of a reporting class.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="ReportingClassesResetted">
<xs:annotation>
<xs:documentation>Reporting classes that are resetted (due to a message with Type RESET).</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="ReportingClass" type="ReportingClassCode">
<xs:annotation>
<xs:documentation>The code of a reporting class.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Messages">
<xs:annotation>
<xs:documentation>Errors, Violations, etc.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Message">
<xs:complexType>
<xs:sequence>
<xs:element name="ID">
<xs:annotation>
<xs:documentation>ID (given from NSW)</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="3" />
<xs:maxLength value="4" />
<xs:pattern value="([1-9][0-9]{2,3})" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Type">
<xs:annotation>
<xs:documentation>Type of Message (functional error, process error in report, process error in message basket, process error during status request, or violation)</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="INFO" />
<xs:enumeration value="WARNING" />
<xs:enumeration value="VIOLATION" />
<xs:enumeration value="ERROR" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Location">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:maxLength value="32" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Text">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:maxLength value="255" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="ReportingClassCode">
<xs:restriction base="xs:string">
<xs:enumeration value="NOA_NOD" />
<xs:enumeration value="ATA" />
<xs:enumeration value="ATD" />
<xs:enumeration value="SEC" />
<xs:enumeration value="AGNT" />
<xs:enumeration value="POBA" />
<xs:enumeration value="POBD" />
<xs:enumeration value="NAME" />
<xs:enumeration value="TIEFA" />
<xs:enumeration value="TIEFD" />
<xs:enumeration value="BKRA" />
<xs:enumeration value="BKRD" />
<xs:enumeration value="STAT" />
<xs:enumeration value="LADG" />
<xs:enumeration value="INFO" />
<xs:enumeration value="SERV" />
<xs:enumeration value="PRE72H" />
<xs:enumeration value="MDH" />
<xs:enumeration value="WAS" />
<xs:enumeration value="CREW" />
<xs:enumeration value="PAS" />
<xs:enumeration value="BPOL" />
<xs:enumeration value="TOWA" />
<xs:enumeration value="TOWD" />
<xs:enumeration value="HAZA" />
<xs:enumeration value="HAZD" />
</xs:restriction>
</xs:simpleType>
</xs:schema>