This commit is contained in:
2023-10-13 22:12:48 +02:00
parent da98cbfc22
commit 4afd3d2151
9 changed files with 443 additions and 572 deletions

View File

@@ -34,6 +34,8 @@ Public Class cIMPORT_Codelisten
Return Import_C0141(TESTSYSTEM)
Case "I0610"
Return Import_I0610(TESTSYSTEM)
Case "C0219"
Return Import_C0219(TESTSYSTEM)
End Select
Return False
End Function
@@ -478,6 +480,55 @@ Public Class cIMPORT_Codelisten
End Function
Shared Function Import_C0219(TESTSYSTEM) As Boolean
Dim MyData As String = ""
Try
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
Using WC As New System.Net.WebClient()
' C0008_URL()
WC.Encoding = ASCIIEncoding.UTF8
Dim URL = cDY_Paramter.GET_PARAM_ByName("C0219_URL", TESTSYSTEM, "VERAG")
If URL = String.Empty Then Return False
' MsgBox(URL)
MyData = WC.DownloadString(URL)
Dim doc As New XmlDocument()
doc.LoadXml(MyData)
Dim LC As New cBefoerderungsmittelartenC0219
If doc.HasChildNodes Then
If doc.GetElementsByTagName("Codelist").Count > 0 Then
If doc.GetElementsByTagName("Codelist")(0).HasChildNodes Then
For Each Entry As XmlNode In doc.GetElementsByTagName("Codelist")(0).ChildNodes
' MsgBox(Entry.SelectNodes("Code")(0).InnerText)
Dim Code = ""
Dim Description = ""
Dim StartDate = Nothing
Dim EndDate = Nothing
If Entry.SelectNodes("Code").Count > 0 Then Code = Entry.SelectNodes("Code")(0).InnerText
If Entry.SelectNodes("Description").Count > 0 Then Description = Entry.SelectNodes("Description")(0).InnerText
If Entry.SelectNodes("StartDate").Count > 0 Then StartDate = CDate(Entry.SelectNodes("StartDate")(0).InnerText)
If Entry.SelectNodes("EndDate").Count > 0 Then EndDate = CDate(Entry.SelectNodes("EndDate")(0).InnerText)
LC.Add(New cBefoerderungsmittelartenC0219.cBefoerderungsmittelart(Code, Description, StartDate, EndDate))
Next
End If
End If
End If
If LC.Count > 0 Then
Return LC.INSERT_DB(TESTSYSTEM)
End If
End Using
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodBase.GetCurrentMethod.Name)
End Try
Return False
End Function
Shared Function Import_I0200(TESTSYSTEM) As Boolean
Dim MyData As String = ""
Try
@@ -673,6 +724,46 @@ Class cWaehrungsliste
End Class
Class cBefoerderungsmittelartenC0219
Inherits List(Of cBefoerderungsmittelart)
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
Function INSERT_DB(TESTSSYSTEM) As Boolean
If SQL.doSQL("DELETE FROM [tbl_DY_ZollDE_C0219_TypeTransportMeans]", , , , SQL.GetNewOpenConnectionFMZOLL_SYSTEM(TESTSSYSTEM)) Then
Dim ok = True
For Each l In Me
Dim List As New List(Of VERAG_PROG_ALLGEMEIN.MyListItem2)
List.Add(New VERAG_PROG_ALLGEMEIN.MyListItem2("Code", l.Code))
List.Add(New VERAG_PROG_ALLGEMEIN.MyListItem2("Description", l.Description))
List.Add(New VERAG_PROG_ALLGEMEIN.MyListItem2("StartDate", l.StartDate))
List.Add(New VERAG_PROG_ALLGEMEIN.MyListItem2("EndDate", l.EndDate))
If Not SQL.doSQL("INSERT INTO [tbl_DY_ZollDE_C0219_TypeTransportMeans] (Code, Description, StartDate, EndDate) VALUES (@Code, @Description, @StartDate, @EndDate); ", "FMZOLL", , List, SQL.GetNewOpenConnectionFMZOLL_SYSTEM(TESTSSYSTEM)) Then
ok = False
End If
Next
Return ok
End If
Return False
End Function
Class cBefoerderungsmittelart
Property Code As String = ""
Property Description As String = ""
Property StartDate As Object = Nothing
Property EndDate As Object = Nothing
Sub New(Code, Description, StartDate, EndDate)
Me.Code = Code
Me.Description = Description
Me.StartDate = StartDate
Me.EndDate = EndDate
End Sub
End Class
End Class
Class cMasseinheit
Inherits List(Of cMasseinheitI0700)