This commit is contained in:
2020-11-27 22:57:00 +01:00
parent fa670231f7
commit 14a7113144
22 changed files with 872 additions and 58 deletions

View File

@@ -410,6 +410,207 @@ Public Class cMAVIWorker
End Function
Public Shared Function readNCTS_AbbruchXML_CC009A(FORM As frmTRNCTS_NachrichtenVerarbeitung, doc As XmlDocument) As String
Try
readNCTS_AbbruchXML_CC009A = ""
Dim sw = New StringWriter()
Dim xw = New XmlTextWriter(sw)
doc.WriteTo(xw)
Dim XmlString = sw.ToString()
If XmlString.Contains("<CC009A>") Then
Dim xmlCC009A = XmlString.Substring(XmlString.IndexOf("<CC009A>"), XmlString.IndexOf("</CC009A>") + 9 - XmlString.IndexOf("<CC009A>"))
' MsgBox(xmlCC029B)
Dim p = Path.GetTempFileName
Dim MRN = ""
If doc.GetElementsByTagName("DocNumHEA5").Count > 0 Then
MRN = doc.GetElementsByTagName("DocNumHEA5")(0).InnerText
End If
Dim Abbruchdatum = Nothing
If doc.GetElementsByTagName("DatOfCanDecHEA146").Count > 0 Then
Try
Abbruchdatum = Date.ParseExact(doc.GetElementsByTagName("DatOfCanDecHEA146")(0).InnerText, "yyyyMMdd", System.Globalization.DateTimeFormatInfo.InvariantInfo)
Catch ex As Exception
End Try
End If
Using outputFile As New StreamWriter(p, False, System.Text.Encoding.Default)
outputFile.Write(xmlCC009A)
outputFile.Close()
Dim NCTS As cNCTSPartnerWorker.cNCTS_TR = cNCTSPartnerWorker.cNCTS_TR.LOADByBezugsNr_or_GUID_or_MRN("", "", MRN, True,, "MAVI")
If NCTS Is Nothing Then NCTS = New cNCTSPartnerWorker.cNCTS_TR
NCTS.ncts_Partnersystem = "MAVI"
NCTS.ncts_MRN = MRN
NCTS.ncts_Status = DAKOSY_Worker.cDY_Statusliste.S_80
NCTS.ncts_Status_KEWILL_Equivalent = NCTS.ncts_Status
readNCTS_AbbruchXML_CC009A = NCTS.ncts_ObjectName
If NCTS.SAVE_ALL() Then
' If If(NCTS.ncts_Status, 0) <= 5 Then DAKOSY_Worker.cDakosy_Statusmeldungen.InsertStatusMeldung(DY_TMP, DAKOSY_Worker.cDY_Statusliste.S_05,,,, statusTMP)
Else
readNCTS_AbbruchXML_CC009A = ""
End If
Try
System.IO.File.Delete(p)
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
FORM.addDGVEinarbeitung("NCTS: Abbruch", readNCTS_AbbruchXML_CC009A)
End Using
End If
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
readNCTS_AbbruchXML_CC009A = ""
End Try
End Function
Public Shared Function readNCTS_RueckweisungXML_CC016A(FORM As frmTRNCTS_NachrichtenVerarbeitung, doc As XmlDocument) As String
Try
readNCTS_RueckweisungXML_CC016A = ""
Dim sw = New StringWriter()
Dim xw = New XmlTextWriter(sw)
doc.WriteTo(xw)
Dim XmlString = sw.ToString()
If XmlString.Contains("<CC016A>") Then
Dim xmlCC016A = XmlString.Substring(XmlString.IndexOf("<CC016A>"), XmlString.IndexOf("</CC016A>") + 9 - XmlString.IndexOf("<CC016A>"))
' MsgBox(xmlCC029B)
Dim p = Path.GetTempFileName
Dim LRN = ""
If doc.GetElementsByTagName("RefNumHEA4").Count > 0 Then
LRN = doc.GetElementsByTagName("RefNumHEA4")(0).InnerText
End If
Dim Abbruchdatum = Nothing
If doc.GetElementsByTagName("DecRejDatHEA159").Count > 0 Then
Try
Abbruchdatum = Date.ParseExact(doc.GetElementsByTagName("DecRejDatHEA159")(0).InnerText, "yyyyMMdd", System.Globalization.DateTimeFormatInfo.InvariantInfo)
Catch ex As Exception
End Try
End If
Using outputFile As New StreamWriter(p, False, System.Text.Encoding.Default)
outputFile.Write(xmlCC016A)
outputFile.Close()
Dim NCTS As cNCTSPartnerWorker.cNCTS_TR = cNCTSPartnerWorker.cNCTS_TR.LOADByBezugsNr_or_GUID_or_MRN(LRN, "", "", True,, "MAVI")
If NCTS Is Nothing Then NCTS = New cNCTSPartnerWorker.cNCTS_TR
NCTS.ncts_Partnersystem = "MAVI"
NCTS.ncts_ObjectName = LRN
NCTS.ncts_Status = DAKOSY_Worker.cDY_Statusliste.S_65
NCTS.ncts_Status_KEWILL_Equivalent = NCTS.ncts_Status
readNCTS_RueckweisungXML_CC016A = LRN
If NCTS.SAVE_ALL() Then
' If If(NCTS.ncts_Status, 0) <= 5 Then DAKOSY_Worker.cDakosy_Statusmeldungen.InsertStatusMeldung(DY_TMP, DAKOSY_Worker.cDY_Statusliste.S_05,,,, statusTMP)
Else
readNCTS_RueckweisungXML_CC016A = ""
End If
Try
System.IO.File.Delete(p)
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
FORM.addDGVEinarbeitung("NCTS: Rückweisung", readNCTS_RueckweisungXML_CC016A)
End Using
End If
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
readNCTS_RueckweisungXML_CC016A = ""
End Try
End Function
Public Shared Function readNCTS_KeineFreigabeXML_CC051B(FORM As frmTRNCTS_NachrichtenVerarbeitung, doc As XmlDocument) As String
Try
readNCTS_KeineFreigabeXML_CC051B = ""
Dim sw = New StringWriter()
Dim xw = New XmlTextWriter(sw)
doc.WriteTo(xw)
Dim XmlString = sw.ToString()
If XmlString.Contains("<CC051B>") Then
Dim xmlCC051B = XmlString.Substring(XmlString.IndexOf("<CC051B>"), XmlString.IndexOf("</CC051B>") + 9 - XmlString.IndexOf("<CC051B>"))
' MsgBox(xmlCC029B)
Dim p = Path.GetTempFileName
Dim MRN = ""
If doc.GetElementsByTagName("DocNumHEA5").Count > 0 Then
MRN = doc.GetElementsByTagName("DocNumHEA5")(0).InnerText
End If
Dim Abbruchdatum = Nothing
If doc.GetElementsByTagName("DecRejDatHEA159").Count > 0 Then
Try
Abbruchdatum = Date.ParseExact(doc.GetElementsByTagName("DecRejDatHEA159")(0).InnerText, "yyyyMMdd", System.Globalization.DateTimeFormatInfo.InvariantInfo)
Catch ex As Exception
End Try
End If
Using outputFile As New StreamWriter(p, False, System.Text.Encoding.Default)
outputFile.Write(xmlCC051B)
outputFile.Close()
Dim NCTS As cNCTSPartnerWorker.cNCTS_TR = cNCTSPartnerWorker.cNCTS_TR.LOADByBezugsNr_or_GUID_or_MRN("", "", MRN, True,, "MAVI")
If NCTS Is Nothing Then NCTS = New cNCTSPartnerWorker.cNCTS_TR
NCTS.ncts_Partnersystem = "MAVI"
NCTS.ncts_MRN = MRN
NCTS.ncts_Status = DAKOSY_Worker.cDY_Statusliste.S_65
NCTS.ncts_Status_KEWILL_Equivalent = NCTS.ncts_Status
readNCTS_KeineFreigabeXML_CC051B = NCTS.ncts_ObjectName
If NCTS.SAVE_ALL() Then
' If If(NCTS.ncts_Status, 0) <= 5 Then DAKOSY_Worker.cDakosy_Statusmeldungen.InsertStatusMeldung(DY_TMP, DAKOSY_Worker.cDY_Statusliste.S_05,,,, statusTMP)
Else
readNCTS_KeineFreigabeXML_CC051B = ""
End If
Try
System.IO.File.Delete(p)
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
FORM.addDGVEinarbeitung("NCTS: KeineFreigabe", readNCTS_KeineFreigabeXML_CC051B)
End Using
End If
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
readNCTS_KeineFreigabeXML_CC051B = ""
End Try
End Function
Public Shared Function readNCTS_BestaetigungZollXML_GUA_INF(FORM As frmTRNCTS_NachrichtenVerarbeitung, doc As XmlDocument) As String
Try
readNCTS_BestaetigungZollXML_GUA_INF = ""