Updated NSWSendService ohne CREWA / PASA

This commit is contained in:
Daniel Schick 2022-02-22 09:59:36 +01:00
parent 765c7c2503
commit 2cff4b97b6
6 changed files with 1313 additions and 325 deletions

View File

@ -177,23 +177,20 @@ namespace SendNSWMessageService
switch (message.HIS)
{
case Message.NSWProvider.DBH:
case Message.NSWProvider.DBH_TEST:
sendSucceeded = bsmd.dbh.Request.SendMessage(message, message.HIS == Message.NSWProvider.DBH_TEST);
case Message.NSWProvider.DBH:
sendSucceeded = bsmd.dbh.Request.SendMessage(message);
if (!sendSucceeded)
message.InternalStatus = Message.BSMDStatus.SEND_FAILED;
else
didSendSomething = true;
break;
case Message.NSWProvider.DAKOSY:
case Message.NSWProvider.DAKOSY_TEST:
sendSucceeded = bsmd.dakosy.Request.Send(message, true);
case Message.NSWProvider.DAKOSY:
sendSucceeded = bsmd.dakosy.Request.Send(message);
if (!sendSucceeded) message.InternalStatus = Message.BSMDStatus.SEND_FAILED;
else didSendSomething = true;
break;
case Message.NSWProvider.DUDR:
case Message.NSWProvider.DUDR_TEST:
bool? sendResult = bsmd.hisnord.Request.CreateSendFile(core, message, core.InitialHIS == Message.NSWProvider.DUDR_TEST);
case Message.NSWProvider.DUDR:
bool? sendResult = bsmd.hisnord.Request.CreateSendFile(core, message);
if (sendResult.HasValue)
{
didSendSomething = true;
@ -239,19 +236,12 @@ namespace SendNSWMessageService
switch(core.InitialHIS)
{
case Message.NSWProvider.DUDR:
coreSendSucceeded = bsmd.hisnord.Request.CreateSendFile(core, null, false) ?? false;
coreSendSucceeded = bsmd.hisnord.Request.CreateSendFile(core, null) ?? false;
didSendSomething = true;
break;
case Message.NSWProvider.DUDR_TEST:
coreSendSucceeded = bsmd.hisnord.Request.CreateSendFile(core, null, true) ?? false;
didSendSomething = true;
break;
break;
case Message.NSWProvider.DBH:
coreSendSucceeded = bsmd.dbh.Request.SendCancelCore(core, false);
break;
case Message.NSWProvider.DBH_TEST:
coreSendSucceeded = bsmd.dbh.Request.SendCancelCore(core, true);
break;
coreSendSucceeded = bsmd.dbh.Request.SendCancelCore(core);
break;
default:
_log.WarnFormat("Cancelling for HIS {0} is not supported", core.InitialHIS);
break;
@ -259,7 +249,6 @@ namespace SendNSWMessageService
}
}
if (didSendSomething)
{
// falls nur eine Nachricht gescheitert ist geht der Core auf SEND_FAILED, sonst FAILURE

View File

@ -23,7 +23,7 @@ namespace bsmd.dakosy
#region send single message
public static bool Send(Message aMessage, bool useTestSystem)
public static bool Send(Message aMessage)
{
bool retval = true;
try
@ -800,13 +800,10 @@ namespace bsmd.dakosy
if (!serializationFailed)
{
// call sftp client to send
sftp.Put(fileName,
useTestSystem ? Properties.Settings.Default.RemoteTestIncomingDir : Properties.Settings.Default.RemoteProdIncomingDir);
sftp.Put(fileName, Properties.Settings.Default.RemoteProdIncomingDir);
}
// remove sent file if not test mode
if (!useTestSystem)
File.Delete(fileName);
File.Delete(fileName);
}
catch(Exception ex)
{

View File

@ -180,15 +180,7 @@ namespace bsmd.database
[Description("HIS-Nord")]
DUDR,
[Description("DBH Testsystem")]
DBH_TEST,
[Description("Dakosy Testsystem")]
DAKOSY_TEST,
[Description("HIS-Nord Testsystem")]
DUDR_TEST
}
// Late to the party: generic flags Enum/Field

View File

@ -21,7 +21,7 @@ namespace bsmd.dbh
{
private static readonly ILog _log = LogManager.GetLogger(typeof(Request));
public static bool SendCancelCore(MessageCore core, bool useTest)
public static bool SendCancelCore(MessageCore core)
{
if ((core == null) || !(core.Cancelled ?? false)) return false;
if (!core.DefaultReportingPartyId.HasValue ||
@ -34,8 +34,8 @@ namespace bsmd.dbh
const RootType rootType = RootType.CANCEL;
Dbh_Osis_Answ_Ws client = new Dbh_Osis_Answ_Ws();
if (useTest)
client.Url = "https://edi-gate.dbh.de/test/bsmd-soap";
//if (useTest)
// client.Url = "https://edi-gate.dbh.de/test/bsmd-soap";
bsmd.database.ReportingParty reportingParty = DBManager.Instance.GetReportingPartyDict()[core.DefaultReportingPartyId.Value];
DBHWebReference.ReportingParty rp = new DBHWebReference.ReportingParty();
@ -109,7 +109,7 @@ namespace bsmd.dbh
return true;
}
public static bool SendMessage(Message message, bool useTest)
public static bool SendMessage(Message message)
{
if (message == null) return false;
@ -135,8 +135,8 @@ namespace bsmd.dbh
// map message to dbh NSWRequest object
Dbh_Osis_Answ_Ws client = new Dbh_Osis_Answ_Ws();
if (useTest)
client.Url = "https://edi-gate.dbh.de/test/bsmd-soap";
//if (useTest)
// client.Url = "https://edi-gate.dbh.de/test/bsmd-soap";
DBHWebReference.ReportingParty rp = new DBHWebReference.ReportingParty();
rp.RPCity = message.ReportingParty.City;

View File

@ -76,7 +76,7 @@ namespace bsmd.hisnord
}
}
public static bool? CreateSendFile(MessageCore core, Message message, bool useTest)
public static bool? CreateSendFile(MessageCore core, Message message)
{
bool? retval;
try
@ -184,11 +184,11 @@ namespace bsmd.hisnord
vesseltype hn_stat = new vesseltype();
if (stat.Beam_MTR.HasValue)
hn_stat.Beam_MTR = (float)stat.Beam_MTR.Value;
hn_stat.Beam_MTR = (decimal) stat.Beam_MTR.Value;
hn_stat.CallSign = stat.CallSign;
hn_stat.Flag = stat.Flag;
if (stat.GrossTonnage.HasValue)
hn_stat.GrossTonnage = stat.GrossTonnage.Value.ToString();
hn_stat.GrossTonnage = stat.GrossTonnage.Value;
if (!stat.InmarsatCallNumber.IsNullOrEmpty())
{
hn_stat.InmarsatCallNumbers = new vesseltypeInmarsatCallNumbers();
@ -217,7 +217,7 @@ namespace bsmd.hisnord
hn_stat.ISMCompany.ISMCompanyStreetAndNumber = stat.ISMCompanyStreetAndNumber;
}
if (stat.LengthOverall_MTR.HasValue)
hn_stat.LengthOverall_MTR = (float)stat.LengthOverall_MTR.Value;
hn_stat.LengthOverall_MTR = (decimal)stat.LengthOverall_MTR.Value;
hn_stat.MMSINumber = stat.MMSINumber;
hn_stat.PortOfRegistry = stat.PortOfRegistry;
hn_stat.ShipName = stat.ShipName;
@ -486,7 +486,7 @@ namespace bsmd.hisnord
hn_info.DeadWeightSummer_TNESpecified = info.DeplacementSummerDraught_TNE.HasValue;
if (hn_info.DeadWeightSummer_TNESpecified)
hn_info.DeadWeightSummer_TNE = (float)info.DeplacementSummerDraught_TNE.Value;
hn_info.DeadWeightSummer_TNE = (decimal)info.DeplacementSummerDraught_TNE.Value;
items1ChoiceType.Add(Items1ChoiceType.INFO);
items1.Add(hn_info);
@ -516,7 +516,7 @@ namespace bsmd.hisnord
BRKA brka = message.Elements[i] as BRKA;
hn_bkra.BunkerFuelArrival[i] = new bunkerfuel();
hn_bkra.BunkerFuelArrival[i].BunkerFuelType = brka.BunkerFuelType;
hn_bkra.BunkerFuelArrival[i].BunkerFuelQuantity_TNE = (float)brka.BunkerFuelQuantity_TNE;
hn_bkra.BunkerFuelArrival[i].BunkerFuelQuantity_TNE = (decimal)brka.BunkerFuelQuantity_TNE;
}
items1ChoiceType.Add(Items1ChoiceType.BKRA);
items1.Add(hn_bkra);
@ -542,7 +542,7 @@ namespace bsmd.hisnord
BRKD brkd = message.Elements[i] as BRKD;
hn_bkrd.BunkerFuelDeparture[i] = new bunkerfuel();
hn_bkrd.BunkerFuelDeparture[i].BunkerFuelType = brkd.BunkerFuelType;
hn_bkrd.BunkerFuelDeparture[i].BunkerFuelQuantity_TNE = (float)brkd.BunkerFuelQuantity_TNE;
hn_bkrd.BunkerFuelDeparture[i].BunkerFuelQuantity_TNE = (decimal)brkd.BunkerFuelQuantity_TNE;
}
items1ChoiceType.Add(Items1ChoiceType.BKRD);
items1.Add(hn_bkrd);
@ -709,7 +709,7 @@ namespace bsmd.hisnord
if ((ladg.CargoNumberOfItems ?? 0) > 0)
lu.CargoNumberOfItems = ladg.CargoNumberOfItems.Value.ToString();
if (ladg.CargoGrossQuantity_TNE.HasValue)
lu.CargoGrossQuantity_TNE = (float)ladg.CargoGrossQuantity_TNE.Value;
lu.CargoGrossQuantity_TNE = (decimal)ladg.CargoGrossQuantity_TNE.Value;
lu.CargoPortOfLoading = ladg.PortOfLoading;
lu.CargoPortOfDischarge = ladg.PortOfDischarge;
@ -777,7 +777,7 @@ namespace bsmd.hisnord
hn_pre72.DateOfLastExpandedInspection = pre72h.DateOfLastExpandedInspection.Value;
hn_pre72.PlannedOperations = pre72h.PlannedOperations;
if (pre72h.PlannedPeriodOfStay_HUR.HasValue)
hn_pre72.PlannedPeriodOfStay_HUR = (float)pre72h.PlannedPeriodOfStay_HUR.Value;
hn_pre72.PlannedPeriodOfStay_HUR = (decimal)pre72h.PlannedPeriodOfStay_HUR.Value;
hn_pre72.PlannedWorks = pre72h.PlannedWorks;
hn_pre72.Tanker = (pre72h.Tanker ?? false) ? yorntype.Y : yorntype.N;
@ -792,7 +792,7 @@ namespace bsmd.hisnord
if (pre72h.TankerHullConfiguration.HasValue)
hn_pre72.TankerDetails.TankerHullConfiguration = (hullconfigtype)pre72h.TankerHullConfiguration.Value;
if (pre72h.VolumeOfCargo.HasValue && (pre72h.VolumeOfCargo > 0))
hn_pre72.TankerDetails.VolumeOfCargo_TNE = (float)pre72h.VolumeOfCargo.Value;
hn_pre72.TankerDetails.VolumeOfCargo_TNE = (decimal)pre72h.VolumeOfCargo.Value;
hn_pre72.TankerDetails.VolumeOfCargo_TNESpecified = pre72h.VolumeOfCargo.HasValue;
}
else
@ -1209,23 +1209,18 @@ namespace bsmd.hisnord
}
}
if (was.WasteDisposalDelivery.HasValue)
{
was_items.Add((wastedeliverytype)was.WasteDisposalDelivery);
was_item_names.Add(ItemsChoiceType6.WasteDisposalDelivery);
}
was_items.Add(was.NextWasteDisposalPort);
was_item_names.Add(ItemsChoiceType6.NextWasteDisposalPort);
if (was.Waste.Count > 0)
{
for (int i = 0; i < was.Waste.Count; i++)
{
waste hn_waste = new waste();
Waste waste = was.Waste[i] as Waste;
Waste waste = was.Waste[i];
if (waste.WasteDisposalAmount_MTQ.HasValue)
hn_waste.WasteDisposalAmount_MTQ = (float)waste.WasteDisposalAmount_MTQ.Value;
if (waste.WasteDisposedAtLastPort_MTQ.HasValue)
hn_waste.WasteDisposedAtLastPort_MTQ = (float)waste.WasteDisposedAtLastPort_MTQ.Value;
hn_waste.WasteDisposalAmount_MTQ = (decimal)waste.WasteDisposalAmount_MTQ.Value;
hn_waste.WasteType = new wastetyp();
if (waste.WasteType.HasValue)
@ -1238,15 +1233,15 @@ namespace bsmd.hisnord
hn_waste.WasteDetails = new wastedetails();
hn_waste.WasteDetails.WasteAmountGeneratedTillNextPort_MTQSpecified = true; // waste.WasteAmountGeneratedTillNextPort_MTQ.HasValue;
// if (hn_waste.WasteDetails.WasteAmountGeneratedTillNextPort_MTQSpecified)
hn_waste.WasteDetails.WasteAmountGeneratedTillNextPort_MTQ = (float) (waste.WasteAmountGeneratedTillNextPort_MTQ ?? 0);
hn_waste.WasteDetails.WasteAmountGeneratedTillNextPort_MTQ = (decimal) (waste.WasteAmountGeneratedTillNextPort_MTQ ?? 0);
hn_waste.WasteDetails.WasteAmountRetained_MTQSpecified = true; // waste.WasteAmountRetained_MTQ.HasValue;
// if (hn_waste.WasteDetails.WasteAmountRetained_MTQSpecified)
hn_waste.WasteDetails.WasteAmountRetained_MTQ = (float) (waste.WasteAmountRetained_MTQ ?? 0);
hn_waste.WasteDetails.WasteAmountRetained_MTQ = (decimal) (waste.WasteAmountRetained_MTQ ?? 0);
hn_waste.WasteDetails.WasteCapacity_MTQSpecified = true; // waste.WasteCapacity_MTQ.HasValue;
// if (hn_waste.WasteDetails.WasteCapacity_MTQSpecified)
hn_waste.WasteDetails.WasteCapacity_MTQ = (float) (waste.WasteCapacity_MTQ ?? 0);
hn_waste.WasteDetails.WasteCapacity_MTQ = (decimal) (waste.WasteCapacity_MTQ ?? 0);
hn_waste.WasteDetails.WasteDisposalPort = waste.WasteDisposalPort.IsNullOrEmpty() ? "ZZUKN" : waste.WasteDisposalPort;
@ -1274,8 +1269,63 @@ namespace bsmd.hisnord
#endregion
#region WAS_RCPT
if (message.MessageNotificationClass == Message.NotificationClass.WAS_RCPT)
{
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_WAS_RCPT);
items1.Add(ytype.Y);
}
else
{
if (message.Elements.Count > 0)
{
global::was_rcpt hn_was_rcpt = new global::was_rcpt();
hn_was_rcpt.Items = new was_rcptWasteDeliveryReceipt[message.Elements.Count];
for (int i = 0; i < message.Elements.Count; i++)
{
WAS_RCPT was_rcpt = message.Elements[i] as WAS_RCPT;
hn_was_rcpt.Items[i] = new was_rcptWasteDeliveryReceipt();
hn_was_rcpt.Items[i].IdentificationNumber = was_rcpt.IdentificationNumber;
hn_was_rcpt.Items[i].PortReceptionFacilityName = was_rcpt.PortReceptionFacilityName;
hn_was_rcpt.Items[i].PortReceptionFacilityProviderName = was_rcpt.PortReceptionFacilityProviderName;
hn_was_rcpt.Items[i].WasteDeliveryPeriod = new was_rcptWasteDeliveryReceiptWasteDeliveryPeriod();
if (was_rcpt.WasteDeliveryDateFrom.HasValue)
hn_was_rcpt.Items[i].WasteDeliveryPeriod.WasteDeliveryDateFrom = was_rcpt.WasteDeliveryDateFrom.Value;
if (was_rcpt.WasteDeliveryDateTo.HasValue)
hn_was_rcpt.Items[i].WasteDeliveryPeriod.WasteDeliveryDateTo = was_rcpt.WasteDeliveryDateTo.Value;
if(was_rcpt.TreatmentFacilityProvider.Count > 0)
{
hn_was_rcpt.Items[i].TreatmentFacilityProvider = new string[was_rcpt.TreatmentFacilityProvider.Count];
for (int j = 0; j < was_rcpt.TreatmentFacilityProvider.Count; j++)
hn_was_rcpt.Items[i].TreatmentFacilityProvider[j] = was_rcpt.TreatmentFacilityProvider[j].TreatmentFacilityProviderName;
}
if(was_rcpt.WasteReceived.Count > 0)
{
hn_was_rcpt.Items[i].WasteReceived = new was_rcptWasteDeliveryReceiptWasteReceived[was_rcpt.WasteReceived.Count];
for (int j = 0; j < was_rcpt.WasteReceived.Count; j++)
{
hn_was_rcpt.Items[i].WasteReceived[j] = new was_rcptWasteDeliveryReceiptWasteReceived();
hn_was_rcpt.Items[i].WasteReceived[j].AmountWasteReceived_MTQ = (decimal) (was_rcpt.WasteReceived[j].AmountWasteReceived_MTQ ?? 0);
hn_was_rcpt.Items[i].WasteReceived[j].WasteType = new was_rcptWasteDeliveryReceiptWasteReceivedWasteType();
hn_was_rcpt.Items[i].WasteReceived[j].WasteType.WasteCode = was_rcpt.WasteReceived[j].WasteCode;
hn_was_rcpt.Items[i].WasteReceived[j].WasteType.WasteDescription = was_rcpt.WasteReceived[j].WasteDescription;
}
}
}
items1.Add(hn_was_rcpt);
items1ChoiceType.Add(Items1ChoiceType.WAS_RCPT);
}
}
}
#endregion
#region BPOL
if (message.MessageNotificationClass == Message.NotificationClass.BPOL)
{
if (message.Reset)
@ -1315,6 +1365,7 @@ namespace bsmd.hisnord
#region PAS
// TODO: Da bei mir PAS = PASA (keine eigene Meldeklasse) kann das hier erst direkt zum Stichtag umgesetzt werden
if (message.MessageNotificationClass == Message.NotificationClass.PAS)
{
if (message.Reset)
@ -1368,8 +1419,78 @@ namespace bsmd.hisnord
#endregion
#region PASD
if (message.MessageNotificationClass == Message.NotificationClass.PASD)
{
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_PASD);
items1.Add(ytype.Y);
}
else
{
if (message.Elements.Count > 0)
{
global::pastype hn_pastype = new pastype();
PASD apasd = message.Elements[0] as PASD;
hn_pastype.NotificationPAX = (apasd.NotificationPAX ?? false) ? yorntype.Y : yorntype.N;
hn_pastype.NotificationSchengen = (apasd.NotificationSchengen ?? false) ? yorntype.Y : yorntype.N;
hn_pastype.Passenger = new pastypePassenger[message.Elements.Count];
for (int i = 0; i < message.Elements.Count; i++)
{
pastypePassenger hn_pas = new pastypePassenger();
PASD pasd = message.Elements[i] as PASD;
hn_pas.CountryOfBirth = pasd.PassengerCountryOfBirth;
if (pasd.PassengerDateOfBirth.HasValue)
hn_pas.DateOfBirth = pasd.PassengerDateOfBirth.Value;
if(pasd.NotificationPAX ?? false)
{
hn_pas.DetailsPAX = new pastypePassengerDetailsPAX();
hn_pas.DetailsPAX.EmergencyCare = pasd.EmergencyCare;
hn_pas.DetailsPAX.EmergencyContactNumber = pasd.EmergencyContactNumber;
}
if(pasd.NotificationSchengen ?? false)
{
hn_pas.DetailsSchengen = new pastypePassengerDetailsSchengen();
if (pasd.PassengerIdentityDocumentExpiryDate.HasValue)
hn_pas.DetailsSchengen.IdentityDocumentExpiryDate = pasd.PassengerIdentityDocumentExpiryDate.Value;
hn_pas.DetailsSchengen.IdentityDocumentId = pasd.PassengerIdentityDocumentId;
hn_pas.DetailsSchengen.IdentityDocumentIssuingState = pasd.PassengerIdentityDocumentIssuingState;
if(pasd.PassengerIdentityDocumentType.HasValue)
hn_pas.DetailsSchengen.IdentityDocumentType = (documenttype)pasd.PassengerIdentityDocumentType.Value;
hn_pas.DetailsSchengen.InTransit = (pasd.PassengerInTransit ?? false) ? yorntype.Y : yorntype.N;
hn_pas.DetailsSchengen.PortOfDisembarkation = pasd.PassengerPortOfDisembarkation;
hn_pas.DetailsSchengen.PortOfEmbarkation = pasd.PassengerPortOfEmbarkation;
hn_pas.DetailsSchengen.VisaNumber = pasd.PassengerVisaNumber;
}
hn_pas.FirstName = pasd.PassengerFirstName;
if (pasd.PassengerGender.HasValue)
hn_pas.Gender = (gendertype)pasd.PassengerGender.Value;
hn_pas.LastName = pasd.PassengerLastName;
hn_pas.Nationality = pasd.PassengerNationality;
hn_pas.PlaceOfBirth = pasd.PassengerPlaceOfBirth;
hn_pastype.Passenger[i] = hn_pas;
}
items1ChoiceType.Add(Items1ChoiceType.PASD);
items1.Add(hn_pastype);
}
}
}
#endregion
#region CREW
// das ist bei mir dasselbe wie CREWA und muss daher zum Zeitpunkt X geändert werden
if (message.MessageNotificationClass == Message.NotificationClass.CREW)
{
if (message.Reset)
@ -1400,8 +1521,7 @@ namespace bsmd.hisnord
hn_crew.CrewMember[i].CrewMemberLastName = crew.CrewMemberLastName;
hn_crew.CrewMember[i].CrewMemberNationality = crew.CrewMemberNationality;
hn_crew.CrewMember[i].CrewMemberPlaceOfBirth = crew.CrewMemberPlaceOfBirth;
hn_crew.CrewMember[i].CrewMemberVisaNumber = crew.CrewMemberVisaNumber.IsNullOrEmpty() ? "-" : crew.CrewMemberVisaNumber;
hn_crew.CrewMember[i].CrewmemberIdentityDocumentExpiryDateSpecified = crew.CrewMemberIdentityDocumentExpiryDate.HasValue;
hn_crew.CrewMember[i].CrewMemberVisaNumber = crew.CrewMemberVisaNumber.IsNullOrEmpty() ? "-" : crew.CrewMemberVisaNumber;
if (crew.CrewMemberIdentityDocumentExpiryDate.HasValue)
hn_crew.CrewMember[i].CrewmemberIdentityDocumentExpiryDate = crew.CrewMemberIdentityDocumentExpiryDate.Value;
if(crew.CrewMemberIdentityDocumentIssuingState?.Trim().Length == 2)
@ -1416,8 +1536,78 @@ namespace bsmd.hisnord
#endregion
#region CREWD
if (message.MessageNotificationClass == Message.NotificationClass.CREWD)
{
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_CREWD);
items1.Add(ytype.Y);
}
else
{
if (message.Elements.Count > 0)
{
global::crewtype hn_crewtype = new crewtype();
CREWD acrewd = message.Elements[0] as CREWD;
hn_crewtype.NotificationPAX = (acrewd.NotificationPAX ?? false) ? yorntype.Y : yorntype.N;
hn_crewtype.NotificationSchengen = (acrewd.NotificationSchengen ?? false) ? yorntype.Y : yorntype.N;
hn_crewtype.CrewMember = new crewtypeCrewMember[message.Elements.Count];
for(int i = 0; i < message.Elements.Count; i++)
{
crewtypeCrewMember hn_crew = new crewtypeCrewMember();
CREWD crewd = message.Elements[i] as CREWD;
hn_crew.CountryOfBirth = crewd.CrewMemberCountryOfBirth;
if(crewd.CrewMemberDateOfBirth.HasValue)
hn_crew.DateOfBirth = crewd.CrewMemberDateOfBirth.Value;
hn_crew.DetailsSchengen = new crewtypeCrewMemberDetailsSchengen();
if (crewd.CrewMemberIdentityDocumentExpiryDate.HasValue)
hn_crew.DetailsSchengen.IdentityDocumentExpiryDate = crewd.CrewMemberIdentityDocumentExpiryDate.Value;
hn_crew.DetailsSchengen.IdentityDocumentId = crewd.CrewMemberIdentityDocumentId;
hn_crew.DetailsSchengen.IdentityDocumentIssuingState = crewd.CrewMemberIdentityDocumentIssuingState;
if (crewd.CrewMemberIdentityDocumentType.HasValue)
hn_crew.DetailsSchengen.IdentityDocumentType = (documenttype)crewd.CrewMemberIdentityDocumentType.Value;
hn_crew.DetailsSchengen.VisaNumber = crewd.CrewMemberVisaNumber;
hn_crew.DutyOnBoard = crewd.CrewMemberDuty;
hn_crew.FirstName = crewd.CrewMemberFirstName;
if(crewd.CrewMemberGender.HasValue)
hn_crew.Gender = (gendertype)crewd.CrewMemberGender.Value;
hn_crew.LastName = crewd.CrewMemberLastName;
hn_crew.Nationality = crewd.CrewMemberNationality;
hn_crew.PlaceOfBirth = crewd.CrewMemberPlaceOfBirth;
hn_crewtype.CrewMember[i] = hn_crew;
}
items1ChoiceType.Add(Items1ChoiceType.CREWD);
items1.Add(hn_crewtype);
}
}
}
if (message.MessageNotificationClass == Message.NotificationClass.CREW)
{
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_CREWA);
items1.Add(ytype.Y);
}
else
{
if (message.Elements.Count > 0)
{
}
}
}
#endregion
#region TOWA / TOWD
if (message.MessageNotificationClass == Message.NotificationClass.TOWA)
{
if (message.Reset)
@ -1440,15 +1630,15 @@ namespace bsmd.hisnord
hn_towa.TowageOnArrival[i] = hn_arrival;
if (towa.TowageOnArrivalBeam_MTR.HasValue)
hn_arrival.TowageOnArrivalBeam_MTR = (float)towa.TowageOnArrivalBeam_MTR.Value;
hn_arrival.TowageOnArrivalBeam_MTR = (decimal)towa.TowageOnArrivalBeam_MTR.Value;
if (towa.TowageOnArrivalDraught_DMT.HasValue)
hn_arrival.TowageOnArrivalDraught_DMT = (float)towa.TowageOnArrivalDraught_DMT.Value;
hn_arrival.TowageOnArrivalDraught_DMT = (decimal)towa.TowageOnArrivalDraught_DMT.Value;
if(!towa.TowageOnArrivalFlag.IsNullOrEmpty())
hn_arrival.TowageOnArrivalFlag = towa.TowageOnArrivalFlag;
if (towa.TowageOnArrivalGrossTonnage.HasValue)
hn_arrival.TowageOnArrivalGrossTonnage = towa.TowageOnArrivalGrossTonnage.Value.ToString();
if (towa.TowageOnArrivalLengthOverall_MTR.HasValue)
hn_arrival.TowageOnArrivalLengthOverall_MTR = (float)towa.TowageOnArrivalLengthOverall_MTR.Value;
hn_arrival.TowageOnArrivalLengthOverall_MTR = (decimal)towa.TowageOnArrivalLengthOverall_MTR.Value;
if(!towa.TowageOnArrivalName.IsNullOrEmpty())
hn_arrival.TowageOnArrivalName = towa.TowageOnArrivalName;
@ -1503,9 +1693,9 @@ namespace bsmd.hisnord
hn_departure.TowageOnDepartureBeam_MTRSpecified = towd.TowageOnDepartureBeam_MTR.HasValue;
if (hn_departure.TowageOnDepartureBeam_MTRSpecified)
hn_departure.TowageOnDepartureBeam_MTR = (float)towd.TowageOnDepartureBeam_MTR.Value;
hn_departure.TowageOnDepartureBeam_MTR = (decimal)towd.TowageOnDepartureBeam_MTR.Value;
if (towd.TowageOnDepartureDraught_DMT.HasValue)
hn_departure.TowageOnDepartureDraught_DMT = (float)towd.TowageOnDepartureDraught_DMT.Value;
hn_departure.TowageOnDepartureDraught_DMT = (decimal)towd.TowageOnDepartureDraught_DMT.Value;
if(!towd.TowageOnDepartureFlag.IsNullOrEmpty())
hn_departure.TowageOnDepartureFlag = towd.TowageOnDepartureFlag;
if(!towd.TowageOnDepartureName.IsNullOrEmpty())
@ -1530,7 +1720,7 @@ namespace bsmd.hisnord
hn_departure.TowageOnDepartureLengthOverall_MTRSpecified = towd.TowageOnDepartureLengthOverall_MTR.HasValue;
if (hn_departure.TowageOnDepartureLengthOverall_MTRSpecified)
hn_departure.TowageOnDepartureLengthOverall_MTR = (float)towd.TowageOnDepartureLengthOverall_MTR.Value;
hn_departure.TowageOnDepartureLengthOverall_MTR = (decimal)towd.TowageOnDepartureLengthOverall_MTR.Value;
if(!towd.TowageOnDepartureRemarks.IsNullOrEmpty())
hn_departure.TowageOnDepartureRemarks = towd.TowageOnDepartureRemarks;
}
@ -1647,14 +1837,11 @@ namespace bsmd.hisnord
pi.TechnicalName = imdgPosition.TechnicalName;
pi.NetExplosiveMass_KGMSpecified = imdgPosition.NetExplosiveMass_KGM.HasValue;
if (pi.NetExplosiveMass_KGMSpecified)
pi.NetExplosiveMass_KGM = (float)imdgPosition.NetExplosiveMass_KGM.Value;
pi.NetExplosiveMass_KGM = (decimal)imdgPosition.NetExplosiveMass_KGM.Value;
if(!imdgPosition.Flashpoint_CEL.IsNullOrEmpty())
pi.Flashpoint_CEL = imdgPosition.Flashpoint_CEL;
if(!imdgPosition.Class7NuclideName.IsNullOrEmpty())
pi.Class7NuclideName = imdgPosition.Class7NuclideName;
pi.Class7MaxActivity_BQLSpecified = imdgPosition.Class7MaxActivity_BQL.HasValue;
if (pi.Class7MaxActivity_BQLSpecified)
pi.Class7MaxActivity_BQL = (float)imdgPosition.Class7MaxActivity_BQL.Value;
pi.Class7NuclideName = imdgPosition.Class7NuclideName;
pi.Class7CategorySpecified = imdgPosition.Class7Category.HasValue;
if (pi.Class7CategorySpecified)
pi.Class7Category = (class7cattype)imdgPosition.Class7Category.Value;
@ -1666,10 +1853,10 @@ namespace bsmd.hisnord
pi.Class7CSI = (float)imdgPosition.Class7CSI.Value;
pi.ControlTemperature_CELSpecified = imdgPosition.ControlTemperature_CEL.HasValue;
if (pi.ControlTemperature_CELSpecified)
pi.ControlTemperature_CEL = (float)imdgPosition.ControlTemperature_CEL.Value;
pi.ControlTemperature_CEL = (decimal)imdgPosition.ControlTemperature_CEL.Value;
pi.EmergencyTemperature_CELSpecified = imdgPosition.EmergencyTemperature_CEL.HasValue;
if (pi.EmergencyTemperature_CELSpecified)
pi.EmergencyTemperature_CEL = (float)imdgPosition.EmergencyTemperature_CEL.Value;
pi.EmergencyTemperature_CEL = (decimal)imdgPosition.EmergencyTemperature_CEL.Value;
if(imdgPosition.SubsidiaryRiskList.Count > 0)
{
pi.SubsidiaryRisks = new string[Math.Min(imdgPosition.SubsidiaryRiskList.Count, 5)];
@ -1686,13 +1873,13 @@ namespace bsmd.hisnord
pi.ExceptedQuantities = (imdgPosition.ExceptedQuantities ?? false) ? yorntype.Y : yorntype.N;
pi.NetQuantity_KGMSpecified = imdgPosition.NetQuantity_KGM.HasValue;
if (pi.NetQuantity_KGMSpecified)
pi.NetQuantity_KGM = (float)imdgPosition.NetQuantity_KGM.Value;
pi.NetQuantity_KGM = (decimal)imdgPosition.NetQuantity_KGM.Value;
pi.GrossQuantity_KGMSpecified = imdgPosition.GrossQuantity_KGM.HasValue;
if (pi.GrossQuantity_KGMSpecified)
pi.GrossQuantity_KGM = (float)imdgPosition.GrossQuantity_KGM.Value;
pi.GrossQuantity_KGM = (decimal)imdgPosition.GrossQuantity_KGM.Value;
pi.Volume_MTQSpecified = imdgPosition.Volume_MTQ.HasValue;
if (pi.Volume_MTQSpecified)
pi.Volume_MTQ = (float)imdgPosition.Volume_MTQ.Value;
pi.Volume_MTQ = (decimal)imdgPosition.Volume_MTQ.Value;
pi.GeneralCargoIBCSpecified = imdgPosition.GeneralCargoIBC.HasValue;
if (pi.GeneralCargoIBCSpecified)
pi.GeneralCargoIBC = imdgPosition.GeneralCargoIBC.Value ? yorntype.Y : yorntype.N;
@ -1744,7 +1931,7 @@ namespace bsmd.hisnord
if(!ibcPosition.Flashpoint_CEL.IsNullOrEmpty())
pi.Flashpoint_CEL = ibcPosition.Flashpoint_CEL;
if (ibcPosition.Quantity_KGM.HasValue)
pi.Quantity_KGM = (float)ibcPosition.Quantity_KGM.Value;
pi.Quantity_KGM = (decimal)ibcPosition.Quantity_KGM.Value;
pi.StowagePosition = ibcPosition.StowagePosition;
pi.PortOfLoading = ibcPosition.PortOfLoading;
pi.PortOfDischarge = ibcPosition.PortOfDischarge;
@ -1775,7 +1962,7 @@ namespace bsmd.hisnord
pi.IMOClass = igcPosition.IMOClass;
pi.ProductName = igcPosition.ProductName;
if (igcPosition.Quantity_KGM.HasValue)
pi.Quantity_KGM = (float)igcPosition.Quantity_KGM.Value;
pi.Quantity_KGM = (decimal)igcPosition.Quantity_KGM.Value;
pi.StowagePosition = igcPosition.StowagePosition;
pi.PortOfLoading = igcPosition.PortOfLoading;
pi.PortOfDischarge = igcPosition.PortOfDischarge;
@ -1804,7 +1991,7 @@ namespace bsmd.hisnord
if(!imsbcPosition.IMOClass.IsNullOrEmpty())
pi.IMOClass = imsbcPosition.IMOClass;
if (imsbcPosition.Quantity_KGM.HasValue)
pi.Quantity_KGM = (float)imsbcPosition.Quantity_KGM.Value;
pi.Quantity_KGM = (decimal)imsbcPosition.Quantity_KGM.Value;
pi.StowagePosition = imsbcPosition.StowagePosition;
pi.PortOfLoading = imsbcPosition.PortOfLoading;
pi.PortOfDischarge = imsbcPosition.PortOfDischarge;
@ -1836,7 +2023,7 @@ namespace bsmd.hisnord
if(!marpolPosition.Flashpoint_CEL.IsNullOrEmpty())
pi.Flashpoint_CEL = marpolPosition.Flashpoint_CEL;
if (marpolPosition.Quantity_KGM.HasValue)
pi.Quantity_KGM = (float)marpolPosition.Quantity_KGM.Value;
pi.Quantity_KGM = (decimal)marpolPosition.Quantity_KGM.Value;
pi.StowagePosition = marpolPosition.StowagePosition;
pi.PortOfLoading = marpolPosition.PortOfLoading;
pi.PortOfDischarge = marpolPosition.PortOfDischarge;

File diff suppressed because it is too large Load Diff