kleine Korrekturen

This commit is contained in:
Daniel Schick 2023-01-09 15:51:00 +01:00
parent 8cca412079
commit 2177e69d4c
2 changed files with 10 additions and 5 deletions

View File

@ -28,12 +28,16 @@ namespace bsmd.dbh
root.Version = RootVersion.Item71; root.Version = RootVersion.Item71;
root.SourceDocumentVersion = "7.1"; root.SourceDocumentVersion = "7.1";
root.Timestamp = DateTime.Now; root.Timestamp = DateTime.Now;
string filenameComponent;
if(core.InitialHIS == Message.NSWProvider.DBH_MAERSK) if(core.InitialHIS == Message.NSWProvider.DBH_MAERSK)
{ {
filenameComponent = "BSMDMAERSK";
root.Sender = Properties.Settings.Default.SenderMaersk; root.Sender = Properties.Settings.Default.SenderMaersk;
} }
else else
{ {
filenameComponent = "BSMD";
root.Sender = Properties.Settings.Default.Sender; root.Sender = Properties.Settings.Default.Sender;
} }
root.SenderReference = message.Id.Value.ToString("N"); root.SenderReference = message.Id.Value.ToString("N");
@ -229,7 +233,7 @@ namespace bsmd.dbh
rootNOA_NOD.Items = choices.ToArray(); rootNOA_NOD.Items = choices.ToArray();
rootNOA_NOD.ItemsElementName = choiceList.ToArray(); rootNOA_NOD.ItemsElementName = choiceList.ToArray();
rootNOA_NOD.ReportingParty = rp; // rootNOA_NOD.ReportingParty = rp;
root.Items = new object[1]; root.Items = new object[1];
root.Items[0] = rootNOA_NOD; root.Items[0] = rootNOA_NOD;
break; break;
@ -1659,9 +1663,9 @@ namespace bsmd.dbh
rwr.TreatmentFacilityProvider[j] = was_rcpt.TreatmentFacilityProvider[j].TreatmentFacilityProviderName; rwr.TreatmentFacilityProvider[j] = was_rcpt.TreatmentFacilityProvider[j].TreatmentFacilityProviderName;
} }
if (was_rcpt.WasteDeliveryDateFrom.HasValue) if (was_rcpt.WasteDeliveryDateFrom.HasValue)
rwr.WasteDeliveryDateFrom = was_rcpt.WasteDeliveryDateFrom.Value; rwr.WasteDeliveryDateFrom = was_rcpt.WasteDeliveryDateFrom.Value.ToUTCSerializableDateTime();
if (was_rcpt.WasteDeliveryDateTo.HasValue) if (was_rcpt.WasteDeliveryDateTo.HasValue)
rwr.WasteDeliveryDateTo = was_rcpt.WasteDeliveryDateTo.Value; rwr.WasteDeliveryDateTo = was_rcpt.WasteDeliveryDateTo.Value.ToUTCSerializableDateTime();
rwr.WasteReceived = new RootWAS_RCPTWasteDeliveryReceiptWasteReceived[was_rcpt.WasteReceived.Count]; rwr.WasteReceived = new RootWAS_RCPTWasteDeliveryReceiptWasteReceived[was_rcpt.WasteReceived.Count];
for (int j = 0; j < was_rcpt.WasteReceived.Count; j++) for (int j = 0; j < was_rcpt.WasteReceived.Count; j++)
{ {
@ -1671,6 +1675,7 @@ namespace bsmd.dbh
rwr.WasteReceived[j].WasteType.WasteCode = was_rcpt.WasteReceived[j].WasteCode; rwr.WasteReceived[j].WasteType.WasteCode = was_rcpt.WasteReceived[j].WasteCode;
rwr.WasteReceived[j].WasteType.WasteDescription = was_rcpt.WasteReceived[j].WasteDescription; rwr.WasteReceived[j].WasteType.WasteDescription = was_rcpt.WasteReceived[j].WasteDescription;
} }
rootWAS_RCPT.WasteDeliveryReceipt[i] = rwr;
} }
// rootWAS_RCPT.ReportingParty = rp; // rootWAS_RCPT.ReportingParty = rp;
root.Items = new object[1]; root.Items = new object[1];
@ -1688,7 +1693,7 @@ namespace bsmd.dbh
// serialize output structure to file // serialize output structure to file
string filename = string.Format("NSW.DBH.BSMD.{0}.xml", message.FileSequenceNumber); string filename = string.Format("NSW.DBH.{0}.{1}.xml", filenameComponent, message.FileSequenceNumber);
_log.InfoFormat("{0}: saving {1} to output directory", message.MessageNotificationClassDisplay, filename); _log.InfoFormat("{0}: saving {1} to output directory", message.MessageNotificationClassDisplay, filename);
string filePath = Path.Combine(Path.GetTempPath(), filename); string filePath = Path.Combine(Path.GetTempPath(), filename);

View File

@ -37,7 +37,7 @@ namespace bsmd.dbh
// Achtung! Die laufende Nummer der rücklaufenden Datei ist _nicht_ dieselbe und kann zur Identifikation der Meldeklasse // Achtung! Die laufende Nummer der rücklaufenden Datei ist _nicht_ dieselbe und kann zur Identifikation der Meldeklasse
// nicht verwendet werden // nicht verwendet werden
string fileSeqString = m.Groups[1].Value; string fileSeqString = m.Groups[2].Value;
if(!Int32.TryParse(fileSeqString, out int fileSeqNum)) if(!Int32.TryParse(fileSeqString, out int fileSeqNum))
{ {