Timas, Fremdwährungen, Asfinag
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
Imports System.Data.OleDb
|
||||
Imports System.DirectoryServices.ActiveDirectory
|
||||
Imports System.IO
|
||||
Imports System.Net
|
||||
Imports System.Text
|
||||
Imports System.Xml
|
||||
Imports DocumentFormat.OpenXml.Drawing.Diagrams
|
||||
Imports DocumentFormat.OpenXml.Wordprocessing
|
||||
Imports iTextSharp.text.pdf.qrcode.Version
|
||||
Imports Org.BouncyCastle.Asn1.Pkcs
|
||||
Imports Renci.SshNet
|
||||
Imports VERAG_PROG_ALLGEMEIN
|
||||
|
||||
@@ -1961,6 +1964,9 @@ Public Class frmStartOptions
|
||||
PictureBox12.Visible = False
|
||||
PictureBox13.Visible = False
|
||||
PictureBox14.Visible = False
|
||||
PictureBox18.Visible = False
|
||||
PictureBox19.Visible = False
|
||||
PictureBox20.Visible = False
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -3453,10 +3459,114 @@ Public Class frmStartOptions
|
||||
End Sub
|
||||
|
||||
Private Sub LinkLabel42_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel42.LinkClicked
|
||||
|
||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
Dim blt = New cAsfinag.Exportist
|
||||
blt.initPFad()
|
||||
showPic(blt.exportiereWhiteList, PictureBox18)
|
||||
Me.Cursor = Cursors.Default
|
||||
End Sub
|
||||
|
||||
Private Sub LinkLabel41_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel41.LinkClicked
|
||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
Dim blt = New cAsfinag.Exportist
|
||||
blt.initPFad()
|
||||
showPic(blt.exportiereBlackList, PictureBox19)
|
||||
Me.Cursor = Cursors.Default
|
||||
End Sub
|
||||
|
||||
Private Sub LinkLabel45_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel45.LinkClicked
|
||||
|
||||
Dim MyData As String = ""
|
||||
Dim SQL = New SQL
|
||||
Dim erg = True
|
||||
|
||||
Dim firstDaycurrentMonth = DateTime.Now.AddMonths(0)
|
||||
firstDaycurrentMonth = New DateTime(firstDaycurrentMonth.Year, firstDaycurrentMonth.Month, 1)
|
||||
|
||||
Dim lastDaycurrentMonth = DateTime.Now.AddMonths(1)
|
||||
lastDaycurrentMonth = New DateTime(lastDaycurrentMonth.Year, lastDaycurrentMonth.Month, 1).AddDays(-1)
|
||||
|
||||
Dim kursart = "1" 'notirete Währung
|
||||
Dim startdatum_tag2 = firstDaycurrentMonth.Day
|
||||
Dim startdatum_monat2 = firstDaycurrentMonth.Month
|
||||
Dim startdatum_jahr2 = firstDaycurrentMonth.Year
|
||||
Dim enddatum_tag2 = lastDaycurrentMonth.Day
|
||||
Dim enddatum_monat2 = lastDaycurrentMonth.Month
|
||||
Dim enddatum_jahr2 = lastDaycurrentMonth.Year
|
||||
|
||||
Try
|
||||
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
|
||||
|
||||
Using WC As New System.Net.WebClient()
|
||||
' C0008_URL()
|
||||
WC.Encoding = ASCIIEncoding.UTF8
|
||||
Dim URL = "https://www.zoll.de/SiteGlobals/Functions/Kurse/KursExport.xml?view=xmlexportkursesearchresultZOLLWeb&kursart=" & kursart &
|
||||
"&startdatum_tag2=" & startdatum_tag2 &
|
||||
"&startdatum_monat2=" & startdatum_monat2 &
|
||||
"&startdatum_jahr2=" & startdatum_jahr2 &
|
||||
"&enddatum_tag2=" & enddatum_tag2 &
|
||||
"&enddatum_monat2=" & enddatum_monat2 &
|
||||
"&enddatum_jahr2=" & enddatum_jahr2 &
|
||||
"&sort=asc&spalte=gueltigkeit"
|
||||
If URL = String.Empty Then Exit Sub
|
||||
|
||||
MyData = WC.DownloadString(URL)
|
||||
Dim doc As New XmlDocument()
|
||||
doc.LoadXml(MyData)
|
||||
If doc.HasChildNodes Then
|
||||
|
||||
If doc.GetElementsByTagName("kurs").Count > 0 Then
|
||||
Dim endDatum, startDatum
|
||||
Dim count As Integer = 1
|
||||
For Each node As XmlElement In doc.GetElementsByTagName("kurs")
|
||||
Dim wk As New cFremdwaehrungskurse()
|
||||
If node.Attributes("id") IsNot Nothing Then wk.fw_id = node.Attributes("id").Value
|
||||
If node.HasChildNodes Then
|
||||
For Each element As XmlElement In node.ChildNodes
|
||||
If element.Name = "land" AndAlso element.InnerText <> "" Then wk.fw_land = element.InnerText
|
||||
If element.Name = "iso2" AndAlso element.InnerText <> "" Then wk.fw_iso2 = element.InnerText
|
||||
If element.Name = "iso3" AndAlso element.InnerText <> "" Then wk.fw_iso3 = element.InnerText
|
||||
If element.Name = "kurswert" AndAlso element.InnerText <> "" Then wk.fw_kurswert = element.InnerText
|
||||
If element.Name = "startdatum" AndAlso element.InnerText <> "" Then
|
||||
wk.fw_startdatum = element.InnerText
|
||||
startDatum = wk.fw_startdatum
|
||||
End If
|
||||
If element.Name = "enddatum" AndAlso element.InnerText <> "" Then
|
||||
wk.fw_enddatum = element.InnerText
|
||||
endDatum = wk.fw_enddatum
|
||||
End If
|
||||
Next
|
||||
count = count + 1
|
||||
wk.SAVE()
|
||||
End If
|
||||
Next
|
||||
Dim wk_euro As New cFremdwaehrungskurse()
|
||||
wk_euro.fw_id = 0
|
||||
wk_euro.fw_land = "Europa"
|
||||
wk_euro.fw_kurswert = 1
|
||||
wk_euro.fw_iso3 = "EUR"
|
||||
wk_euro.fw_iso2 = "EU"
|
||||
wk_euro.fw_startdatum = firstDaycurrentMonth.ToShortDateString()
|
||||
wk_euro.fw_enddatum = lastDaycurrentMonth.ToShortDateString()
|
||||
wk_euro.SAVE()
|
||||
|
||||
|
||||
|
||||
Dim sqlCount = SQL.getValueTxtBySqlVarList("SELECT isnull(count(*),0) FROM tblZOLL_Wechselkurse WHERE [fw_startdatum]='" & startDatum & "' AND fw_enddatum='" & endDatum & "'", "FMZOLL")
|
||||
If count <> sqlCount Then
|
||||
MsgBox("Anzahl der Importierten Datensätze:" & sqlCount & vbNewLine & "Anzahl Datensätze in Datei: " & count)
|
||||
erg = False
|
||||
End If
|
||||
End If
|
||||
showPic(erg, PictureBox20)
|
||||
End If
|
||||
|
||||
End Using
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message & ex.StackTrace)
|
||||
End Try
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user