This commit is contained in:
2022-09-30 22:18:26 +02:00
parent 1e7312208e
commit 265cfe1f18
9 changed files with 596 additions and 104 deletions

View File

@@ -29,6 +29,8 @@ Public Class cIMPORT_Codelisten
Return Import_I0200(TESTSYSTEM)
Case "I0700"
Return Import_I0700(TESTSYSTEM)
Case "C0141"
Return Import_C0141(TESTSYSTEM)
End Select
Return False
End Function
@@ -230,6 +232,56 @@ Public Class cIMPORT_Codelisten
End Function
Shared Function Import_C0141(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("C0141_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 cZollstellen
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 cZollstellen.cZollstelle(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
MsgBox(ex.Message)
End Try
Return False
End Function
Shared Function Import_C0013(TESTSYSTEM) As Boolean
Dim MyData As String = ""
Try
@@ -944,6 +996,46 @@ Class cVorpapierArten
End Class
Class cZollstellen
Inherits List(Of cZollstelle)
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
Function INSERT_DB(TESTSSYSTEM) As Boolean
If SQL.doSQL("DELETE FROM [tbl_DY_ZollDE_C0141_Zollstellen]", , , , 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_C0141_Zollstellen] (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 cZollstelle
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 cUnterlageArten
Inherits List(Of cUnterlageArt)