3.0.4 - mitten im Test für NSW 3.0

This commit is contained in:
Daniel Schick 2016-03-23 11:07:58 +00:00
parent 936415f772
commit e73371eb93
6 changed files with 142 additions and 94 deletions

Binary file not shown.

View File

@ -2,6 +2,6 @@
[assembly: AssemblyCompany("Informatikbüro Daniel Schick")] [assembly: AssemblyCompany("Informatikbüro Daniel Schick")]
[assembly: AssemblyProduct("BSMD NSW interface")] [assembly: AssemblyProduct("BSMD NSW interface")]
[assembly: AssemblyInformationalVersion("3.0.3")] [assembly: AssemblyInformationalVersion("3.0.4")]
[assembly: AssemblyCopyright("Copyright © 2014-2016 Informatikbüro Daniel Schick. All rights reserved.")] [assembly: AssemblyCopyright("Copyright © 2014-2016 Informatikbüro Daniel Schick. All rights reserved.")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]

View File

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

View File

@ -458,7 +458,7 @@ namespace bsmd.dbh
{ {
BRKA bkra = message.Elements[i] as BRKA; BRKA bkra = message.Elements[i] as BRKA;
rootBKRA.BunkerFuelArrival[i] = new RootBKRABunkerFuelArrival(); rootBKRA.BunkerFuelArrival[i] = new RootBKRABunkerFuelArrival();
rootBKRA.BunkerFuelArrival[i].BunkerFuelQuantity_TNE = (decimal) (bkra.BunkerFuelQuantity_TNE ?? 0); rootBKRA.BunkerFuelArrival[i].BunkerFuelQuantity_TNE = Decimal.Round((decimal) (bkra.BunkerFuelQuantity_TNE ?? 0),3);
rootBKRA.BunkerFuelArrival[i].BunkerFuelType = bkra.BunkerFuelType; rootBKRA.BunkerFuelArrival[i].BunkerFuelType = bkra.BunkerFuelType;
} }
item = rootBKRA; item = rootBKRA;
@ -477,7 +477,7 @@ namespace bsmd.dbh
{ {
BRKD bkrd = message.Elements[i] as BRKD; BRKD bkrd = message.Elements[i] as BRKD;
rootBKRD.BunkerFuelDeparture[i] = new RootBKRDBunkerFuelDeparture(); rootBKRD.BunkerFuelDeparture[i] = new RootBKRDBunkerFuelDeparture();
rootBKRD.BunkerFuelDeparture[i].BunkerFuelQuantity_TNE = (decimal) (bkrd.BunkerFuelQuantity_TNE ?? 0); rootBKRD.BunkerFuelDeparture[i].BunkerFuelQuantity_TNE = Decimal.Round((decimal) (bkrd.BunkerFuelQuantity_TNE ?? 0),3);
rootBKRD.BunkerFuelDeparture[i].BunkerFuelType = bkrd.BunkerFuelType; rootBKRD.BunkerFuelDeparture[i].BunkerFuelType = bkrd.BunkerFuelType;
} }
item = rootBKRD; item = rootBKRD;
@ -490,7 +490,7 @@ namespace bsmd.dbh
{ {
RootTIEFA rootTIEFA = new RootTIEFA(); RootTIEFA rootTIEFA = new RootTIEFA();
TIEFA tiefa = message.Elements[0] as TIEFA; TIEFA tiefa = message.Elements[0] as TIEFA;
rootTIEFA.DraughtUponArrival_DMT = (decimal) (tiefa.DraughtUponArrival_DMT ?? 0); rootTIEFA.DraughtUponArrival_DMT = Decimal.Round((decimal) (tiefa.DraughtUponArrival_DMT ?? 0), 1);
item = rootTIEFA; item = rootTIEFA;
} }
break; break;
@ -501,7 +501,7 @@ namespace bsmd.dbh
{ {
RootTIEFD rootTIEFD = new RootTIEFD(); RootTIEFD rootTIEFD = new RootTIEFD();
TIEFD tiefd = message.Elements[0] as TIEFD; TIEFD tiefd = message.Elements[0] as TIEFD;
rootTIEFD.DraughtUponDeparture_DMT = (decimal) (tiefd.DraughtUponDeparture_DMT ?? 0); rootTIEFD.DraughtUponDeparture_DMT = Decimal.Round((decimal) (tiefd.DraughtUponDeparture_DMT ?? 0));
item = rootTIEFD; item = rootTIEFD;
} }
break; break;
@ -555,8 +555,8 @@ namespace bsmd.dbh
rootStat.CallSign = stat.CallSign; rootStat.CallSign = stat.CallSign;
rootStat.MMSINumber = stat.MMSINumber; rootStat.MMSINumber = stat.MMSINumber;
rootStat.Flag = stat.Flag; rootStat.Flag = stat.Flag;
if (stat.LengthOverall_MTR.HasValue) rootStat.LengthOverall_MTR = (decimal) (stat.LengthOverall_MTR.Value); if (stat.LengthOverall_MTR.HasValue) rootStat.LengthOverall_MTR = Decimal.Round((decimal) (stat.LengthOverall_MTR.Value), 2);
if (stat.Beam_MTR.HasValue) rootStat.Beam_MTR = (decimal) (stat.Beam_MTR.Value); if (stat.Beam_MTR.HasValue) rootStat.Beam_MTR = Decimal.Round((decimal) (stat.Beam_MTR.Value));
if (stat.GrossTonnage.HasValue) rootStat.GrossTonnage = stat.GrossTonnage.Value; if (stat.GrossTonnage.HasValue) rootStat.GrossTonnage = stat.GrossTonnage.Value;
rootStat.PortOfRegistry = stat.PortOfRegistry; rootStat.PortOfRegistry = stat.PortOfRegistry;
rootStat.ShipType = stat.ShipType; rootStat.ShipType = stat.ShipType;
@ -597,7 +597,7 @@ namespace bsmd.dbh
rootLADG.Cargo[i].CargoHandlingType = (HandlingType)(ladg.CargoHandlingType); rootLADG.Cargo[i].CargoHandlingType = (HandlingType)(ladg.CargoHandlingType);
rootLADG.Cargo[i].CargoCodeNST = ladg.CargoCodeNST; rootLADG.Cargo[i].CargoCodeNST = ladg.CargoCodeNST;
if (ladg.CargoGrossQuantity_TNE.HasValue) if (ladg.CargoGrossQuantity_TNE.HasValue)
rootLADG.Cargo[i].CargoGrossQuantity_TNE = (decimal) ladg.CargoGrossQuantity_TNE.Value; rootLADG.Cargo[i].CargoGrossQuantity_TNE = Decimal.Round((decimal) ladg.CargoGrossQuantity_TNE.Value, 3);
rootLADG.Cargo[i].CargoNumberOfItemsSpecified = ladg.CargoNumberOfItems.HasValue; rootLADG.Cargo[i].CargoNumberOfItemsSpecified = ladg.CargoNumberOfItems.HasValue;
if (ladg.CargoNumberOfItems.HasValue) if (ladg.CargoNumberOfItems.HasValue)
rootLADG.Cargo[i].CargoNumberOfItems = ladg.CargoNumberOfItems.Value; rootLADG.Cargo[i].CargoNumberOfItems = ladg.CargoNumberOfItems.Value;
@ -631,7 +631,7 @@ namespace bsmd.dbh
rootInfo.FumigatedBulkCargo = RootINFOFumigatedBulkCargo.N; rootInfo.FumigatedBulkCargo = RootINFOFumigatedBulkCargo.N;
rootInfo.DeadWeightSummer_TNESpecified = info.DeplacementSummerDraught_TNE.HasValue; rootInfo.DeadWeightSummer_TNESpecified = info.DeplacementSummerDraught_TNE.HasValue;
if (info.DeplacementSummerDraught_TNE.HasValue) if (info.DeplacementSummerDraught_TNE.HasValue)
rootInfo.DeadWeightSummer_TNE = (decimal) info.DeplacementSummerDraught_TNE.Value; rootInfo.DeadWeightSummer_TNE = Decimal.Round((decimal) info.DeplacementSummerDraught_TNE.Value, 3);
item = rootInfo; item = rootInfo;
} }
break; break;
@ -673,13 +673,14 @@ namespace bsmd.dbh
} }
if (pre72h.VolumeOfCargo.HasValue) if (pre72h.VolumeOfCargo.HasValue)
rootPre.TankerDetails.VolumeOfCargo_TNE = (decimal) (pre72h.VolumeOfCargo.Value); rootPre.TankerDetails.VolumeOfCargo_TNE = Decimal.Round((decimal) (pre72h.VolumeOfCargo.Value), 3);
rootPre.PlannedOperations = pre72h.PlannedOperations; rootPre.PlannedOperations = pre72h.PlannedOperations;
rootPre.PlannedWorks = pre72h.PlannedWorks; rootPre.PlannedWorks = pre72h.PlannedWorks;
rootPre.DateOfLastExpandedInspectionSpecified = pre72h.DateOfLastExpandedInspection.HasValue;
if (pre72h.DateOfLastExpandedInspection.HasValue) if (pre72h.DateOfLastExpandedInspection.HasValue)
rootPre.DateOfLastExpandedInspection = pre72h.DateOfLastExpandedInspection.Value; rootPre.DateOfLastExpandedInspection = pre72h.DateOfLastExpandedInspection.Value;
if (pre72h.PlannedPeriodOfStay_HUR.HasValue) if (pre72h.PlannedPeriodOfStay_HUR.HasValue)
rootPre.PlannedPeriodOfStay_HUR = (decimal) (pre72h.PlannedPeriodOfStay_HUR.Value); rootPre.PlannedPeriodOfStay_HUR = Decimal.Round((decimal) (pre72h.PlannedPeriodOfStay_HUR.Value), 2);
item = rootPre; item = rootPre;
} }
@ -899,15 +900,15 @@ namespace bsmd.dbh
if (was.Waste[j - 5].WasteType.HasValue) if (was.Waste[j - 5].WasteType.HasValue)
rww.WasteType = (WasteType) (was.Waste[j - 5].WasteType.Value - 1); // im generierten Code ist das 0-basiert rww.WasteType = (WasteType) (was.Waste[j - 5].WasteType.Value - 1); // im generierten Code ist das 0-basiert
if (was.Waste[j - 5].WasteDisposalAmount_MTQ.HasValue) if (was.Waste[j - 5].WasteDisposalAmount_MTQ.HasValue)
rww.WasteDisposalAmount_MTQ = (decimal)was.Waste[j - 5].WasteDisposalAmount_MTQ.Value; rww.WasteDisposalAmount_MTQ = decimal.Round((decimal)was.Waste[j - 5].WasteDisposalAmount_MTQ.Value,3);
rww.WasteDetails = new RootWASWasteWasteDetails(); rww.WasteDetails = new RootWASWasteWasteDetails();
if (was.Waste[j - 5].WasteCapacity_MTQ.HasValue) if (was.Waste[j - 5].WasteCapacity_MTQ.HasValue)
rww.WasteDetails.WasteCapacity_MTQ = (decimal)was.Waste[j - 5].WasteCapacity_MTQ.Value; rww.WasteDetails.WasteCapacity_MTQ = decimal.Round((decimal)was.Waste[j - 5].WasteCapacity_MTQ.Value,3);
if (was.Waste[j - 5].WasteAmountRetained_MTQ.HasValue) if (was.Waste[j - 5].WasteAmountRetained_MTQ.HasValue)
rww.WasteDetails.WasteAmountRetained_MTQ = (decimal)was.Waste[j - 5].WasteAmountRetained_MTQ.Value; rww.WasteDetails.WasteAmountRetained_MTQ = decimal.Round((decimal)was.Waste[j - 5].WasteAmountRetained_MTQ.Value,3);
rww.WasteDetails.WasteDisposalPort = was.Waste[j - 5].WasteDisposalPort; rww.WasteDetails.WasteDisposalPort = was.Waste[j - 5].WasteDisposalPort;
if (was.Waste[j - 5].WasteAmountGeneratedTillNextPort_MTQ.HasValue) if (was.Waste[j - 5].WasteAmountGeneratedTillNextPort_MTQ.HasValue)
rww.WasteDetails.WasteAmountGeneratedTillNextPort_MTQ = (decimal)was.Waste[j - 5].WasteAmountGeneratedTillNextPort_MTQ.Value; rww.WasteDetails.WasteAmountGeneratedTillNextPort_MTQ = decimal.Round((decimal)was.Waste[j - 5].WasteAmountGeneratedTillNextPort_MTQ.Value, 3);
} }
} }
} }
@ -941,12 +942,12 @@ namespace bsmd.dbh
if (towa.TowageOnArrivalGrossTonnage.HasValue) if (towa.TowageOnArrivalGrossTonnage.HasValue)
rootTowa.TowageOnArrival[i].TowageOnArrivalGrossTonnage = towa.TowageOnArrivalGrossTonnage.Value; rootTowa.TowageOnArrival[i].TowageOnArrivalGrossTonnage = towa.TowageOnArrivalGrossTonnage.Value;
if (towa.TowageOnArrivalLengthOverall_MTR.HasValue) if (towa.TowageOnArrivalLengthOverall_MTR.HasValue)
rootTowa.TowageOnArrival[i].TowageOnArrivalLengthOverall_MTR = (decimal) towa.TowageOnArrivalLengthOverall_MTR.Value; rootTowa.TowageOnArrival[i].TowageOnArrivalLengthOverall_MTR = decimal.Round((decimal) towa.TowageOnArrivalLengthOverall_MTR.Value, 2);
if (towa.TowageOnArrivalBeam_MTR.HasValue) if (towa.TowageOnArrivalBeam_MTR.HasValue)
rootTowa.TowageOnArrival[i].TowageOnArrivalBeam_MTR = (decimal) towa.TowageOnArrivalBeam_MTR.Value; rootTowa.TowageOnArrival[i].TowageOnArrivalBeam_MTR = decimal.Round((decimal) towa.TowageOnArrivalBeam_MTR.Value, 2);
rootTowa.TowageOnArrival[i].TowageOnArrivalPurposeOfCall = towa.TowageOnArrivalPurposeOfCall; rootTowa.TowageOnArrival[i].TowageOnArrivalPurposeOfCall = towa.TowageOnArrivalPurposeOfCall;
if (towa.TowageOnArrivalDraught_DMT.HasValue) if (towa.TowageOnArrivalDraught_DMT.HasValue)
rootTowa.TowageOnArrival[i].TowageOnArrivalDraught_DMT = (decimal) towa.TowageOnArrivalDraught_DMT.Value; rootTowa.TowageOnArrival[i].TowageOnArrivalDraught_DMT = decimal.Round((decimal) towa.TowageOnArrivalDraught_DMT.Value, 1);
rootTowa.TowageOnArrival[i].TowageOnArrivalRemarks = towa.TowageOnArrivalRemarks; rootTowa.TowageOnArrival[i].TowageOnArrivalRemarks = towa.TowageOnArrivalRemarks;
} }
item = rootTowa; item = rootTowa;
@ -975,11 +976,11 @@ namespace bsmd.dbh
rootTowd.TowageOnDeparture[i].TowageOnDepartureOperator.TowageOnDepartureOperatorFax = towd.TowageOnDepartureOperatorFax; rootTowd.TowageOnDeparture[i].TowageOnDepartureOperator.TowageOnDepartureOperatorFax = towd.TowageOnDepartureOperatorFax;
rootTowd.TowageOnDeparture[i].TowageOnDepartureOperator.TowageOnDepartureOperatorEMail = towd.TowageOnDepartureOperatorEmail; rootTowd.TowageOnDeparture[i].TowageOnDepartureOperator.TowageOnDepartureOperatorEMail = towd.TowageOnDepartureOperatorEmail;
if (towd.TowageOnDepartureLengthOverall_MTR.HasValue) if (towd.TowageOnDepartureLengthOverall_MTR.HasValue)
rootTowd.TowageOnDeparture[i].TowageOnDepartureLengthOverall_MTR = (decimal) towd.TowageOnDepartureLengthOverall_MTR.Value; rootTowd.TowageOnDeparture[i].TowageOnDepartureLengthOverall_MTR = decimal.Round((decimal) towd.TowageOnDepartureLengthOverall_MTR.Value, 2);
if (towd.TowageOnDepartureBeam_MTR.HasValue) if (towd.TowageOnDepartureBeam_MTR.HasValue)
rootTowd.TowageOnDeparture[i].TowageOnDepartureBeam_MTR = (decimal) towd.TowageOnDepartureBeam_MTR.Value; rootTowd.TowageOnDeparture[i].TowageOnDepartureBeam_MTR = decimal.Round((decimal) towd.TowageOnDepartureBeam_MTR.Value, 2);
if (towd.TowageOnDepartureDraught_DMT.HasValue) if (towd.TowageOnDepartureDraught_DMT.HasValue)
rootTowd.TowageOnDeparture[i].TowageOnDepartureDraught_DMT = (decimal) towd.TowageOnDepartureDraught_DMT.Value; rootTowd.TowageOnDeparture[i].TowageOnDepartureDraught_DMT = decimal.Round((decimal) towd.TowageOnDepartureDraught_DMT.Value, 1);
rootTowd.TowageOnDeparture[i].TowageOnDepartureRemarks = towd.TowageOnDepartureRemarks; rootTowd.TowageOnDeparture[i].TowageOnDepartureRemarks = towd.TowageOnDepartureRemarks;
} }
item = rootTowd; item = rootTowd;
@ -1033,27 +1034,27 @@ namespace bsmd.dbh
rootIMDG.TechnicalName = imdgPos.TechnicalName; rootIMDG.TechnicalName = imdgPos.TechnicalName;
rootIMDG.NetExplosiveMass_KGMSpecified = imdgPos.NetExplosiveMass_KGM.HasValue; rootIMDG.NetExplosiveMass_KGMSpecified = imdgPos.NetExplosiveMass_KGM.HasValue;
if (imdgPos.NetExplosiveMass_KGM.HasValue) if (imdgPos.NetExplosiveMass_KGM.HasValue)
rootIMDG.NetExplosiveMass_KGM = (decimal)imdgPos.NetExplosiveMass_KGM.Value; rootIMDG.NetExplosiveMass_KGM = decimal.Round((decimal)imdgPos.NetExplosiveMass_KGM.Value, 3);
rootIMDG.Flashpoint_CEL = imdgPos.Flashpoint_CEL; rootIMDG.Flashpoint_CEL = imdgPos.Flashpoint_CEL;
rootIMDG.Class7NuclideName = imdgPos.Class7NuclideName; rootIMDG.Class7NuclideName = imdgPos.Class7NuclideName;
rootIMDG.Class7MaxActivity_BQLSpecified = imdgPos.Class7MaxActivity_BQL.HasValue; rootIMDG.Class7MaxActivity_BQLSpecified = imdgPos.Class7MaxActivity_BQL.HasValue;
if (imdgPos.Class7MaxActivity_BQL.HasValue) if (imdgPos.Class7MaxActivity_BQL.HasValue)
rootIMDG.Class7MaxActivity_BQL = (decimal)imdgPos.Class7MaxActivity_BQL.Value; rootIMDG.Class7MaxActivity_BQL = decimal.Round((decimal)imdgPos.Class7MaxActivity_BQL.Value, 6);
rootIMDG.Class7CategorySpecified = imdgPos.Class7Category.HasValue; rootIMDG.Class7CategorySpecified = imdgPos.Class7Category.HasValue;
if (imdgPos.Class7Category.HasValue) if (imdgPos.Class7Category.HasValue)
rootIMDG.Class7Category = imdgPos.Class7Category.Value; rootIMDG.Class7Category = imdgPos.Class7Category.Value;
rootIMDG.Class7TransportIndexSpecified = imdgPos.Class7TransportIndex.HasValue; rootIMDG.Class7TransportIndexSpecified = imdgPos.Class7TransportIndex.HasValue;
if (imdgPos.Class7TransportIndex.HasValue) if (imdgPos.Class7TransportIndex.HasValue)
rootIMDG.Class7TransportIndex = (decimal)imdgPos.Class7TransportIndex.Value; rootIMDG.Class7TransportIndex = decimal.Round((decimal)imdgPos.Class7TransportIndex.Value, 1);
rootIMDG.Class7CSISpecified = imdgPos.Class7CSI.HasValue; rootIMDG.Class7CSISpecified = imdgPos.Class7CSI.HasValue;
if (imdgPos.Class7CSI.HasValue) if (imdgPos.Class7CSI.HasValue)
rootIMDG.Class7CSI = imdgPos.Class7CSI.Value; rootIMDG.Class7CSI = imdgPos.Class7CSI.Value;
rootIMDG.ControlTemperature_CELSpecified = imdgPos.ControlTemperature_CEL.HasValue; rootIMDG.ControlTemperature_CELSpecified = imdgPos.ControlTemperature_CEL.HasValue;
if (imdgPos.ControlTemperature_CEL.HasValue) if (imdgPos.ControlTemperature_CEL.HasValue)
rootIMDG.ControlTemperature_CEL = (decimal)imdgPos.ControlTemperature_CEL.Value; rootIMDG.ControlTemperature_CEL = decimal.Round((decimal)imdgPos.ControlTemperature_CEL.Value, 2);
rootIMDG.EmergencyTemperature_CELSpecified = imdgPos.EmergencyTemperature_CEL.HasValue; rootIMDG.EmergencyTemperature_CELSpecified = imdgPos.EmergencyTemperature_CEL.HasValue;
if (imdgPos.EmergencyTemperature_CEL.HasValue) if (imdgPos.EmergencyTemperature_CEL.HasValue)
rootIMDG.EmergencyTemperature_CEL = (decimal)imdgPos.EmergencyTemperature_CEL.Value; rootIMDG.EmergencyTemperature_CEL = decimal.Round((decimal)imdgPos.EmergencyTemperature_CEL.Value, 2);
if (imdgPos.SubsidiaryRiskList.Count > 0) if (imdgPos.SubsidiaryRiskList.Count > 0)
{ {
rootIMDG.SubsidiaryRisks = new string[imdgPos.SubsidiaryRiskList.Count]; rootIMDG.SubsidiaryRisks = new string[imdgPos.SubsidiaryRiskList.Count];
@ -1071,13 +1072,13 @@ namespace bsmd.dbh
rootIMDG.ExceptedQuantities = imdgPos.ExceptedQuantities.Value ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N; rootIMDG.ExceptedQuantities = imdgPos.ExceptedQuantities.Value ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N;
rootIMDG.NetQuantity_KGMSpecified = imdgPos.NetQuantity_KGM.HasValue; rootIMDG.NetQuantity_KGMSpecified = imdgPos.NetQuantity_KGM.HasValue;
if (imdgPos.NetQuantity_KGM.HasValue) if (imdgPos.NetQuantity_KGM.HasValue)
rootIMDG.NetQuantity_KGM = (decimal)imdgPos.NetQuantity_KGM.Value; rootIMDG.NetQuantity_KGM = decimal.Round((decimal)imdgPos.NetQuantity_KGM.Value, 3);
rootIMDG.GrossQuantity_KGMSpecified = imdgPos.GrossQuantity_KGM.HasValue; rootIMDG.GrossQuantity_KGMSpecified = imdgPos.GrossQuantity_KGM.HasValue;
if (imdgPos.GrossQuantity_KGM.HasValue) if (imdgPos.GrossQuantity_KGM.HasValue)
rootIMDG.GrossQuantity_KGM = (decimal)imdgPos.GrossQuantity_KGM.Value; rootIMDG.GrossQuantity_KGM = decimal.Round((decimal)imdgPos.GrossQuantity_KGM.Value, 3);
rootIMDG.Volume_MTQSpecified = imdgPos.Volume_MTQ.HasValue; rootIMDG.Volume_MTQSpecified = imdgPos.Volume_MTQ.HasValue;
if (imdgPos.Volume_MTQ.HasValue) if (imdgPos.Volume_MTQ.HasValue)
rootIMDG.Volume_MTQ = (decimal)imdgPos.Volume_MTQ.Value; rootIMDG.Volume_MTQ = decimal.Round((decimal)imdgPos.Volume_MTQ.Value, 3);
rootIMDG.GeneralCargoIBCSpecified = imdgPos.GeneralCargoIBC.HasValue; rootIMDG.GeneralCargoIBCSpecified = imdgPos.GeneralCargoIBC.HasValue;
if (imdgPos.GeneralCargoIBC.HasValue) if (imdgPos.GeneralCargoIBC.HasValue)
rootIMDG.GeneralCargoIBC = imdgPos.GeneralCargoIBC.Value ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N; rootIMDG.GeneralCargoIBC = imdgPos.GeneralCargoIBC.Value ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N;
@ -1112,7 +1113,7 @@ namespace bsmd.dbh
rootIBC.FlashpointInformation = (FlashpointInfoType)ibcPos.FlashpointInformation.Value; rootIBC.FlashpointInformation = (FlashpointInfoType)ibcPos.FlashpointInformation.Value;
rootIBC.Flashpoint_CEL = ibcPos.Flashpoint_CEL; rootIBC.Flashpoint_CEL = ibcPos.Flashpoint_CEL;
if (ibcPos.Quantity_KGM.HasValue) if (ibcPos.Quantity_KGM.HasValue)
rootIBC.Quantity_KGM = (decimal)ibcPos.Quantity_KGM.Value; rootIBC.Quantity_KGM = decimal.Round((decimal)ibcPos.Quantity_KGM.Value, 3);
rootIBC.StowagePosition = ibcPos.StowagePosition; rootIBC.StowagePosition = ibcPos.StowagePosition;
rootIBC.PortOfLoading = ibcPos.PortOfLoading; rootIBC.PortOfLoading = ibcPos.PortOfLoading;
rootIBC.PortOfDischarge = ibcPos.PortOfDischarge; rootIBC.PortOfDischarge = ibcPos.PortOfDischarge;
@ -1139,7 +1140,7 @@ namespace bsmd.dbh
rootIGC.IMOClass = igcPos.IMOClass; rootIGC.IMOClass = igcPos.IMOClass;
rootIGC.ProductName = igcPos.ProductName; rootIGC.ProductName = igcPos.ProductName;
if (igcPos.Quantity_KGM.HasValue) if (igcPos.Quantity_KGM.HasValue)
rootIGC.Quantity_KGM = (decimal)igcPos.Quantity_KGM.Value; rootIGC.Quantity_KGM = decimal.Round((decimal)igcPos.Quantity_KGM.Value, 3);
rootIGC.StowagePosition = igcPos.StowagePosition; rootIGC.StowagePosition = igcPos.StowagePosition;
rootIGC.PortOfLoading = igcPos.PortOfLoading; rootIGC.PortOfLoading = igcPos.PortOfLoading;
rootIGC.PortOfDischarge = igcPos.PortOfDischarge; rootIGC.PortOfDischarge = igcPos.PortOfDischarge;
@ -1165,7 +1166,7 @@ namespace bsmd.dbh
rootIMSBC.UNNumber = imsbcPos.UNNumber; rootIMSBC.UNNumber = imsbcPos.UNNumber;
rootIMSBC.IMOClass = imsbcPos.IMOClass; rootIMSBC.IMOClass = imsbcPos.IMOClass;
if (imsbcPos.Quantity_KGM.HasValue) if (imsbcPos.Quantity_KGM.HasValue)
rootIMSBC.Quantity_KGM = (decimal)imsbcPos.Quantity_KGM.Value; rootIMSBC.Quantity_KGM = decimal.Round((decimal)imsbcPos.Quantity_KGM.Value, 3);
rootIMSBC.StowagePosition = imsbcPos.StowagePosition; rootIMSBC.StowagePosition = imsbcPos.StowagePosition;
rootIMSBC.PortOfLoading = imsbcPos.PortOfLoading; rootIMSBC.PortOfLoading = imsbcPos.PortOfLoading;
rootIMSBC.PortOfDischarge = imsbcPos.PortOfDischarge; rootIMSBC.PortOfDischarge = imsbcPos.PortOfDischarge;
@ -1190,7 +1191,7 @@ namespace bsmd.dbh
rootMarpol.FlashpointInformation = (FlashpointInfoType)marpolPos.FlashpointInformation.Value; rootMarpol.FlashpointInformation = (FlashpointInfoType)marpolPos.FlashpointInformation.Value;
rootMarpol.Flashpoint_CEL = marpolPos.Flashpoint_CEL; rootMarpol.Flashpoint_CEL = marpolPos.Flashpoint_CEL;
if (marpolPos.Quantity_KGM.HasValue) if (marpolPos.Quantity_KGM.HasValue)
rootMarpol.Quantity_KGM = (decimal)marpolPos.Quantity_KGM.Value; rootMarpol.Quantity_KGM = decimal.Round((decimal)marpolPos.Quantity_KGM.Value, 3);
rootMarpol.StowagePosition = marpolPos.StowagePosition; rootMarpol.StowagePosition = marpolPos.StowagePosition;
rootMarpol.PortOfLoading = marpolPos.PortOfLoading; rootMarpol.PortOfLoading = marpolPos.PortOfLoading;
rootMarpol.PortOfDischarge = marpolPos.PortOfDischarge; rootMarpol.PortOfDischarge = marpolPos.PortOfDischarge;
@ -1266,27 +1267,27 @@ namespace bsmd.dbh
rootIMDG.TechnicalName = imdgPos.TechnicalName; rootIMDG.TechnicalName = imdgPos.TechnicalName;
rootIMDG.NetExplosiveMass_KGMSpecified = imdgPos.NetExplosiveMass_KGM.HasValue; rootIMDG.NetExplosiveMass_KGMSpecified = imdgPos.NetExplosiveMass_KGM.HasValue;
if (imdgPos.NetExplosiveMass_KGM.HasValue) if (imdgPos.NetExplosiveMass_KGM.HasValue)
rootIMDG.NetExplosiveMass_KGM = (decimal)imdgPos.NetExplosiveMass_KGM.Value; rootIMDG.NetExplosiveMass_KGM = decimal.Round((decimal)imdgPos.NetExplosiveMass_KGM.Value, 3);
rootIMDG.Flashpoint_CEL = imdgPos.Flashpoint_CEL; rootIMDG.Flashpoint_CEL = imdgPos.Flashpoint_CEL;
rootIMDG.Class7NuclideName = imdgPos.Class7NuclideName; rootIMDG.Class7NuclideName = imdgPos.Class7NuclideName;
rootIMDG.Class7MaxActivity_BQLSpecified = imdgPos.Class7MaxActivity_BQL.HasValue; rootIMDG.Class7MaxActivity_BQLSpecified = imdgPos.Class7MaxActivity_BQL.HasValue;
if (imdgPos.Class7MaxActivity_BQL.HasValue) if (imdgPos.Class7MaxActivity_BQL.HasValue)
rootIMDG.Class7MaxActivity_BQL = (decimal)imdgPos.Class7MaxActivity_BQL.Value; rootIMDG.Class7MaxActivity_BQL = decimal.Round((decimal)imdgPos.Class7MaxActivity_BQL.Value, 6);
rootIMDG.Class7CategorySpecified = imdgPos.Class7Category.HasValue; rootIMDG.Class7CategorySpecified = imdgPos.Class7Category.HasValue;
if (imdgPos.Class7Category.HasValue) if (imdgPos.Class7Category.HasValue)
rootIMDG.Class7Category = imdgPos.Class7Category.Value; rootIMDG.Class7Category = imdgPos.Class7Category.Value;
rootIMDG.Class7TransportIndexSpecified = imdgPos.Class7TransportIndex.HasValue; rootIMDG.Class7TransportIndexSpecified = imdgPos.Class7TransportIndex.HasValue;
if (imdgPos.Class7TransportIndex.HasValue) if (imdgPos.Class7TransportIndex.HasValue)
rootIMDG.Class7TransportIndex = (decimal)imdgPos.Class7TransportIndex.Value; rootIMDG.Class7TransportIndex = decimal.Round((decimal)imdgPos.Class7TransportIndex.Value, 1);
rootIMDG.Class7CSISpecified = imdgPos.Class7CSI.HasValue; rootIMDG.Class7CSISpecified = imdgPos.Class7CSI.HasValue;
if (imdgPos.Class7CSI.HasValue) if (imdgPos.Class7CSI.HasValue)
rootIMDG.Class7CSI = imdgPos.Class7CSI.Value; rootIMDG.Class7CSI = imdgPos.Class7CSI.Value;
rootIMDG.ControlTemperature_CELSpecified = imdgPos.ControlTemperature_CEL.HasValue; rootIMDG.ControlTemperature_CELSpecified = imdgPos.ControlTemperature_CEL.HasValue;
if (imdgPos.ControlTemperature_CEL.HasValue) if (imdgPos.ControlTemperature_CEL.HasValue)
rootIMDG.ControlTemperature_CEL = (decimal)imdgPos.ControlTemperature_CEL.Value; rootIMDG.ControlTemperature_CEL = decimal.Round((decimal)imdgPos.ControlTemperature_CEL.Value, 2);
rootIMDG.EmergencyTemperature_CELSpecified = imdgPos.EmergencyTemperature_CEL.HasValue; rootIMDG.EmergencyTemperature_CELSpecified = imdgPos.EmergencyTemperature_CEL.HasValue;
if (imdgPos.EmergencyTemperature_CEL.HasValue) if (imdgPos.EmergencyTemperature_CEL.HasValue)
rootIMDG.EmergencyTemperature_CEL = (decimal)imdgPos.EmergencyTemperature_CEL.Value; rootIMDG.EmergencyTemperature_CEL = decimal.Round((decimal)imdgPos.EmergencyTemperature_CEL.Value, 2);
if (imdgPos.SubsidiaryRiskList.Count > 0) if (imdgPos.SubsidiaryRiskList.Count > 0)
{ {
rootIMDG.SubsidiaryRisks = new string[imdgPos.SubsidiaryRiskList.Count]; rootIMDG.SubsidiaryRisks = new string[imdgPos.SubsidiaryRiskList.Count];
@ -1304,13 +1305,13 @@ namespace bsmd.dbh
rootIMDG.ExceptedQuantities = imdgPos.ExceptedQuantities.Value ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N; rootIMDG.ExceptedQuantities = imdgPos.ExceptedQuantities.Value ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N;
rootIMDG.NetQuantity_KGMSpecified = imdgPos.NetQuantity_KGM.HasValue; rootIMDG.NetQuantity_KGMSpecified = imdgPos.NetQuantity_KGM.HasValue;
if (imdgPos.NetQuantity_KGM.HasValue) if (imdgPos.NetQuantity_KGM.HasValue)
rootIMDG.NetQuantity_KGM = (decimal)imdgPos.NetQuantity_KGM.Value; rootIMDG.NetQuantity_KGM = decimal.Round((decimal)imdgPos.NetQuantity_KGM.Value, 3);
rootIMDG.GrossQuantity_KGMSpecified = imdgPos.GrossQuantity_KGM.HasValue; rootIMDG.GrossQuantity_KGMSpecified = imdgPos.GrossQuantity_KGM.HasValue;
if (imdgPos.GrossQuantity_KGM.HasValue) if (imdgPos.GrossQuantity_KGM.HasValue)
rootIMDG.GrossQuantity_KGM = (decimal)imdgPos.GrossQuantity_KGM.Value; rootIMDG.GrossQuantity_KGM = decimal.Round((decimal)imdgPos.GrossQuantity_KGM.Value, 3);
rootIMDG.Volume_MTQSpecified = imdgPos.Volume_MTQ.HasValue; rootIMDG.Volume_MTQSpecified = imdgPos.Volume_MTQ.HasValue;
if (imdgPos.Volume_MTQ.HasValue) if (imdgPos.Volume_MTQ.HasValue)
rootIMDG.Volume_MTQ = (decimal)imdgPos.Volume_MTQ.Value; rootIMDG.Volume_MTQ = decimal.Round((decimal)imdgPos.Volume_MTQ.Value, 3);
rootIMDG.GeneralCargoIBCSpecified = imdgPos.GeneralCargoIBC.HasValue; rootIMDG.GeneralCargoIBCSpecified = imdgPos.GeneralCargoIBC.HasValue;
if (imdgPos.GeneralCargoIBC.HasValue) if (imdgPos.GeneralCargoIBC.HasValue)
rootIMDG.GeneralCargoIBC = imdgPos.GeneralCargoIBC.Value ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N; rootIMDG.GeneralCargoIBC = imdgPos.GeneralCargoIBC.Value ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N;
@ -1345,7 +1346,7 @@ namespace bsmd.dbh
rootIBC.FlashpointInformation = (FlashpointInfoType)ibcPos.FlashpointInformation.Value; rootIBC.FlashpointInformation = (FlashpointInfoType)ibcPos.FlashpointInformation.Value;
rootIBC.Flashpoint_CEL = ibcPos.Flashpoint_CEL; rootIBC.Flashpoint_CEL = ibcPos.Flashpoint_CEL;
if (ibcPos.Quantity_KGM.HasValue) if (ibcPos.Quantity_KGM.HasValue)
rootIBC.Quantity_KGM = (decimal) ibcPos.Quantity_KGM.Value; rootIBC.Quantity_KGM = decimal.Round((decimal) ibcPos.Quantity_KGM.Value, 3);
rootIBC.StowagePosition = ibcPos.StowagePosition; rootIBC.StowagePosition = ibcPos.StowagePosition;
rootIBC.PortOfLoading = ibcPos.PortOfLoading; rootIBC.PortOfLoading = ibcPos.PortOfLoading;
rootIBC.PortOfDischarge = ibcPos.PortOfDischarge; rootIBC.PortOfDischarge = ibcPos.PortOfDischarge;
@ -1372,7 +1373,7 @@ namespace bsmd.dbh
rootIGC.IMOClass = igcPos.IMOClass; rootIGC.IMOClass = igcPos.IMOClass;
rootIGC.ProductName = igcPos.ProductName; rootIGC.ProductName = igcPos.ProductName;
if (igcPos.Quantity_KGM.HasValue) if (igcPos.Quantity_KGM.HasValue)
rootIGC.Quantity_KGM = (decimal)igcPos.Quantity_KGM.Value; rootIGC.Quantity_KGM = decimal.Round((decimal)igcPos.Quantity_KGM.Value, 3);
rootIGC.StowagePosition = igcPos.StowagePosition; rootIGC.StowagePosition = igcPos.StowagePosition;
rootIGC.PortOfLoading = igcPos.PortOfLoading; rootIGC.PortOfLoading = igcPos.PortOfLoading;
rootIGC.PortOfDischarge = igcPos.PortOfDischarge; rootIGC.PortOfDischarge = igcPos.PortOfDischarge;
@ -1398,7 +1399,7 @@ namespace bsmd.dbh
rootIMSBC.UNNumber = imsbcPos.UNNumber; rootIMSBC.UNNumber = imsbcPos.UNNumber;
rootIMSBC.IMOClass = imsbcPos.IMOClass; rootIMSBC.IMOClass = imsbcPos.IMOClass;
if (imsbcPos.Quantity_KGM.HasValue) if (imsbcPos.Quantity_KGM.HasValue)
rootIMSBC.Quantity_KGM = (decimal)imsbcPos.Quantity_KGM.Value; rootIMSBC.Quantity_KGM = decimal.Round((decimal)imsbcPos.Quantity_KGM.Value, 3);
rootIMSBC.StowagePosition = imsbcPos.StowagePosition; rootIMSBC.StowagePosition = imsbcPos.StowagePosition;
rootIMSBC.PortOfLoading = imsbcPos.PortOfLoading; rootIMSBC.PortOfLoading = imsbcPos.PortOfLoading;
rootIMSBC.PortOfDischarge = imsbcPos.PortOfDischarge; rootIMSBC.PortOfDischarge = imsbcPos.PortOfDischarge;
@ -1423,7 +1424,7 @@ namespace bsmd.dbh
rootMarpol.FlashpointInformation = (FlashpointInfoType) marpolPos.FlashpointInformation.Value; rootMarpol.FlashpointInformation = (FlashpointInfoType) marpolPos.FlashpointInformation.Value;
rootMarpol.Flashpoint_CEL = marpolPos.Flashpoint_CEL; rootMarpol.Flashpoint_CEL = marpolPos.Flashpoint_CEL;
if (marpolPos.Quantity_KGM.HasValue) if (marpolPos.Quantity_KGM.HasValue)
rootMarpol.Quantity_KGM = (decimal)marpolPos.Quantity_KGM.Value; rootMarpol.Quantity_KGM = decimal.Round((decimal)marpolPos.Quantity_KGM.Value, 3);
rootMarpol.StowagePosition = marpolPos.StowagePosition; rootMarpol.StowagePosition = marpolPos.StowagePosition;
rootMarpol.PortOfLoading = marpolPos.PortOfLoading; rootMarpol.PortOfLoading = marpolPos.PortOfLoading;
rootMarpol.PortOfDischarge = marpolPos.PortOfDischarge; rootMarpol.PortOfDischarge = marpolPos.PortOfDischarge;

View File

@ -1099,63 +1099,106 @@ namespace bsmd.herberg.FormService
if (vDict.ContainsKey("WasteDisposalDelivery")) was.WasteDisposalDelivery = (byte) Enum.Parse(typeof(Enums.WasteDisposalDelivery), vDict["WasteDisposalDelivery"], true); if (vDict.ContainsKey("WasteDisposalDelivery")) was.WasteDisposalDelivery = (byte) Enum.Parse(typeof(Enums.WasteDisposalDelivery), vDict["WasteDisposalDelivery"], true);
if (vDict.ContainsKey("ConfirmationOfCorrectness")) was.ConfirmationOfCorrectness = vDict["ConfirmationOfCorrectness"].Equals("Y"); if (vDict.ContainsKey("ConfirmationOfCorrectness")) was.ConfirmationOfCorrectness = vDict["ConfirmationOfCorrectness"].Equals("Y");
// parse given waste // parse given waste, depending on old (pre 3.0) or new (3.0) Style
foreach(int key in nDict.Keys) {
Dictionary<string, string> wDict = nDict[key]; if (nDict.Keys.Count < 2)
Waste waste = was.GetSublistElementWithIdentifier(key.ToString()) as Waste; {
if (waste == null) for (int wCounter = 1; wCounter <= 9; wCounter++)
{ {
foreach (Waste existingWaste in was.Waste) string wda = string.Format("WasteDisposalAmount_MTQ{0}", wCounter);
string wc = string.Format("WasteCapacity_MTQ{0}", wCounter);
string war = string.Format("WasteAmountRetained_MTQ{0}", wCounter);
string wagtnp = string.Format("WasteAmountGeneratedTillNextPort_MTQ{0}", wCounter);
string wt = string.Format("WasteType{0}", wCounter);
string wdpc = string.Format("WasteDisposalPortCode{0}", wCounter);
string wdcc = string.Format("WasteDisposalCountryCode{0}", wCounter);
string wd = string.Format("WasteDescription{0}", wCounter);
Waste waste = was.GetSublistElementWithIdentifier(wCounter.ToString()) as Waste;
if (waste == null)
{ {
if (wDict.ContainsKey("WasteType") && waste = new Waste();
((existingWaste.WasteType ?? 0) == (Enums.ParseWasteType(wDict["WasteType"]) ?? 0)) waste.Identifier = wCounter.ToString();
) waste.WAS = was;
{ was.Waste.Add(waste);
waste = existingWaste;
break;
}
} }
}
if (waste == null) waste.WasteType = (byte) wCounter;
{ if (vDict.ContainsKey(wda)) waste.WasteDisposalAmount_MTQ = Extensions.TryParseDouble(vDict[wda]);
waste = new Waste(); if (vDict.ContainsKey(wc)) waste.WasteCapacity_MTQ = Extensions.TryParseDouble(vDict[wc]);
waste.Identifier = key.ToString(); if (vDict.ContainsKey(war)) waste.WasteAmountRetained_MTQ = Extensions.TryParseDouble(vDict[war]);
waste.WAS = was; if (vDict.ContainsKey(wagtnp)) waste.WasteAmountGeneratedTillNextPort_MTQ = Extensions.TryParseDouble(vDict[wagtnp]);
was.Waste.Add(waste); if ((vDict.ContainsKey(wdpc)) && (vDict.ContainsKey(wdcc))) waste.WasteDisposalPort = vDict[wdcc] + vDict[wdpc];
} if (vDict.ContainsKey(wd)) waste.WasteDescription = vDict[wd];
if (wDict.ContainsKey("WasteAmountGeneratedTillNextPort_MTQ")) waste.WasteAmountGeneratedTillNextPort_MTQ = Extensions.TryParseDouble(wDict["WasteAmountGeneratedTillNextPort_MTQ"]); if (!waste.WasteDisposalPort.IsNullOrEmpty() && waste.WasteDisposalPort.Length > 5)
if (wDict.ContainsKey("WasteAmountRetained_MTQ")) waste.WasteAmountRetained_MTQ = Extensions.TryParseDouble(wDict["WasteAmountRetained_MTQ"]); {
if (wDict.ContainsKey("WasteCapacity_MTQ")) waste.WasteCapacity_MTQ = Extensions.TryParseDouble(wDict["WasteCapacity_MTQ"]); _log.WarnFormat("WasteDisposalPort format ERROR [{0}], truncating", was.LastWasteDisposalPort);
if (wDict.ContainsKey("WasteDisposalAmount_MTQ")) waste.WasteDisposalAmount_MTQ = Extensions.TryParseDouble(wDict["WasteDisposalAmount_MTQ"]); waste.WasteDisposalPort = waste.WasteDisposalPort.Substring(0, 5);
if (wDict.ContainsKey("WasteDescription")) waste.WasteDescription = wDict["WasteDescription"]; }
if (wDict.ContainsKey("WasteType")) waste.WasteType = Enums.ParseWasteType(wDict["WasteType"]);
if (wDict.ContainsKey("WasteDisposalCountryCode") && wDict.ContainsKey("WasteDisposalPortCode"))
waste.WasteDisposalPort = wDict["WasteDisposalCountryCode"] + wDict["WasteDisposalPortCode"];
// Wenn das Feld leer ist mit "-" entwerten
if (((waste.WasteType ?? 0) == 3) && waste.WasteDescription.IsNullOrEmpty())
waste.WasteDescription = "-";
if (((waste.WasteType ?? 0) == 8) && waste.WasteDescription.IsNullOrEmpty())
waste.WasteDescription = "-";
if (((waste.WasteType ?? 0) == 9) && waste.WasteDescription.IsNullOrEmpty())
waste.WasteDescription = "-";
if(!waste.WasteDisposalPort.IsNullOrEmpty() && waste.WasteDisposalPort.Length > 5)
{
_log.WarnFormat("WasteDisposalPort format ERROR [{0}], truncating", was.LastWasteDisposalPort);
waste.WasteDisposalPort = waste.WasteDisposalPort.Substring(0, 5);
}
if (waste.WasteType.HasValue)
{
saveMessages.Add(waste); saveMessages.Add(waste);
} }
else }
else {
foreach (int key in nDict.Keys)
{ {
// wenn nichtmal der WasteType gesetzt ist verwenden wir lieber den default und speichern das nicht Dictionary<string, string> wDict = nDict[key];
was.Waste.Remove(waste); Waste waste = was.GetSublistElementWithIdentifier(key.ToString()) as Waste;
if (waste == null)
{
foreach (Waste existingWaste in was.Waste)
{
if (wDict.ContainsKey("WasteType") &&
((existingWaste.WasteType ?? 0) == (Enums.ParseWasteType(wDict["WasteType"]) ?? 0))
)
{
waste = existingWaste;
break;
}
}
}
if (waste == null)
{
waste = new Waste();
waste.Identifier = key.ToString();
waste.WAS = was;
was.Waste.Add(waste);
}
if (wDict.ContainsKey("WasteAmountGeneratedTillNextPort_MTQ")) waste.WasteAmountGeneratedTillNextPort_MTQ = Extensions.TryParseDouble(wDict["WasteAmountGeneratedTillNextPort_MTQ"]);
if (wDict.ContainsKey("WasteAmountRetained_MTQ")) waste.WasteAmountRetained_MTQ = Extensions.TryParseDouble(wDict["WasteAmountRetained_MTQ"]);
if (wDict.ContainsKey("WasteCapacity_MTQ")) waste.WasteCapacity_MTQ = Extensions.TryParseDouble(wDict["WasteCapacity_MTQ"]);
if (wDict.ContainsKey("WasteDisposalAmount_MTQ")) waste.WasteDisposalAmount_MTQ = Extensions.TryParseDouble(wDict["WasteDisposalAmount_MTQ"]);
if (wDict.ContainsKey("WasteDescription")) waste.WasteDescription = wDict["WasteDescription"];
if (wDict.ContainsKey("WasteType")) waste.WasteType = Enums.ParseWasteType(wDict["WasteType"]);
if (wDict.ContainsKey("WasteDisposalCountryCode") && wDict.ContainsKey("WasteDisposalPortCode"))
waste.WasteDisposalPort = wDict["WasteDisposalCountryCode"] + wDict["WasteDisposalPortCode"];
// Wenn das Feld leer ist mit "-" entwerten
if (((waste.WasteType ?? 0) == 3) && waste.WasteDescription.IsNullOrEmpty())
waste.WasteDescription = "-";
if (((waste.WasteType ?? 0) == 8) && waste.WasteDescription.IsNullOrEmpty())
waste.WasteDescription = "-";
if (((waste.WasteType ?? 0) == 9) && waste.WasteDescription.IsNullOrEmpty())
waste.WasteDescription = "-";
if (!waste.WasteDisposalPort.IsNullOrEmpty() && waste.WasteDisposalPort.Length > 5)
{
_log.WarnFormat("WasteDisposalPort format ERROR [{0}], truncating", was.LastWasteDisposalPort);
waste.WasteDisposalPort = waste.WasteDisposalPort.Substring(0, 5);
}
if (waste.WasteType.HasValue)
{
saveMessages.Add(waste);
}
else
{
// wenn nichtmal der WasteType gesetzt ist verwenden wir lieber den default und speichern das nicht
was.Waste.Remove(waste);
}
} }
} }

View File

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