merge
This commit is contained in:
@@ -4,6 +4,7 @@ Imports System.Data.SqlClient
|
|||||||
Imports ClosedXML.Excel
|
Imports ClosedXML.Excel
|
||||||
Imports DocumentFormat
|
Imports DocumentFormat
|
||||||
Imports System.Net
|
Imports System.Net
|
||||||
|
Imports DAKOSY_Worker
|
||||||
|
|
||||||
Module Mail
|
Module Mail
|
||||||
Dim sPath As String = System.AppDomain.CurrentDomain.BaseDirectory
|
Dim sPath As String = System.AppDomain.CurrentDomain.BaseDirectory
|
||||||
@@ -69,6 +70,7 @@ Module Mail
|
|||||||
|
|
||||||
'PARAM = "THYSSENKRUPP_AUSWERTUNG"
|
'PARAM = "THYSSENKRUPP_AUSWERTUNG"
|
||||||
'PARAM = "RED_BULL"
|
'PARAM = "RED_BULL"
|
||||||
|
'PARAM = "ZF"
|
||||||
|
|
||||||
'------------------------------------------------------------------------------------
|
'------------------------------------------------------------------------------------
|
||||||
' PARAM = "NCTSLIST_TOBB"
|
' PARAM = "NCTSLIST_TOBB"
|
||||||
@@ -97,7 +99,7 @@ Module Mail
|
|||||||
' cnt += 1
|
' cnt += 1
|
||||||
'End While
|
'End While
|
||||||
If cnt >= 20 Then
|
If cnt >= 20 Then
|
||||||
System.Console.WriteLine("MailSender konnte nicht gestartet werden, da eine Insatanz noch läuft...")
|
System.Console.WriteLine("MailSender konnte nicht gestartet werden, da eine Instanz noch läuft...")
|
||||||
Else
|
Else
|
||||||
|
|
||||||
'Select Case firma
|
'Select Case firma
|
||||||
@@ -205,6 +207,16 @@ Module Mail
|
|||||||
If SendEmail_RED_BULL("customs.documents.ata@redbull.com", KdNr, von, bis) Then 'für Andreas Details
|
If SendEmail_RED_BULL("customs.documents.ata@redbull.com", KdNr, von, bis) Then 'für Andreas Details
|
||||||
System.Console.WriteLine("Vorgang erfolgreich abgeschlossen ...")
|
System.Console.WriteLine("Vorgang erfolgreich abgeschlossen ...")
|
||||||
End If
|
End If
|
||||||
|
Case "ZF"
|
||||||
|
Dim von = CDate("01." & Now.AddMonths(-1).Month & "." & Now.AddMonths(-1).Year)
|
||||||
|
Dim bis = CDate("01." & Now.Month & "." & Now.Year).AddDays(-1)
|
||||||
|
|
||||||
|
Dim KdNr As String = "714869"
|
||||||
|
System.Console.WriteLine("OPTION erkannt: ZF _ Erstellt eine monaltiche Auswertung der DAKSOY-Abfertigungen für ZF.")
|
||||||
|
System.Console.WriteLine("Auswertung Details gestartet...")
|
||||||
|
If SendEmail_ZF("robert.buchbauer@zf.com; christina.eggerl@zf.com; teresa.elster@zf.com", KdNr, von, bis) Then
|
||||||
|
System.Console.WriteLine("Vorgang erfolgreich abgeschlossen ...")
|
||||||
|
End If
|
||||||
Case "QS_AUFTEILUNG"
|
Case "QS_AUFTEILUNG"
|
||||||
System.Console.WriteLine("OPTION erkannt: QS_AUFTEILUNG _ Erstellt die Auswertung der QS-AUFTEILUNG.")
|
System.Console.WriteLine("OPTION erkannt: QS_AUFTEILUNG _ Erstellt die Auswertung der QS-AUFTEILUNG.")
|
||||||
System.Console.WriteLine("Auswertung gestartet...")
|
System.Console.WriteLine("Auswertung gestartet...")
|
||||||
@@ -556,6 +568,43 @@ Module Mail
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Function SendEmail_ZF(Mailto As String, KdNr As String, von As Date, bis As Date) As Boolean
|
||||||
|
Try
|
||||||
|
Dim excel As String = genEXCEL_ZF(KdNr, von, bis)
|
||||||
|
System.Console.WriteLine("EXCEL erstellt...")
|
||||||
|
If excel <> "" And Not excel.StartsWith("ERROR: ") Then
|
||||||
|
|
||||||
|
System.Console.WriteLine("Sende E-Mail...")
|
||||||
|
|
||||||
|
Dim Subject = "Auswertungen Zollanmeldungen ZF Friedrichshafen AG "
|
||||||
|
Dim Body = "Anbei befinden sich die Auswertungen Zollanmeldungen von " & von.ToShortDateString & " bis " & bis.ToShortDateString & "." &
|
||||||
|
"<br><br>Erstellt am: " & Now.ToShortDateString & ", um " & Now.ToShortTimeString &
|
||||||
|
"<br><br><br>Automatisch generiertes E-Mail. Bitte Antworten Sie nicht an dieses E-Mail." &
|
||||||
|
"<br><br>VERAG SPEDITION AG"
|
||||||
|
|
||||||
|
|
||||||
|
Dim anhenge As New List(Of String)
|
||||||
|
anhenge.Add(excel)
|
||||||
|
If VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(Mailto, Subject, Body,,, False,, "d.breimaier@verag.ag;ra@verag.ag", anhenge) Then
|
||||||
|
System.Console.WriteLine("E-Mail gesendet.")
|
||||||
|
System.Console.WriteLine("Erfolgreich!")
|
||||||
|
Else
|
||||||
|
System.Console.WriteLine("ERROR BEIM SENDEN DER MAIL!")
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return True
|
||||||
|
Else
|
||||||
|
System.Console.WriteLine(excel)
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodBase.GetCurrentMethod.Name, VERAG_PROG_ALLGEMEIN.ERROR_OP.MAIL)
|
||||||
|
System.Console.WriteLine(ex.Message & ex.StackTrace)
|
||||||
|
Return False
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
Private Function SendEmail_BRG_Auswertung(Optional wochenAuswertung As Boolean = False, Optional details As Boolean = False) As Boolean
|
Private Function SendEmail_BRG_Auswertung(Optional wochenAuswertung As Boolean = False, Optional details As Boolean = False) As Boolean
|
||||||
Dim Msg As New MailMessage
|
Dim Msg As New MailMessage
|
||||||
Dim myCredentials As New System.Net.NetworkCredential
|
Dim myCredentials As New System.Net.NetworkCredential
|
||||||
@@ -1375,6 +1424,97 @@ Module Mail
|
|||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Public Function genEXCEL_ZF(KdNr As String, von As Date, bis As Date) As String
|
||||||
|
Try
|
||||||
|
|
||||||
|
Dim KUNDENADR = New VERAG_PROG_ALLGEMEIN.cAdressen(KdNr)
|
||||||
|
Dim sqlstr As String = ""
|
||||||
|
|
||||||
|
sqlstr &= "SELECT CAST([FilialenNr] as varchar) + '/' + CAST([AbfertigungsNr] as varchar) Abfertigungsnummer,cast([Abfertigungsdatum] as date)Abfertigungsdatum,Absender,Rechnungsbetrag Betrag ,BelegNr,[FilialenNr],[AbfertigungsNr],Speditionsbuch.Abfertigungsart,Abfertigungsbezeichnung"
|
||||||
|
sqlstr &= " FROM Speditionsbuch INNER JOIN [Abfertigungsarten] ON Speditionsbuch.Abfertigungsart=Abfertigungsarten.Abfertigungsart"
|
||||||
|
sqlstr &= " where EmpfängerKundenNr IN (" & KdNr & ") and Abfertigungsdatum BETWEEN '" & von.ToShortDateString & "' AND '" & bis.ToShortDateString & "' And Speditionsbuch.Abfertigungsart IN (1,29)"
|
||||||
|
|
||||||
|
Dim dt As DataTable = loadDgvBySqlFMZOLL(sqlstr)
|
||||||
|
|
||||||
|
|
||||||
|
Dim sPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Personal) & "\VERAG\SR\"
|
||||||
|
If Not My.Computer.FileSystem.DirectoryExists(sPath) Then
|
||||||
|
My.Computer.FileSystem.CreateDirectory(sPath)
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim Path = ""
|
||||||
|
Dim exclApp As Object 'as Application
|
||||||
|
Dim Datei As Object 'as WorkBook
|
||||||
|
Dim Blatt As Object 'Microsoft.Office.Interop.Excel.Worksheet 'As Object 'as Worksheet
|
||||||
|
exclApp = CreateObject("Excel.Application")
|
||||||
|
|
||||||
|
With exclApp
|
||||||
|
.Visible = False
|
||||||
|
|
||||||
|
Try
|
||||||
|
Path = sPath & "ZF_" & von.ToShortDateString & "-" & bis.ToShortDateString & "" & " .xlsx"
|
||||||
|
While System.IO.File.Exists(Path)
|
||||||
|
Path = sPath & "ZF_" & von.ToShortDateString & "-" & bis.ToShortDateString & "_" & Now.ToString("ddMMyyyyHHmmss") & ".xlsx"
|
||||||
|
End While
|
||||||
|
My.Computer.FileSystem.WriteAllBytes(Path, My.Resources.RG_ZF, False)
|
||||||
|
Catch ex As System.Exception
|
||||||
|
' MsgBox(ex.Message)
|
||||||
|
MsgBox("ERROR 01: " & ex.Message & vbNewLine & ex.StackTrace)
|
||||||
|
|
||||||
|
|
||||||
|
Return ""
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Datei = .Workbooks.Open(Path) 'Anpassen
|
||||||
|
Blatt = Datei.Worksheets(1) 'Anpassen
|
||||||
|
|
||||||
|
Blatt.Range("I1").Value = von.ToShortDateString & "-" & bis.ToShortDateString
|
||||||
|
|
||||||
|
Dim cnt = 3
|
||||||
|
For Each r In dt.Rows
|
||||||
|
Blatt.Range("A" & cnt).Value = cnt - 2
|
||||||
|
Blatt.Range("B" & cnt).Value = r("Abfertigungsnummer")
|
||||||
|
' Blatt.Range("C" & cnt).Value = r("RechnungsNr")
|
||||||
|
Blatt.Range("C" & cnt).Value = r("Abfertigungsdatum")
|
||||||
|
Blatt.Range("D" & cnt).Value = r("Abfertigungsbezeichnung")
|
||||||
|
Blatt.Range("E" & cnt).Value = r("Absender")
|
||||||
|
Blatt.Range("F" & cnt).Value = "" 'r("Betrag")
|
||||||
|
Blatt.Range("H" & cnt).Value = r("BelegNr")
|
||||||
|
|
||||||
|
VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA = "VERAG"
|
||||||
|
|
||||||
|
Dim ZOLLANMELDUNG As New cZollsysteme_Aktenbeschriftung
|
||||||
|
If ZOLLANMELDUNG.getDataByBezugsnummer(r("FilialenNr") & "/" & r("AbfertigungsNr"), r("Abfertigungsart"), "", False) Then
|
||||||
|
Blatt.Range("F" & cnt).Value = ZOLLANMELDUNG.Rechnungspreis
|
||||||
|
Blatt.Range("G" & cnt).Value = ZOLLANMELDUNG.Handelsrechnung.Replace(", ", "," & vbNewLine)
|
||||||
|
Blatt.Range("I" & cnt).Value = ZOLLANMELDUNG.ABGABEN_ZOLL
|
||||||
|
Blatt.Range("J" & cnt).Value = ZOLLANMELDUNG.ANZ_POS
|
||||||
|
End If
|
||||||
|
|
||||||
|
cnt += 1
|
||||||
|
|
||||||
|
Next
|
||||||
|
|
||||||
|
Datei.Save()
|
||||||
|
.DisplayAlerts = False
|
||||||
|
.quit()
|
||||||
|
Try : Datei.close(True) : Catch : End Try
|
||||||
|
End With
|
||||||
|
|
||||||
|
|
||||||
|
'Dim filepath = VERAG_PROG_ALLGEMEIN.cProgramFunctions.genExcelFromDT_NEW(dt,,,,, False, "Report Data_" & KUNDENADR.FullName & "_" & von.ToShortDateString & "-" & bis.ToShortDateString)
|
||||||
|
Dim filepath = Path
|
||||||
|
If filepath = "" Then Return "ERROR 01: Fehler beim Erzeugen des XLS."
|
||||||
|
|
||||||
|
Return filepath
|
||||||
|
Catch ex As System.Exception
|
||||||
|
' MsgBox(ex.Message)
|
||||||
|
Return "ERROR 02: " & ex.Message & vbNewLine & ex.StackTrace
|
||||||
|
End Try
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
Private Sub releaseObject(ByVal obj As Object)
|
Private Sub releaseObject(ByVal obj As Object)
|
||||||
Try
|
Try
|
||||||
System.Runtime.InteropServices.Marshal.ReleaseComObject(obj)
|
System.Runtime.InteropServices.Marshal.ReleaseComObject(obj)
|
||||||
@@ -1417,7 +1557,7 @@ Module Mail
|
|||||||
.Visible = False
|
.Visible = False
|
||||||
Dim filepath = sPath & "CS_Auswertung.xlsx"
|
Dim filepath = sPath & "CS_Auswertung.xlsx"
|
||||||
Try
|
Try
|
||||||
My.Computer.FileSystem.WriteAllBytes(filepath, My.Resources.cs_Aufteilung, False)
|
My.Computer.FileSystem.WriteAllBytes(filepath, My.Resources.CS_Aufteilung, False)
|
||||||
Catch ex As System.Exception
|
Catch ex As System.Exception
|
||||||
' MsgBox(ex.Message)
|
' MsgBox(ex.Message)
|
||||||
Return "ERROR 01: " & ex.Message & vbNewLine & ex.StackTrace
|
Return "ERROR 01: " & ex.Message & vbNewLine & ex.StackTrace
|
||||||
@@ -1563,7 +1703,7 @@ Module Mail
|
|||||||
.Visible = False
|
.Visible = False
|
||||||
Dim filepath = sPath & "\Depot.xlsx"
|
Dim filepath = sPath & "\Depot.xlsx"
|
||||||
Try
|
Try
|
||||||
My.Computer.FileSystem.WriteAllBytes(filepath, My.Resources.depot, False)
|
My.Computer.FileSystem.WriteAllBytes(filepath, My.Resources.Depot, False)
|
||||||
Catch ex As System.Exception
|
Catch ex As System.Exception
|
||||||
' MsgBox(ex.Message)
|
' MsgBox(ex.Message)
|
||||||
Return "ERROR 01: " & ex.Message & vbNewLine & ex.StackTrace
|
Return "ERROR 01: " & ex.Message & vbNewLine & ex.StackTrace
|
||||||
|
|||||||
@@ -128,6 +128,7 @@
|
|||||||
<None Include="Resources\QS_Aufteilung.xlsx">
|
<None Include="Resources\QS_Aufteilung.xlsx">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
<None Include="Resources\RG_ZF.xlsx" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<WCFMetadata Include="Service References\" />
|
<WCFMetadata Include="Service References\" />
|
||||||
@@ -137,6 +138,10 @@
|
|||||||
<Project>{a3b497bd-842c-4a2b-b398-ed1976849df1}</Project>
|
<Project>{a3b497bd-842c-4a2b-b398-ed1976849df1}</Project>
|
||||||
<Name>VERAG_PROG_ALLGEMEIN</Name>
|
<Name>VERAG_PROG_ALLGEMEIN</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\DAKOSY_Worker\DAKOSY_Worker_lib.vbproj">
|
||||||
|
<Project>{50E8E49B-4FD9-4DD4-B159-BDC2B7D0E94F}</Project>
|
||||||
|
<Name>DAKOSY_Worker_lib</Name>
|
||||||
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\UID\ADMIN.vbproj">
|
<ProjectReference Include="..\UID\ADMIN.vbproj">
|
||||||
<Project>{6eb4d3a4-3cf2-4651-9af9-ad5f727df403}</Project>
|
<Project>{6eb4d3a4-3cf2-4651-9af9-ad5f727df403}</Project>
|
||||||
<Name>ADMIN</Name>
|
<Name>ADMIN</Name>
|
||||||
|
|||||||
12
MailSender/My Project/Resources.Designer.vb
generated
12
MailSender/My Project/Resources.Designer.vb
generated
@@ -22,7 +22,7 @@ Namespace My.Resources
|
|||||||
'''<summary>
|
'''<summary>
|
||||||
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||||
'''</summary>
|
'''</summary>
|
||||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0"), _
|
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0"), _
|
||||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||||
@@ -99,5 +99,15 @@ Namespace My.Resources
|
|||||||
Return CType(obj,Byte())
|
Return CType(obj,Byte())
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
'''<summary>
|
||||||
|
''' Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||||
|
'''</summary>
|
||||||
|
Friend ReadOnly Property RG_ZF() As Byte()
|
||||||
|
Get
|
||||||
|
Dim obj As Object = ResourceManager.GetObject("RG_ZF", resourceCulture)
|
||||||
|
Return CType(obj,Byte())
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
End Module
|
End Module
|
||||||
End Namespace
|
End Namespace
|
||||||
|
|||||||
@@ -130,4 +130,7 @@
|
|||||||
<data name="QS_Aufteilung" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="QS_Aufteilung" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\QS_Aufteilung.xlsx;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>..\Resources\QS_Aufteilung.xlsx;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="RG_ZF" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\RG_ZF.xlsx;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -899,7 +899,7 @@ Public Class frmDienstplanVariabel
|
|||||||
Try
|
Try
|
||||||
entryId_TMP = entryId
|
entryId_TMP = entryId
|
||||||
|
|
||||||
Dim row As DataRow = SQLDienst.loadDGV("SELECT dstetr_id, dstma_kuerzel + ' '+ dstetr_info as dstma_kuerzel,dstetr_info,dstma_id, dstetr_von,dstetr_bis,dstetr_art,dstetr_pause,dstetr_datum,dstma_mitId, dstetr_splitschicht FROM tblDienstplanEintraege, tblDienstMitarb, tblMitarbeiter WHERE dstetr_dstmaId=dstma_id AND mit_id=dstma_mitId AND dstetr_id='" & entryId & "'").Rows(0)
|
Dim row As DataRow = SQLDienst.loadDGV("SELECT dstetr_id, dstma_kuerzel + ' '+ dstetr_info as dstma_kuerzel,dstetr_info,dstma_id, dstetr_von,dstetr_bis,dstetr_art,dstetr_pause,dstetr_datum,dstma_mitId, dstetr_splitschicht, dstma_land FROM tblDienstplanEintraege, tblDienstMitarb, tblMitarbeiter WHERE dstetr_dstmaId=dstma_id AND mit_id=dstma_mitId AND dstetr_id='" & entryId & "'").Rows(0)
|
||||||
|
|
||||||
TextBox1.Text = row("dstetr_von").ToString
|
TextBox1.Text = row("dstetr_von").ToString
|
||||||
TextBox2.Text = row("dstetr_bis").ToString
|
TextBox2.Text = row("dstetr_bis").ToString
|
||||||
@@ -909,8 +909,8 @@ Public Class frmDienstplanVariabel
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Dim tatStd As Double = SQLDienst.getDstStunden(row("dstma_id").ToString, row("dstetr_datum").ToString, row("dstetr_datum").ToString, niederlassung)
|
Dim tatStd As Double = SQLDienst.getDstStunden(row("dstma_id").ToString, row("dstetr_datum").ToString, row("dstetr_datum").ToString, niederlassung, row("dstma_land").ToString)
|
||||||
Dim schichtStd As Double = SQLDienst.getDstStunden(row("dstma_id").ToString, row("dstetr_datum").ToString, row("dstetr_datum").ToString, niederlassung, True)
|
Dim schichtStd As Double = SQLDienst.getDstStunden(row("dstma_id").ToString, row("dstetr_datum").ToString, row("dstetr_datum").ToString, niederlassung, row("dstma_land").ToString, True)
|
||||||
|
|
||||||
txtWoStd.Text = tatStd
|
txtWoStd.Text = tatStd
|
||||||
txtSchichtstd.Text = schichtStd
|
txtSchichtstd.Text = schichtStd
|
||||||
@@ -921,7 +921,7 @@ Public Class frmDienstplanVariabel
|
|||||||
|
|
||||||
|
|
||||||
Label32.Text = CDate(row("dstetr_datum")).ToShortDateString
|
Label32.Text = CDate(row("dstetr_datum")).ToShortDateString
|
||||||
lblMAInfo.Text = row("dstma_kuerzel").ToString
|
lblMAInfo.Text = row("dstma_kuerzel").ToString & "(" & row("dstma_id").ToString & ")"
|
||||||
aktMitarbeiterEintrag = row("dstetr_id").ToString
|
aktMitarbeiterEintrag = row("dstetr_id").ToString
|
||||||
|
|
||||||
If row("dstetr_art").ToString.Contains("NACHT") Then Button9.Visible = True
|
If row("dstetr_art").ToString.Contains("NACHT") Then Button9.Visible = True
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ Public Class frmDiestAddMa
|
|||||||
cboLand.Items.Clear()
|
cboLand.Items.Clear()
|
||||||
cboLand.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("AT", "AT"))
|
cboLand.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("AT", "AT"))
|
||||||
cboLand.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("DE", "DE"))
|
cboLand.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("DE", "DE"))
|
||||||
|
cboLand.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("GB", "GB"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -437,7 +437,7 @@ Public Class usrCntlDienstplan
|
|||||||
|
|
||||||
Dim tatStd As Double = 0
|
Dim tatStd As Double = 0
|
||||||
If arbeit Then
|
If arbeit Then
|
||||||
tatStd = SQLDienst.getDstStunden(MA_DST.dstma_id, datum, datum, niederlassung)
|
tatStd = SQLDienst.getDstStunden(MA_DST.dstma_id, datum, datum, niederlassung, MA_DST.dstma_land)
|
||||||
tatStdSum += tatStd
|
tatStdSum += tatStd
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -501,7 +501,7 @@ Public Class usrCntlDienstplan
|
|||||||
|
|
||||||
If groupKW Then
|
If groupKW Then
|
||||||
Dim sollStd As Double = cPF.getWochenstunden(STD_LIST, MA_DST.dstma_wochenStunden, datumMO, SCHICHT, MA_DST.dstma_mitId, MA_DST.dstma_muster, MA_DST.dstma_WEStdRegelAZ, MA_DST.dstma_arbvh, niederlassung, MA_DST.dstma_TzFeiertageStd, MA_DST.dstma_4wo)
|
Dim sollStd As Double = cPF.getWochenstunden(STD_LIST, MA_DST.dstma_wochenStunden, datumMO, SCHICHT, MA_DST.dstma_mitId, MA_DST.dstma_muster, MA_DST.dstma_WEStdRegelAZ, MA_DST.dstma_arbvh, niederlassung, MA_DST.dstma_TzFeiertageStd, MA_DST.dstma_4wo)
|
||||||
Dim tatStd As Double = SQLDienst.getDstStunden(MA_DST.dstma_id, datumMO, datumMO.AddDays(6), niederlassung)
|
Dim tatStd As Double = SQLDienst.getDstStunden(MA_DST.dstma_id, datumMO, datumMO.AddDays(6), niederlassung, MA_DST.dstma_land)
|
||||||
|
|
||||||
rpt.txtSumWoStunden.Text = CDbl(tatStd).ToString("N2")
|
rpt.txtSumWoStunden.Text = CDbl(tatStd).ToString("N2")
|
||||||
rpt.txtWoStd.Text = CDbl(sollStd * -1).ToString("N2")
|
rpt.txtWoStd.Text = CDbl(sollStd * -1).ToString("N2")
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ Public Class usrcntlDienstplanStunden
|
|||||||
Wochenstunden = cPF.getWochenstunden(STD_LIST, Wochenstunden, datum, SCHICHT, r.Cells("dstma_id").Value, ma.dstma_muster, ma.dstma_WEStdRegelAZ, ma.dstma_arbvh, niederlassung, ma.dstma_TzFeiertageStd, ma.dstma_4wo)
|
Wochenstunden = cPF.getWochenstunden(STD_LIST, Wochenstunden, datum, SCHICHT, r.Cells("dstma_id").Value, ma.dstma_muster, ma.dstma_WEStdRegelAZ, ma.dstma_arbvh, niederlassung, ma.dstma_TzFeiertageStd, ma.dstma_4wo)
|
||||||
|
|
||||||
'Hier wird berechnet wie viele Std tastächlich gearbeitet wurden:
|
'Hier wird berechnet wie viele Std tastächlich gearbeitet wurden:
|
||||||
Dim tatStd As Double = SQLDienst.getDstStunden(r.Cells("dstma_id").Value, datum_montag, datum_montag.AddDays(6), niederlassung)
|
Dim tatStd As Double = SQLDienst.getDstStunden(r.Cells("dstma_id").Value, datum_montag, datum_montag.AddDays(6), niederlassung, ma.dstma_land)
|
||||||
|
|
||||||
|
|
||||||
r.Cells("stundenBerechnet").Value = (Wochenstunden)
|
r.Cells("stundenBerechnet").Value = (Wochenstunden)
|
||||||
|
|||||||
43
UID/Mitarbeiter/frmMitarbTimas.Designer.vb
generated
43
UID/Mitarbeiter/frmMitarbTimas.Designer.vb
generated
@@ -43,8 +43,6 @@ Partial Class frmMitarbTimas
|
|||||||
Me.txtInfo = New System.Windows.Forms.TextBox()
|
Me.txtInfo = New System.Windows.Forms.TextBox()
|
||||||
Me.lblInfo = New System.Windows.Forms.Label()
|
Me.lblInfo = New System.Windows.Forms.Label()
|
||||||
Me.lkl = New System.Windows.Forms.LinkLabel()
|
Me.lkl = New System.Windows.Forms.LinkLabel()
|
||||||
Me.Label8 = New System.Windows.Forms.Label()
|
|
||||||
Me.txtPwd = New System.Windows.Forms.TextBox()
|
|
||||||
Me.Label6 = New System.Windows.Forms.Label()
|
Me.Label6 = New System.Windows.Forms.Label()
|
||||||
Me.txtTelNr = New System.Windows.Forms.TextBox()
|
Me.txtTelNr = New System.Windows.Forms.TextBox()
|
||||||
Me.cbxEinsteigsDat = New System.Windows.Forms.CheckBox()
|
Me.cbxEinsteigsDat = New System.Windows.Forms.CheckBox()
|
||||||
@@ -80,6 +78,7 @@ Partial Class frmMitarbTimas
|
|||||||
Me.GroupBox3 = New System.Windows.Forms.GroupBox()
|
Me.GroupBox3 = New System.Windows.Forms.GroupBox()
|
||||||
Me.dgvData = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
|
Me.dgvData = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
|
||||||
Me.TabControl1 = New System.Windows.Forms.TabControl()
|
Me.TabControl1 = New System.Windows.Forms.TabControl()
|
||||||
|
Me.Button1 = New System.Windows.Forms.Button()
|
||||||
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
Me.Panel1.SuspendLayout()
|
Me.Panel1.SuspendLayout()
|
||||||
Me.GroupBox2.SuspendLayout()
|
Me.GroupBox2.SuspendLayout()
|
||||||
@@ -175,6 +174,7 @@ Partial Class frmMitarbTimas
|
|||||||
'
|
'
|
||||||
'GroupBox2
|
'GroupBox2
|
||||||
'
|
'
|
||||||
|
Me.GroupBox2.Controls.Add(Me.Button1)
|
||||||
Me.GroupBox2.Controls.Add(Me.txtLohn)
|
Me.GroupBox2.Controls.Add(Me.txtLohn)
|
||||||
Me.GroupBox2.Controls.Add(Me.lblLohnNr)
|
Me.GroupBox2.Controls.Add(Me.lblLohnNr)
|
||||||
Me.GroupBox2.Controls.Add(Me.cbxAccount)
|
Me.GroupBox2.Controls.Add(Me.cbxAccount)
|
||||||
@@ -185,8 +185,6 @@ Partial Class frmMitarbTimas
|
|||||||
Me.GroupBox2.Controls.Add(Me.txtInfo)
|
Me.GroupBox2.Controls.Add(Me.txtInfo)
|
||||||
Me.GroupBox2.Controls.Add(Me.lblInfo)
|
Me.GroupBox2.Controls.Add(Me.lblInfo)
|
||||||
Me.GroupBox2.Controls.Add(Me.lkl)
|
Me.GroupBox2.Controls.Add(Me.lkl)
|
||||||
Me.GroupBox2.Controls.Add(Me.Label8)
|
|
||||||
Me.GroupBox2.Controls.Add(Me.txtPwd)
|
|
||||||
Me.GroupBox2.Controls.Add(Me.Label6)
|
Me.GroupBox2.Controls.Add(Me.Label6)
|
||||||
Me.GroupBox2.Controls.Add(Me.txtTelNr)
|
Me.GroupBox2.Controls.Add(Me.txtTelNr)
|
||||||
Me.GroupBox2.Controls.Add(Me.cbxEinsteigsDat)
|
Me.GroupBox2.Controls.Add(Me.cbxEinsteigsDat)
|
||||||
@@ -295,36 +293,18 @@ Partial Class frmMitarbTimas
|
|||||||
'
|
'
|
||||||
Me.lkl.AutoSize = True
|
Me.lkl.AutoSize = True
|
||||||
Me.lkl.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
Me.lkl.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
Me.lkl.Location = New System.Drawing.Point(347, 36)
|
Me.lkl.Location = New System.Drawing.Point(266, 55)
|
||||||
Me.lkl.Name = "lkl"
|
Me.lkl.Name = "lkl"
|
||||||
Me.lkl.Size = New System.Drawing.Size(35, 13)
|
Me.lkl.Size = New System.Drawing.Size(35, 13)
|
||||||
Me.lkl.TabIndex = 117
|
Me.lkl.TabIndex = 117
|
||||||
Me.lkl.TabStop = True
|
Me.lkl.TabStop = True
|
||||||
Me.lkl.Text = "Reset"
|
Me.lkl.Text = "Reset"
|
||||||
'
|
'
|
||||||
'Label8
|
|
||||||
'
|
|
||||||
Me.Label8.AutoSize = True
|
|
||||||
Me.Label8.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
|
||||||
Me.Label8.Location = New System.Drawing.Point(206, 55)
|
|
||||||
Me.Label8.Name = "Label8"
|
|
||||||
Me.Label8.Size = New System.Drawing.Size(146, 13)
|
|
||||||
Me.Label8.TabIndex = 114
|
|
||||||
Me.Label8.Text = "(erst bei Doppelklick sichtbar)"
|
|
||||||
'
|
|
||||||
'txtPwd
|
|
||||||
'
|
|
||||||
Me.txtPwd.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
|
||||||
Me.txtPwd.Location = New System.Drawing.Point(204, 52)
|
|
||||||
Me.txtPwd.Name = "txtPwd"
|
|
||||||
Me.txtPwd.Size = New System.Drawing.Size(178, 20)
|
|
||||||
Me.txtPwd.TabIndex = 115
|
|
||||||
'
|
|
||||||
'Label6
|
'Label6
|
||||||
'
|
'
|
||||||
Me.Label6.AutoSize = True
|
Me.Label6.AutoSize = True
|
||||||
Me.Label6.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
Me.Label6.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
Me.Label6.Location = New System.Drawing.Point(202, 36)
|
Me.Label6.Location = New System.Drawing.Point(202, 55)
|
||||||
Me.Label6.Name = "Label6"
|
Me.Label6.Name = "Label6"
|
||||||
Me.Label6.Size = New System.Drawing.Size(53, 13)
|
Me.Label6.Size = New System.Drawing.Size(53, 13)
|
||||||
Me.Label6.TabIndex = 116
|
Me.Label6.TabIndex = 116
|
||||||
@@ -674,6 +654,18 @@ Partial Class frmMitarbTimas
|
|||||||
Me.TabControl1.Size = New System.Drawing.Size(546, 242)
|
Me.TabControl1.Size = New System.Drawing.Size(546, 242)
|
||||||
Me.TabControl1.TabIndex = 123
|
Me.TabControl1.TabIndex = 123
|
||||||
'
|
'
|
||||||
|
'Button1
|
||||||
|
'
|
||||||
|
Me.Button1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
|
||||||
|
Me.Button1.BackColor = System.Drawing.Color.White
|
||||||
|
Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||||
|
Me.Button1.Location = New System.Drawing.Point(418, 15)
|
||||||
|
Me.Button1.Name = "Button1"
|
||||||
|
Me.Button1.Size = New System.Drawing.Size(128, 23)
|
||||||
|
Me.Button1.TabIndex = 88
|
||||||
|
Me.Button1.Text = "aus AVISO laden"
|
||||||
|
Me.Button1.UseVisualStyleBackColor = False
|
||||||
|
'
|
||||||
'frmMitarbTimas
|
'frmMitarbTimas
|
||||||
'
|
'
|
||||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||||
@@ -740,8 +732,6 @@ Partial Class frmMitarbTimas
|
|||||||
Friend WithEvents txtInfo As TextBox
|
Friend WithEvents txtInfo As TextBox
|
||||||
Friend WithEvents lblInfo As Label
|
Friend WithEvents lblInfo As Label
|
||||||
Friend WithEvents lkl As LinkLabel
|
Friend WithEvents lkl As LinkLabel
|
||||||
Friend WithEvents Label8 As Label
|
|
||||||
Friend WithEvents txtPwd As TextBox
|
|
||||||
Friend WithEvents Label6 As Label
|
Friend WithEvents Label6 As Label
|
||||||
Friend WithEvents txtTelNr As TextBox
|
Friend WithEvents txtTelNr As TextBox
|
||||||
Friend WithEvents cbxEinsteigsDat As CheckBox
|
Friend WithEvents cbxEinsteigsDat As CheckBox
|
||||||
@@ -758,4 +748,5 @@ Partial Class frmMitarbTimas
|
|||||||
Private WithEvents GroupBox3 As GroupBox
|
Private WithEvents GroupBox3 As GroupBox
|
||||||
Friend WithEvents TabControl1 As TabControl
|
Friend WithEvents TabControl1 As TabControl
|
||||||
Friend WithEvents dgvData As VERAG_PROG_ALLGEMEIN.MyDatagridview
|
Friend WithEvents dgvData As VERAG_PROG_ALLGEMEIN.MyDatagridview
|
||||||
|
Friend WithEvents Button1 As Button
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ Imports System.IO
|
|||||||
Imports System.Net
|
Imports System.Net
|
||||||
Imports System.Net.Http
|
Imports System.Net.Http
|
||||||
Imports System.Net.WebRequestMethods
|
Imports System.Net.WebRequestMethods
|
||||||
|
Imports System.Security.Cryptography
|
||||||
Imports System.Security.Policy
|
Imports System.Security.Policy
|
||||||
Imports System.Text
|
Imports System.Text
|
||||||
Imports System.Text.RegularExpressions
|
Imports System.Text.RegularExpressions
|
||||||
@@ -20,6 +21,7 @@ Imports VERAG_PROG_ALLGEMEIN
|
|||||||
|
|
||||||
Public Class frmMitarbTimas
|
Public Class frmMitarbTimas
|
||||||
|
|
||||||
|
Private avisoEmp As VERAG_PROG_ALLGEMEIN.cMitarbeiter
|
||||||
Public mid As Integer = -1
|
Public mid As Integer = -1
|
||||||
Public isUpdate As Boolean = False
|
Public isUpdate As Boolean = False
|
||||||
Dim emp As cTimasEmployee
|
Dim emp As cTimasEmployee
|
||||||
@@ -38,11 +40,8 @@ Public Class frmMitarbTimas
|
|||||||
|
|
||||||
Private Sub frmMitarbDetails_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
Private Sub frmMitarbDetails_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||||
|
|
||||||
txtPwd.Visible = False
|
|
||||||
cbxEinsteigsDat.Checked = False
|
cbxEinsteigsDat.Checked = False
|
||||||
cbxGebDat.Checked = False
|
cbxGebDat.Checked = False
|
||||||
|
|
||||||
|
|
||||||
txtGebDat.Format = DateTimePickerFormat.Custom
|
txtGebDat.Format = DateTimePickerFormat.Custom
|
||||||
txtGebDat.CustomFormat = "dd.MM.yyyy"
|
txtGebDat.CustomFormat = "dd.MM.yyyy"
|
||||||
datGekuendigtAm.Format = DateTimePickerFormat.Custom
|
datGekuendigtAm.Format = DateTimePickerFormat.Custom
|
||||||
@@ -58,9 +57,10 @@ Public Class frmMitarbTimas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub initMitarbeiter(Optional _isUpdate As Boolean = True)
|
Private Sub initMitarbeiter(mid As Integer, Optional _isUpdate As Boolean = False)
|
||||||
timas = New cTimasAPI
|
timas = New cTimasAPI
|
||||||
emp = timas.getEmployee(mid)
|
emp = timas.getEmployee(mid)
|
||||||
|
avisoEmp = New VERAG_PROG_ALLGEMEIN.cMitarbeiter(emp.externid)
|
||||||
|
|
||||||
timas.getAllGroups(dtTimas)
|
timas.getAllGroups(dtTimas)
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ Public Class frmMitarbTimas
|
|||||||
txtUsername.Text = emp.login
|
txtUsername.Text = emp.login
|
||||||
txtVname.Text = emp.firstname
|
txtVname.Text = emp.firstname
|
||||||
txtNname.Text = emp.lastname
|
txtNname.Text = emp.lastname
|
||||||
txtPwd.Text = emp.password
|
'txtPwd.Text = emp.password
|
||||||
If emp.gender = "male" Then rbtnGeschlechtM.Checked = True
|
If emp.gender = "male" Then rbtnGeschlechtM.Checked = True
|
||||||
If emp.gender = "female" Then rbtnGeschlechtW.Checked = True
|
If emp.gender = "female" Then rbtnGeschlechtW.Checked = True
|
||||||
|
|
||||||
@@ -137,7 +137,7 @@ Public Class frmMitarbTimas
|
|||||||
Private Sub getMitarbeiter()
|
Private Sub getMitarbeiter()
|
||||||
|
|
||||||
emp.login = txtUsername.Text
|
emp.login = txtUsername.Text
|
||||||
emp.password = txtPwd.Text
|
'emp.password = txtPwd.Text
|
||||||
If rbtnGeschlechtM.Checked Then emp.gender = "male"
|
If rbtnGeschlechtM.Checked Then emp.gender = "male"
|
||||||
If rbtnGeschlechtW.Checked Then emp.gender = "female"
|
If rbtnGeschlechtW.Checked Then emp.gender = "female"
|
||||||
emp.firstname = txtVname.Text
|
emp.firstname = txtVname.Text
|
||||||
@@ -161,7 +161,6 @@ Public Class frmMitarbTimas
|
|||||||
'mitarbeiter.mit_TESTonly = cbxTestaccount.Checked
|
'mitarbeiter.mit_TESTonly = cbxTestaccount.Checked
|
||||||
If checkMandatoryFields() Then
|
If checkMandatoryFields() Then
|
||||||
timas.updateEmployee(emp, dgvData)
|
timas.updateEmployee(emp, dgvData)
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
@@ -169,10 +168,6 @@ Public Class frmMitarbTimas
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Private Sub Label8_Click_1(sender As Object, e As EventArgs)
|
|
||||||
txtPwd.Visible = True
|
|
||||||
Label8.Visible = False
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub btnSave_Click(sender As Object, e As EventArgs)
|
Private Sub btnSave_Click(sender As Object, e As EventArgs)
|
||||||
If txtVname.Text = "" And txtNname.Text = "" Then MsgBox("Bitte geben Sie einen Namen ein!") : Exit Sub
|
If txtVname.Text = "" And txtNname.Text = "" Then MsgBox("Bitte geben Sie einen Namen ein!") : Exit Sub
|
||||||
@@ -208,13 +203,31 @@ Public Class frmMitarbTimas
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub lkl_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles lkl.LinkClicked
|
Private Sub lkl_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles lkl.LinkClicked
|
||||||
If vbYes = MsgBox("Möchten Sie das Kennwort wirklich zurücksetzen? " & vbNewLine & "Der Benutzer wird beim nächsten Login zur Eingabe aufgefordert.", vbYesNoCancel) Then
|
If vbYes = MsgBox("Möchten Sie das Kennwort neu setzen?", vbYesNoCancel) Then
|
||||||
' txtPwd.Text = "0000"
|
If vbYes = MsgBox("Möchten Sie den Kennwort aus AVISO/SQL übernehmen?", vbYesNoCancel) Then
|
||||||
getMitarbeiter()
|
If avisoEmp IsNot Nothing AndAlso avisoEmp.mit_pwd <> "" Then
|
||||||
emp.password = "null"
|
emp.password = avisoEmp.mit_pwd
|
||||||
If checkMandatoryFields() Then
|
If checkMandatoryFields() Then
|
||||||
timas.updateEmployee(emp, Nothing)
|
timas.updateEmployee(emp, Nothing)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
MsgBox("Mitarbeiter-PW konnte konnten nicht aus AVISO geladen werden!")
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
Dim input = InputBox("Neues Passwort:", "Passwort anlegen")
|
||||||
|
If input <> "" Then
|
||||||
|
getMitarbeiter()
|
||||||
|
emp.password = input
|
||||||
|
If checkMandatoryFields() Then
|
||||||
|
timas.updateEmployee(emp, Nothing)
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
MsgBox("Passwort wurde nicht neu vergeben!")
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -312,7 +325,20 @@ Public Class frmMitarbTimas
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
||||||
|
|
||||||
|
If vbYes = MsgBox("Möchten Sie Daten aus AVISO/SQL übernehmen?", vbYesNo) Then
|
||||||
|
If avisoEmp IsNot Nothing AndAlso avisoEmp.mit_username <> "" Then
|
||||||
|
txtUsername.Text = avisoEmp.mit_username
|
||||||
|
If txtInfo.Text = "" Then
|
||||||
|
txtInfo.Text = avisoEmp.mit_firma & " - " & avisoEmp.mit_abteilung
|
||||||
|
End If
|
||||||
|
cbxAccount.Checked = True
|
||||||
|
getMitarbeiter()
|
||||||
|
Else
|
||||||
|
MsgBox("Mitarbeiterdaten konnten nicht aus AVISO geladen werden!")
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|||||||
@@ -1090,7 +1090,7 @@ Public Class cProgramFunctions
|
|||||||
' MsgBox(Wochenstunden)
|
' MsgBox(Wochenstunden)
|
||||||
|
|
||||||
Wochenstunden = cPF.getWochenstunden(STD_LIST, Wochenstunden, datum, SCHICHT, r("dstma_id"), ma.dstma_muster, ma.dstma_WEStdRegelAZ, ma.dstma_arbvh, niederlassung, ma.dstma_TzFeiertageStd, ma.dstma_4wo)
|
Wochenstunden = cPF.getWochenstunden(STD_LIST, Wochenstunden, datum, SCHICHT, r("dstma_id"), ma.dstma_muster, ma.dstma_WEStdRegelAZ, ma.dstma_arbvh, niederlassung, ma.dstma_TzFeiertageStd, ma.dstma_4wo)
|
||||||
Dim tatStd As Double = SQLDienst.getDstStunden(r("dstma_id"), datum_montag, datum_montag.AddDays(6), niederlassung)
|
Dim tatStd As Double = SQLDienst.getDstStunden(r("dstma_id"), datum_montag, datum_montag.AddDays(6), niederlassung, ma.dstma_land)
|
||||||
|
|
||||||
' : ANDERES ERG"""""!!!!!!!!!!!!!!!!!!!!
|
' : ANDERES ERG"""""!!!!!!!!!!!!!!!!!!!!
|
||||||
' Wochenstunden = cPF.getWochenstunden(Wochenstunden, datum, SCHICHT, r.Cells("dstma_id").Value, ma.dstma_muster, ma.dstma_WEStdRegelAZ, ma.dstma_arbvh, niederlassung)
|
' Wochenstunden = cPF.getWochenstunden(Wochenstunden, datum, SCHICHT, r.Cells("dstma_id").Value, ma.dstma_muster, ma.dstma_WEStdRegelAZ, ma.dstma_arbvh, niederlassung)
|
||||||
|
|||||||
@@ -4084,7 +4084,7 @@ Public Class cDienstplan
|
|||||||
Return False
|
Return False
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function getDstStunden(maId As Integer, datum_von As Date, datum_bis As Date, niederlassung As String, Optional onlySplitschichten As Boolean = False) As Double
|
Public Function getDstStunden(maId As Integer, datum_von As Date, datum_bis As Date, niederlassung As String, Optional land As String = "", Optional onlySplitschichten As Boolean = False) As Double
|
||||||
Try
|
Try
|
||||||
Dim stunden As Double
|
Dim stunden As Double
|
||||||
Dim rgx As New Regex("^\d{2}:\d{2}$")
|
Dim rgx As New Regex("^\d{2}:\d{2}$")
|
||||||
@@ -4137,12 +4137,12 @@ Public Class cDienstplan
|
|||||||
|
|
||||||
'End If
|
'End If
|
||||||
If cPF.isValidTime(von) And cPF.isValidTime(bis) Then ' Wenn Format stimmt
|
If cPF.isValidTime(von) And cPF.isValidTime(bis) Then ' Wenn Format stimmt
|
||||||
s += cPF.getDiff(von, bis, niederlassung, (FT.isFeiertag(datum, cDienstSettings.getLand(niederlassung)) Or woTag = "SO"))
|
s += cPF.getDiff(von, bis, niederlassung, (FT.isFeiertag(datum, IIf(land <> "", land, cDienstSettings.getLand(niederlassung))) Or woTag = "SO"))
|
||||||
If IsNumeric(dr.Item("dstetr_pause")) Then
|
If IsNumeric(dr.Item("dstetr_pause")) Then
|
||||||
s -= CDbl(dr.Item("dstetr_pause"))
|
s -= CDbl(dr.Item("dstetr_pause"))
|
||||||
|
|
||||||
'Wenn Feiertag oder Sonntag, werden die Stunden (von-bis) doppelt gerechent, also müssen die Pausenstunden doppelt abgezoben werden:
|
'Wenn Feiertag oder Sonntag, werden die Stunden (von-bis) doppelt gerechent, also müssen die Pausenstunden doppelt abgezoben werden:
|
||||||
If (FT.isFeiertag(datum, cDienstSettings.getLand(niederlassung)) Or woTag = "SO") Then s -= CDbl(dr.Item("dstetr_pause"))
|
If (FT.isFeiertag(datum, IIf(land <> "", land, cDienstSettings.getLand(niederlassung))) Or woTag = "SO") Then s -= CDbl(dr.Item("dstetr_pause"))
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
Private Sub frmERS_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
Private Sub frmERS_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||||
|
|
||||||
lblProgramm.Text = progId & " - " & progName & IIf(progVersion <> "", " (" & progVersion & ")", "")
|
lblProgramm.Text = progId & " - " & progName & IIf(progVersion <> "", " (" & progVersion & ")", "")
|
||||||
lblFirma.Text = firma
|
lblFirma.Text = IIf(firma IsNot DBNull.Value, firma, "")
|
||||||
txtUser.Text = maId & " " & userName
|
txtUser.Text = maId & " " & userName
|
||||||
txtType.Text = type
|
txtType.Text = type
|
||||||
txtMethode.Text = errMethodName
|
txtMethode.Text = errMethodName
|
||||||
|
|||||||
26
UID/usrCntlAPI.Designer.vb
generated
26
UID/usrCntlAPI.Designer.vb
generated
@@ -26,6 +26,7 @@ Partial Class usrCntlAPI
|
|||||||
Me.SplitContainer = New System.Windows.Forms.SplitContainer()
|
Me.SplitContainer = New System.Windows.Forms.SplitContainer()
|
||||||
Me.pnlSearch = New System.Windows.Forms.Panel()
|
Me.pnlSearch = New System.Windows.Forms.Panel()
|
||||||
Me.SplitContainer1 = New System.Windows.Forms.SplitContainer()
|
Me.SplitContainer1 = New System.Windows.Forms.SplitContainer()
|
||||||
|
Me.Button1 = New System.Windows.Forms.Button()
|
||||||
Me.Label11 = New System.Windows.Forms.Label()
|
Me.Label11 = New System.Windows.Forms.Label()
|
||||||
Me.txtZollBelegNr = New VERAG_PROG_ALLGEMEIN.MyTextBox()
|
Me.txtZollBelegNr = New VERAG_PROG_ALLGEMEIN.MyTextBox()
|
||||||
Me.Label10 = New System.Windows.Forms.Label()
|
Me.Label10 = New System.Windows.Forms.Label()
|
||||||
@@ -79,7 +80,6 @@ Partial Class usrCntlAPI
|
|||||||
Me.Panel3 = New System.Windows.Forms.Panel()
|
Me.Panel3 = New System.Windows.Forms.Panel()
|
||||||
Me.Button10 = New System.Windows.Forms.Button()
|
Me.Button10 = New System.Windows.Forms.Button()
|
||||||
Me.Button11 = New System.Windows.Forms.Button()
|
Me.Button11 = New System.Windows.Forms.Button()
|
||||||
Me.Button1 = New System.Windows.Forms.Button()
|
|
||||||
CType(Me.SplitContainer, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.SplitContainer, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
Me.SplitContainer.Panel1.SuspendLayout()
|
Me.SplitContainer.Panel1.SuspendLayout()
|
||||||
Me.SplitContainer.Panel2.SuspendLayout()
|
Me.SplitContainer.Panel2.SuspendLayout()
|
||||||
@@ -184,6 +184,18 @@ Partial Class usrCntlAPI
|
|||||||
Me.SplitContainer1.SplitterDistance = 125
|
Me.SplitContainer1.SplitterDistance = 125
|
||||||
Me.SplitContainer1.TabIndex = 0
|
Me.SplitContainer1.TabIndex = 0
|
||||||
'
|
'
|
||||||
|
'Button1
|
||||||
|
'
|
||||||
|
Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||||
|
Me.Button1.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
|
Me.Button1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
|
||||||
|
Me.Button1.Location = New System.Drawing.Point(850, 122)
|
||||||
|
Me.Button1.Name = "Button1"
|
||||||
|
Me.Button1.Size = New System.Drawing.Size(162, 52)
|
||||||
|
Me.Button1.TabIndex = 53
|
||||||
|
Me.Button1.Text = "API Verwaltung"
|
||||||
|
Me.Button1.UseVisualStyleBackColor = True
|
||||||
|
'
|
||||||
'Label11
|
'Label11
|
||||||
'
|
'
|
||||||
Me.Label11.AutoSize = True
|
Me.Label11.AutoSize = True
|
||||||
@@ -945,18 +957,6 @@ Partial Class usrCntlAPI
|
|||||||
Me.Button11.TabIndex = 4
|
Me.Button11.TabIndex = 4
|
||||||
Me.Button11.UseVisualStyleBackColor = True
|
Me.Button11.UseVisualStyleBackColor = True
|
||||||
'
|
'
|
||||||
'Button1
|
|
||||||
'
|
|
||||||
Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
|
||||||
Me.Button1.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
|
||||||
Me.Button1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
|
|
||||||
Me.Button1.Location = New System.Drawing.Point(850, 122)
|
|
||||||
Me.Button1.Name = "Button1"
|
|
||||||
Me.Button1.Size = New System.Drawing.Size(162, 52)
|
|
||||||
Me.Button1.TabIndex = 53
|
|
||||||
Me.Button1.Text = "API Verwaltung"
|
|
||||||
Me.Button1.UseVisualStyleBackColor = True
|
|
||||||
'
|
|
||||||
'usrCntlAPI
|
'usrCntlAPI
|
||||||
'
|
'
|
||||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||||
|
|||||||
@@ -267,4 +267,18 @@ Public Class usrCntlAPI
|
|||||||
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
|
||||||
|
srcTAG = srcTAG.AddDays(-1)
|
||||||
|
initBtns("Tag")
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
|
||||||
|
srcTAG = srcTAG.AddDays(1)
|
||||||
|
initBtns("Tag")
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
|
||||||
|
initBtns("Tag")
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
80
UID/usrCntlERS.Designer.vb
generated
80
UID/usrCntlERS.Designer.vb
generated
@@ -26,6 +26,9 @@ Partial Class usrCntlERS
|
|||||||
Me.SplitContainer = New System.Windows.Forms.SplitContainer()
|
Me.SplitContainer = New System.Windows.Forms.SplitContainer()
|
||||||
Me.pnlSearch = New System.Windows.Forms.Panel()
|
Me.pnlSearch = New System.Windows.Forms.Panel()
|
||||||
Me.SplitContainer1 = New System.Windows.Forms.SplitContainer()
|
Me.SplitContainer1 = New System.Windows.Forms.SplitContainer()
|
||||||
|
Me.txtFehlersuche = New VERAG_PROG_ALLGEMEIN.MyTextBox()
|
||||||
|
Me.Label2 = New System.Windows.Forms.Label()
|
||||||
|
Me.cbxTestSys = New System.Windows.Forms.CheckBox()
|
||||||
Me.Label9 = New System.Windows.Forms.Label()
|
Me.Label9 = New System.Windows.Forms.Label()
|
||||||
Me.txtUser = New VERAG_PROG_ALLGEMEIN.KdSearchBox()
|
Me.txtUser = New VERAG_PROG_ALLGEMEIN.KdSearchBox()
|
||||||
Me.cboType = New VERAG_PROG_ALLGEMEIN.MyComboBox()
|
Me.cboType = New VERAG_PROG_ALLGEMEIN.MyComboBox()
|
||||||
@@ -61,7 +64,6 @@ Partial Class usrCntlERS
|
|||||||
Me.Panel3 = New System.Windows.Forms.Panel()
|
Me.Panel3 = New System.Windows.Forms.Panel()
|
||||||
Me.Button10 = New System.Windows.Forms.Button()
|
Me.Button10 = New System.Windows.Forms.Button()
|
||||||
Me.Button11 = New System.Windows.Forms.Button()
|
Me.Button11 = New System.Windows.Forms.Button()
|
||||||
Me.cbxTestSys = New System.Windows.Forms.CheckBox()
|
|
||||||
CType(Me.SplitContainer, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.SplitContainer, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
Me.SplitContainer.Panel1.SuspendLayout()
|
Me.SplitContainer.Panel1.SuspendLayout()
|
||||||
Me.SplitContainer.Panel2.SuspendLayout()
|
Me.SplitContainer.Panel2.SuspendLayout()
|
||||||
@@ -117,6 +119,8 @@ Partial Class usrCntlERS
|
|||||||
'
|
'
|
||||||
'SplitContainer1.Panel1
|
'SplitContainer1.Panel1
|
||||||
'
|
'
|
||||||
|
Me.SplitContainer1.Panel1.Controls.Add(Me.txtFehlersuche)
|
||||||
|
Me.SplitContainer1.Panel1.Controls.Add(Me.Label2)
|
||||||
Me.SplitContainer1.Panel1.Controls.Add(Me.cbxTestSys)
|
Me.SplitContainer1.Panel1.Controls.Add(Me.cbxTestSys)
|
||||||
Me.SplitContainer1.Panel1.Controls.Add(Me.Label9)
|
Me.SplitContainer1.Panel1.Controls.Add(Me.Label9)
|
||||||
Me.SplitContainer1.Panel1.Controls.Add(Me.txtUser)
|
Me.SplitContainer1.Panel1.Controls.Add(Me.txtUser)
|
||||||
@@ -148,10 +152,56 @@ Partial Class usrCntlERS
|
|||||||
Me.SplitContainer1.SplitterDistance = 125
|
Me.SplitContainer1.SplitterDistance = 125
|
||||||
Me.SplitContainer1.TabIndex = 0
|
Me.SplitContainer1.TabIndex = 0
|
||||||
'
|
'
|
||||||
|
'txtFehlersuche
|
||||||
|
'
|
||||||
|
Me.txtFehlersuche._DateTimeOnly = False
|
||||||
|
Me.txtFehlersuche._numbersOnly = False
|
||||||
|
Me.txtFehlersuche._numbersOnlyKommastellen = ""
|
||||||
|
Me.txtFehlersuche._numbersOnlyTrennzeichen = True
|
||||||
|
Me.txtFehlersuche._Prozent = False
|
||||||
|
Me.txtFehlersuche._ShortDateNew = False
|
||||||
|
Me.txtFehlersuche._ShortDateOnly = False
|
||||||
|
Me.txtFehlersuche._TimeOnly = False
|
||||||
|
Me.txtFehlersuche._TimeOnly_Seconds = False
|
||||||
|
Me.txtFehlersuche._value = ""
|
||||||
|
Me.txtFehlersuche._Waehrung = False
|
||||||
|
Me.txtFehlersuche._WaehrungZeichen = True
|
||||||
|
Me.txtFehlersuche.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.txtFehlersuche.Location = New System.Drawing.Point(532, 79)
|
||||||
|
Me.txtFehlersuche.MaxLineLength = -1
|
||||||
|
Me.txtFehlersuche.MaxLines_Warning = ""
|
||||||
|
Me.txtFehlersuche.MaxLines_Warning_Label = Nothing
|
||||||
|
Me.txtFehlersuche.Name = "txtFehlersuche"
|
||||||
|
Me.txtFehlersuche.Size = New System.Drawing.Size(217, 20)
|
||||||
|
Me.txtFehlersuche.TabIndex = 52
|
||||||
|
'
|
||||||
|
'Label2
|
||||||
|
'
|
||||||
|
Me.Label2.AutoSize = True
|
||||||
|
Me.Label2.Location = New System.Drawing.Point(449, 83)
|
||||||
|
Me.Label2.Name = "Label2"
|
||||||
|
Me.Label2.Size = New System.Drawing.Size(72, 13)
|
||||||
|
Me.Label2.TabIndex = 51
|
||||||
|
Me.Label2.Text = "Fehlersuche*:"
|
||||||
|
'
|
||||||
|
'cbxTestSys
|
||||||
|
'
|
||||||
|
Me.cbxTestSys.AutoSize = True
|
||||||
|
Me.cbxTestSys.BackColor = System.Drawing.Color.White
|
||||||
|
Me.cbxTestSys.Checked = True
|
||||||
|
Me.cbxTestSys.CheckState = System.Windows.Forms.CheckState.Indeterminate
|
||||||
|
Me.cbxTestSys.Location = New System.Drawing.Point(487, 3)
|
||||||
|
Me.cbxTestSys.Name = "cbxTestSys"
|
||||||
|
Me.cbxTestSys.Size = New System.Drawing.Size(79, 17)
|
||||||
|
Me.cbxTestSys.TabIndex = 50
|
||||||
|
Me.cbxTestSys.Text = "Testsystem"
|
||||||
|
Me.cbxTestSys.ThreeState = True
|
||||||
|
Me.cbxTestSys.UseVisualStyleBackColor = False
|
||||||
|
'
|
||||||
'Label9
|
'Label9
|
||||||
'
|
'
|
||||||
Me.Label9.AutoSize = True
|
Me.Label9.AutoSize = True
|
||||||
Me.Label9.Location = New System.Drawing.Point(330, 62)
|
Me.Label9.Location = New System.Drawing.Point(449, 39)
|
||||||
Me.Label9.Name = "Label9"
|
Me.Label9.Name = "Label9"
|
||||||
Me.Label9.Size = New System.Drawing.Size(32, 13)
|
Me.Label9.Size = New System.Drawing.Size(32, 13)
|
||||||
Me.Label9.TabIndex = 47
|
Me.Label9.TabIndex = 47
|
||||||
@@ -176,7 +226,7 @@ Partial Class usrCntlERS
|
|||||||
Me.txtUser.KdNr = "-1"
|
Me.txtUser.KdNr = "-1"
|
||||||
Me.txtUser.kdNrField = Nothing
|
Me.txtUser.kdNrField = Nothing
|
||||||
Me.txtUser.KdNrNullInt = Nothing
|
Me.txtUser.KdNrNullInt = Nothing
|
||||||
Me.txtUser.Location = New System.Drawing.Point(368, 58)
|
Me.txtUser.Location = New System.Drawing.Point(532, 35)
|
||||||
Me.txtUser.Name = "txtUser"
|
Me.txtUser.Name = "txtUser"
|
||||||
Me.txtUser.nurAktive = False
|
Me.txtUser.nurAktive = False
|
||||||
Me.txtUser.searchActive = True
|
Me.txtUser.searchActive = True
|
||||||
@@ -193,7 +243,7 @@ Partial Class usrCntlERS
|
|||||||
Me.cboType.DropDownWidth = 250
|
Me.cboType.DropDownWidth = 250
|
||||||
Me.cboType.Font = New System.Drawing.Font("Microsoft Tai Le", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
Me.cboType.Font = New System.Drawing.Font("Microsoft Tai Le", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
Me.cboType.FormattingEnabled = True
|
Me.cboType.FormattingEnabled = True
|
||||||
Me.cboType.Location = New System.Drawing.Point(451, 30)
|
Me.cboType.Location = New System.Drawing.Point(333, 79)
|
||||||
Me.cboType.Name = "cboType"
|
Me.cboType.Name = "cboType"
|
||||||
Me.cboType.Size = New System.Drawing.Size(105, 22)
|
Me.cboType.Size = New System.Drawing.Size(105, 22)
|
||||||
Me.cboType.TabIndex = 42
|
Me.cboType.TabIndex = 42
|
||||||
@@ -202,7 +252,7 @@ Partial Class usrCntlERS
|
|||||||
'
|
'
|
||||||
Me.Label6.AutoSize = True
|
Me.Label6.AutoSize = True
|
||||||
Me.Label6.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
Me.Label6.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
Me.Label6.Location = New System.Drawing.Point(448, 12)
|
Me.Label6.Location = New System.Drawing.Point(330, 61)
|
||||||
Me.Label6.Name = "Label6"
|
Me.Label6.Name = "Label6"
|
||||||
Me.Label6.Size = New System.Drawing.Size(35, 13)
|
Me.Label6.Size = New System.Drawing.Size(35, 13)
|
||||||
Me.Label6.TabIndex = 41
|
Me.Label6.TabIndex = 41
|
||||||
@@ -462,7 +512,7 @@ Partial Class usrCntlERS
|
|||||||
Me.cboFirma.DropDownWidth = 250
|
Me.cboFirma.DropDownWidth = 250
|
||||||
Me.cboFirma.Font = New System.Drawing.Font("Microsoft Tai Le", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
Me.cboFirma.Font = New System.Drawing.Font("Microsoft Tai Le", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
Me.cboFirma.FormattingEnabled = True
|
Me.cboFirma.FormattingEnabled = True
|
||||||
Me.cboFirma.Location = New System.Drawing.Point(575, 26)
|
Me.cboFirma.Location = New System.Drawing.Point(334, 124)
|
||||||
Me.cboFirma.Name = "cboFirma"
|
Me.cboFirma.Name = "cboFirma"
|
||||||
Me.cboFirma.Size = New System.Drawing.Size(104, 22)
|
Me.cboFirma.Size = New System.Drawing.Size(104, 22)
|
||||||
Me.cboFirma.TabIndex = 20
|
Me.cboFirma.TabIndex = 20
|
||||||
@@ -471,7 +521,7 @@ Partial Class usrCntlERS
|
|||||||
'
|
'
|
||||||
Me.Label1.AutoSize = True
|
Me.Label1.AutoSize = True
|
||||||
Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
Me.Label1.Location = New System.Drawing.Point(572, 8)
|
Me.Label1.Location = New System.Drawing.Point(331, 106)
|
||||||
Me.Label1.Name = "Label1"
|
Me.Label1.Name = "Label1"
|
||||||
Me.Label1.Size = New System.Drawing.Size(37, 13)
|
Me.Label1.Size = New System.Drawing.Size(37, 13)
|
||||||
Me.Label1.TabIndex = 6
|
Me.Label1.TabIndex = 6
|
||||||
@@ -633,20 +683,6 @@ Partial Class usrCntlERS
|
|||||||
Me.Button11.TabIndex = 4
|
Me.Button11.TabIndex = 4
|
||||||
Me.Button11.UseVisualStyleBackColor = True
|
Me.Button11.UseVisualStyleBackColor = True
|
||||||
'
|
'
|
||||||
'cbxTestSys
|
|
||||||
'
|
|
||||||
Me.cbxTestSys.AutoSize = True
|
|
||||||
Me.cbxTestSys.BackColor = System.Drawing.Color.White
|
|
||||||
Me.cbxTestSys.Checked = True
|
|
||||||
Me.cbxTestSys.CheckState = System.Windows.Forms.CheckState.Indeterminate
|
|
||||||
Me.cbxTestSys.Location = New System.Drawing.Point(530, 64)
|
|
||||||
Me.cbxTestSys.Name = "cbxTestSys"
|
|
||||||
Me.cbxTestSys.Size = New System.Drawing.Size(79, 17)
|
|
||||||
Me.cbxTestSys.TabIndex = 50
|
|
||||||
Me.cbxTestSys.Text = "Testsystem"
|
|
||||||
Me.cbxTestSys.ThreeState = True
|
|
||||||
Me.cbxTestSys.UseVisualStyleBackColor = False
|
|
||||||
'
|
|
||||||
'usrCntlERS
|
'usrCntlERS
|
||||||
'
|
'
|
||||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||||
@@ -711,4 +747,6 @@ Partial Class usrCntlERS
|
|||||||
Friend WithEvents txtUser As VERAG_PROG_ALLGEMEIN.KdSearchBox
|
Friend WithEvents txtUser As VERAG_PROG_ALLGEMEIN.KdSearchBox
|
||||||
Friend WithEvents lblErgebnis As Label
|
Friend WithEvents lblErgebnis As Label
|
||||||
Friend WithEvents cbxTestSys As CheckBox
|
Friend WithEvents cbxTestSys As CheckBox
|
||||||
|
Friend WithEvents Label2 As Label
|
||||||
|
Friend WithEvents txtFehlersuche As VERAG_PROG_ALLGEMEIN.MyTextBox
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ Public Class usrCntlERS
|
|||||||
|
|
||||||
txtUser.initKdBox(Me.FindForm) ' initKdAbsender()
|
txtUser.initKdBox(Me.FindForm) ' initKdAbsender()
|
||||||
|
|
||||||
cboFirma.fillWithSQL("SELECT [Firma_Bez] FROM [tblFirma] ", False, "FMZOLL", True)
|
cboFirma.fillWithSQL("SELECT distinct(isnull(ers_Firma,'')) FROM [tblERS] ", False, "ADMIN", True)
|
||||||
|
|
||||||
cboDatum.Items.Clear()
|
cboDatum.Items.Clear()
|
||||||
cboDatum.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Error-Datum", "EDat"))
|
cboDatum.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Error-Datum", "EDat"))
|
||||||
@@ -121,7 +121,7 @@ Public Class usrCntlERS
|
|||||||
|
|
||||||
Dim sqlstr As String = ""
|
Dim sqlstr As String = ""
|
||||||
Dim TopMax = If(IsNumeric(txtMaxSrch.Text), " TOP " & txtMaxSrch.Text, "")
|
Dim TopMax = If(IsNumeric(txtMaxSrch.Text), " TOP " & txtMaxSrch.Text, "")
|
||||||
sqlstr &= "SELECT " & TopMax & " [ers_id],[ers_progId],[ers_progName],[ers_progVersion],[ers_datetime],[ers_Testsystem],[ers_Type],[ers_EMail],[ers_maId],[ers_userName],[ers_Firma],[ers_errCode],[ers_errStack],[ers_errMessage],[ers_errMethodName],[ers_infotext]
|
sqlstr &= "SELECT " & TopMax & " [ers_id],[ers_progId],[ers_progName],[ers_progVersion],[ers_datetime],[ers_errCode],[ers_errStack],[ers_errMessage],[ers_errMethodName],[ers_Testsystem],[ers_Type],[ers_EMail],[ers_maId],[ers_userName],[ers_Firma],[ers_infotext]
|
||||||
FROM [tblERS] WHERE 1=1 "
|
FROM [tblERS] WHERE 1=1 "
|
||||||
|
|
||||||
With DataGridView
|
With DataGridView
|
||||||
@@ -175,13 +175,11 @@ Public Class usrCntlERS
|
|||||||
'.Columns("RechnungAn").HeaderText = "Rechnung an"
|
'.Columns("RechnungAn").HeaderText = "Rechnung an"
|
||||||
'.Columns("RechnungAn").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
|
'.Columns("RechnungAn").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
|
||||||
|
|
||||||
''.Columns("Absender").MinimumWidth = 150
|
.Columns("ers_errStack").MinimumWidth = 150
|
||||||
''.Columns("Absender").HeaderText = "Absender"
|
.Columns("ers_errStack").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
|
||||||
''.Columns("Absender").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
|
|
||||||
|
|
||||||
'.Columns("Vermittler").MinimumWidth = 150
|
.Columns("ers_errMessage").MinimumWidth = 150
|
||||||
'.Columns("Vermittler").HeaderText = "Auftraggeber"
|
.Columns("ers_errMessage").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
|
||||||
'.Columns("Vermittler").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
|
|
||||||
|
|
||||||
''.Columns("Empfänger").MinimumWidth = 150
|
''.Columns("Empfänger").MinimumWidth = 150
|
||||||
''.Columns("Empfänger").HeaderText = "Empfänger"
|
''.Columns("Empfänger").HeaderText = "Empfänger"
|
||||||
@@ -226,6 +224,10 @@ Public Class usrCntlERS
|
|||||||
sqlstr &= " AND [ers_Testsystem] = @ersTestsystem "
|
sqlstr &= " AND [ers_Testsystem] = @ersTestsystem "
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If txtFehlersuche.Text <> "" Then
|
||||||
|
sqlstr &= " AND ([ers_errStack] like '" & txtFehlersuche.Text.Replace("*", "%") & "' Or [ers_errMessage] like '" & txtFehlersuche.Text.Replace("*", "%") & "' OR [ers_errMethodName] like '" & txtFehlersuche.Text.Replace("*", "%") & "') "
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
Return sqlstr
|
Return sqlstr
|
||||||
End Function
|
End Function
|
||||||
@@ -270,4 +272,27 @@ Public Class usrCntlERS
|
|||||||
sender.RELOAD()
|
sender.RELOAD()
|
||||||
Me.Cursor = Cursors.Default
|
Me.Cursor = Cursors.Default
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub txtFehlersuche_KeyDown(sender As Object, e As KeyEventArgs) Handles txtFehlersuche.KeyDown
|
||||||
|
If e.KeyCode = Keys.Enter Then
|
||||||
|
|
||||||
|
Me.btnSuche_Click(sender, e)
|
||||||
|
e.Handled = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
|
||||||
|
srcTAG = srcTAG.AddDays(-1)
|
||||||
|
initBtns("Tag")
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
|
||||||
|
srcTAG = srcTAG.AddDays(1)
|
||||||
|
initBtns("Tag")
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
|
||||||
|
initBtns("Tag")
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -1,13 +1,18 @@
|
|||||||
Imports System.Data.SqlClient
|
Imports System.Data.SqlClient
|
||||||
|
Imports System.Data.SqlTypes
|
||||||
|
Imports System.Diagnostics.Eventing
|
||||||
Imports System.IO
|
Imports System.IO
|
||||||
Imports System.Reflection
|
Imports System.Reflection
|
||||||
Imports System.Security.Cryptography
|
Imports System.Security.Cryptography
|
||||||
Imports com.itextpdf.text.pdf
|
Imports com.itextpdf.text.pdf
|
||||||
Imports DocumentFormat.OpenXml.VariantTypes
|
Imports DocumentFormat.OpenXml.VariantTypes
|
||||||
Imports RoutineManager.cAsfinag
|
Imports RoutineManager.cAsfinag
|
||||||
|
Imports VERAG_PROG_ALLGEMEIN
|
||||||
|
|
||||||
Public Class cAsfinag
|
Public Class cAsfinag
|
||||||
|
|
||||||
|
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
||||||
|
|
||||||
Public Class CLFHeader
|
Public Class CLFHeader
|
||||||
|
|
||||||
Property PKFileName As Object = Nothing
|
Property PKFileName As Object = Nothing
|
||||||
@@ -154,6 +159,10 @@ Public Class cAsfinag
|
|||||||
Property status As Object = Nothing
|
Property status As Object = Nothing
|
||||||
Property contractDate As Object = Nothing
|
Property contractDate As Object = Nothing
|
||||||
Property PKLine As Long
|
Property PKLine As Long
|
||||||
|
Property engineCharacteristics As Integer
|
||||||
|
Property CO2EmissionsClass As Integer
|
||||||
|
Property contractType As Integer
|
||||||
|
|
||||||
|
|
||||||
Public hasEntry = False
|
Public hasEntry = False
|
||||||
|
|
||||||
@@ -180,7 +189,9 @@ Public Class cAsfinag
|
|||||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("emissionCategory", emissionCategory))
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("emissionCategory", emissionCategory))
|
||||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("status", status))
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("status", status))
|
||||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("contractDate", contractDate))
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("contractDate", contractDate))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("engineCharacteristics", engineCharacteristics))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("CO2EmissionsClass", CO2EmissionsClass))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("contractType", contractType))
|
||||||
|
|
||||||
Return list
|
Return list
|
||||||
End Function
|
End Function
|
||||||
@@ -272,6 +283,148 @@ Public Class cAsfinag
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End Class
|
||||||
|
|
||||||
|
Public Class CLFArchiv
|
||||||
|
|
||||||
|
Property PKFileName As Object = Nothing
|
||||||
|
Property RecordType As String
|
||||||
|
Property fileVersion As Integer
|
||||||
|
Property fileNumber As Integer
|
||||||
|
Property cardNumber As String
|
||||||
|
Property validTo As Integer
|
||||||
|
Property OBUID As Object = Nothing
|
||||||
|
Property vehicleLicensePlate As Object = Nothing
|
||||||
|
Property nationality As Object = Nothing
|
||||||
|
Property vehicleCategory As Object = Nothing
|
||||||
|
Property emissionCategory As Object = Nothing
|
||||||
|
Property status As Object = Nothing
|
||||||
|
Property contractDate As Object = Nothing
|
||||||
|
Property PKLine As Long
|
||||||
|
Property engineCharacteristics As Integer
|
||||||
|
Property CO2EmissionsClass As Integer
|
||||||
|
Property contractType As Integer
|
||||||
|
|
||||||
|
|
||||||
|
Public hasEntry = False
|
||||||
|
|
||||||
|
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
||||||
|
|
||||||
|
Sub New(PKFileName, OBUID)
|
||||||
|
Me.PKFileName = PKFileName
|
||||||
|
Me.OBUID = OBUID
|
||||||
|
LOAD()
|
||||||
|
End Sub
|
||||||
|
Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
|
||||||
|
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("PKFileName", PKFileName))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("PKLine", PKLine))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("RecordType", RecordType))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("fileVersion", fileVersion))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("fileNumber", fileNumber))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("cardNumber", cardNumber))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("validTo", validTo))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("OBUID", OBUID))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("vehicleLicensePlate", vehicleLicensePlate))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("nationality", nationality))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("vehicleCategory", vehicleCategory))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("emissionCategory", emissionCategory))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("status", status))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("contractDate", contractDate))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("engineCharacteristics", engineCharacteristics))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("CO2EmissionsClass", CO2EmissionsClass))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("contractType", contractType))
|
||||||
|
|
||||||
|
Return list
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function SAVE() As Boolean
|
||||||
|
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
||||||
|
|
||||||
|
Dim sqlstr = " BEGIN TRAN If EXISTS(Select * FROM CLFArchiv WHERE PKFileName=@PKFileName AND OBUID = @OBUID) " &
|
||||||
|
" BEGIN " & getUpdateCmd() & " End " &
|
||||||
|
" Else " &
|
||||||
|
" BEGIN " & getInsertCmd() & " End " &
|
||||||
|
" commit tran "
|
||||||
|
|
||||||
|
Return SQL.doSQLVarList(sqlstr, "ASFINAG", , list)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Sub LOAD()
|
||||||
|
Try
|
||||||
|
hasEntry = False
|
||||||
|
Using conn As SqlConnection = SQL.GetNewOpenConnectionAsfinag()
|
||||||
|
Using cmd As New SqlCommand("Select * FROM CLFArchiv WHERE PKFileName=@PKFileName AND OBUID = @OBUID ", conn)
|
||||||
|
cmd.Parameters.AddWithValue("@PKFileName", PKFileName)
|
||||||
|
cmd.Parameters.AddWithValue("@OBUID", OBUID)
|
||||||
|
Dim dr = cmd.ExecuteReader()
|
||||||
|
If dr.Read Then
|
||||||
|
For Each li In getParameterList()
|
||||||
|
Dim propInfo As PropertyInfo = Me.GetType.GetProperty(li.Scalarvariable)
|
||||||
|
|
||||||
|
If dr.Item(li.Text) Is DBNull.Value Then
|
||||||
|
propInfo.SetValue(Me, Nothing)
|
||||||
|
Else
|
||||||
|
propInfo.SetValue(Me, dr.Item(li.Text))
|
||||||
|
End If
|
||||||
|
|
||||||
|
Next
|
||||||
|
hasEntry = True
|
||||||
|
End If
|
||||||
|
dr.Close()
|
||||||
|
End Using
|
||||||
|
End Using
|
||||||
|
Catch ex As Exception
|
||||||
|
MsgBox("Fehler In der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Public Function getUpdateCmd() As String
|
||||||
|
Try
|
||||||
|
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
||||||
|
|
||||||
|
Dim str As String = ""
|
||||||
|
For Each i In list
|
||||||
|
If Not i.isPrimaryParam Then
|
||||||
|
str &= "[" & i.Text & "] = @" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
str = str.Substring(0, str.Length - 1) 'wg. ','
|
||||||
|
Return (" UPDATE [CLFArchiv] SET " & str & " WHERE PKFileName=@PKFileName AND OBUID = @OBUID ")
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
|
||||||
|
End Try
|
||||||
|
Return ""
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Public Function getInsertCmd() As String
|
||||||
|
Try
|
||||||
|
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
||||||
|
Dim str As String = ""
|
||||||
|
Dim values As String = ""
|
||||||
|
For Each i In list
|
||||||
|
If Not i.isPrimaryParam Then
|
||||||
|
str &= "[" & i.Text & "],"
|
||||||
|
values &= "@" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
str = str.Substring(0, str.Length - 1) 'wg. ','
|
||||||
|
values = values.Substring(0, values.Length - 1) 'wg. ','
|
||||||
|
Return (" INSERT INTO CLFArchiv (" & str & ") VALUES(" & values & ") ")
|
||||||
|
Catch ex As Exception
|
||||||
|
MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
|
||||||
|
End Try
|
||||||
|
Return ""
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
Public Class CLFTrailer
|
Public Class CLFTrailer
|
||||||
@@ -393,6 +546,7 @@ Public Class cAsfinag
|
|||||||
Public Class TTRHeader
|
Public Class TTRHeader
|
||||||
|
|
||||||
Property PKFileName As Object = Nothing
|
Property PKFileName As Object = Nothing
|
||||||
|
Property PKHistory As Integer
|
||||||
Property recordType As Integer
|
Property recordType As Integer
|
||||||
Property fileVersion As Integer
|
Property fileVersion As Integer
|
||||||
Property fileNumber As Integer
|
Property fileNumber As Integer
|
||||||
@@ -408,14 +562,16 @@ Public Class cAsfinag
|
|||||||
|
|
||||||
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
||||||
|
|
||||||
Sub New(PKFileName, filenummer)
|
Sub New(PKFileName, filenummer, PKHistory)
|
||||||
Me.PKFileName = PKFileName
|
Me.PKFileName = PKFileName
|
||||||
Me.fileNumber = filenummer
|
Me.fileNumber = filenummer
|
||||||
|
Me.PKHistory = PKHistory
|
||||||
LOAD()
|
LOAD()
|
||||||
End Sub
|
End Sub
|
||||||
Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
|
Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
|
||||||
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
|
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
|
||||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("PKFileName", PKFileName))
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("PKFileName", PKFileName))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("PKHistory", PKHistory))
|
||||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("recordType", recordType))
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("recordType", recordType))
|
||||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("fileVersion", fileVersion))
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("fileVersion", fileVersion))
|
||||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("fileNumber", fileNumber))
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("fileNumber", fileNumber))
|
||||||
@@ -433,22 +589,32 @@ Public Class cAsfinag
|
|||||||
Public Function SAVE() As Boolean
|
Public Function SAVE() As Boolean
|
||||||
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
||||||
|
|
||||||
Dim sqlstr = " BEGIN TRAN If EXISTS(Select * FROM TTRHeader WHERE PKFileName=@PKFileName AND fileNumber = @fileNumber) " &
|
Dim sqlstr = " BEGIN TRAN If EXISTS(Select * FROM TTRHeader WHERE PKFileName=@PKFileName AND fileNumber = @fileNumber AND PKHistory = @PKHistory) " &
|
||||||
" BEGIN " & getUpdateCmd() & " End " &
|
" BEGIN " & getUpdateCmd() & " End " &
|
||||||
" Else " &
|
" Else " &
|
||||||
" BEGIN " & getInsertCmd() & " End " &
|
" BEGIN " & getInsertCmd() & " End " & " commit tran "
|
||||||
" commit tran "
|
|
||||||
|
|
||||||
Return SQL.doSQLVarList(sqlstr, "ASFINAG", , list)
|
Return SQL.doSQLVarList(sqlstr, "ASFINAG", , list)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Public Function UPDATE(OldKHistory As Integer) As Boolean
|
||||||
|
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
||||||
|
|
||||||
|
Dim sqlstr = " BEGIN TRAN" & getUpdateCmd(OldKHistory) & " commit tran "
|
||||||
|
|
||||||
|
Return SQL.doSQLVarList(sqlstr, "ASFINAG", , list)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
Public Sub LOAD()
|
Public Sub LOAD()
|
||||||
Try
|
Try
|
||||||
hasEntry = False
|
hasEntry = False
|
||||||
Using conn As SqlConnection = SQL.GetNewOpenConnectionAsfinag()
|
Using conn As SqlConnection = SQL.GetNewOpenConnectionAsfinag()
|
||||||
Using cmd As New SqlCommand("Select * FROM TTRHeader WHERE PKFileName=@PKFileName AND fileNumber = @fileNumber ", conn)
|
Using cmd As New SqlCommand("Select * FROM TTRHeader WHERE PKFileName=@PKFileName AND fileNumber = @fileNumber AND PKHistory = @PKHistory ", conn)
|
||||||
cmd.Parameters.AddWithValue("@PKFileName", PKFileName)
|
cmd.Parameters.AddWithValue("@PKFileName", PKFileName)
|
||||||
cmd.Parameters.AddWithValue("@fileNumber", fileNumber)
|
cmd.Parameters.AddWithValue("@fileNumber", fileNumber)
|
||||||
|
cmd.Parameters.AddWithValue("@PKHistory", PKHistory)
|
||||||
Dim dr = cmd.ExecuteReader()
|
Dim dr = cmd.ExecuteReader()
|
||||||
If dr.Read Then
|
If dr.Read Then
|
||||||
For Each li In getParameterList()
|
For Each li In getParameterList()
|
||||||
@@ -473,7 +639,7 @@ Public Class cAsfinag
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Public Function getUpdateCmd() As String
|
Public Function getUpdateCmd(Optional OldKHistory As Integer = Nothing) As String
|
||||||
Try
|
Try
|
||||||
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
||||||
|
|
||||||
@@ -484,7 +650,12 @@ Public Class cAsfinag
|
|||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
str = str.Substring(0, str.Length - 1) 'wg. ','
|
str = str.Substring(0, str.Length - 1) 'wg. ','
|
||||||
Return (" UPDATE [TTRHeader] SET " & str & " WHERE PKFileName=@PKFileName AND filenumber = @filenumber")
|
If OldKHistory >= 0 Then
|
||||||
|
Return " UPDATE [TTRHeader] SET " & str & " WHERE PKFileName=@PKFileName AND filenumber = @filenumber AND PKHistory = " & OldKHistory
|
||||||
|
Else
|
||||||
|
Return " UPDATE [TTRHeader] SET " & str & " WHERE PKFileName=@PKFileName AND filenumber = @filenumber"
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
|
MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
|
||||||
@@ -519,6 +690,7 @@ Public Class cAsfinag
|
|||||||
|
|
||||||
Property PKFileName As Object = Nothing
|
Property PKFileName As Object = Nothing
|
||||||
Property recordType As Integer
|
Property recordType As Integer
|
||||||
|
Property PKHistory As Integer
|
||||||
Property fileVersion As Integer
|
Property fileVersion As Integer
|
||||||
Property siteId As String
|
Property siteId As String
|
||||||
Property fileNumber As Integer
|
Property fileNumber As Integer
|
||||||
@@ -538,6 +710,7 @@ Public Class cAsfinag
|
|||||||
Property driverId As Integer
|
Property driverId As Integer
|
||||||
Property receiptNumber As String
|
Property receiptNumber As String
|
||||||
Property OBUID As String
|
Property OBUID As String
|
||||||
|
Property abrechnungsdatum As Object = Nothing
|
||||||
|
|
||||||
Public hasEntry = False
|
Public hasEntry = False
|
||||||
|
|
||||||
@@ -547,14 +720,16 @@ Public Class cAsfinag
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub New(PKFileName, PKLine)
|
Sub New(PKFileName, PKLine, PKHistory)
|
||||||
Me.PKFileName = PKFileName
|
Me.PKFileName = PKFileName
|
||||||
Me.PKLine = PKLine
|
Me.PKLine = PKLine
|
||||||
|
Me.PKHistory = PKHistory
|
||||||
LOAD()
|
LOAD()
|
||||||
End Sub
|
End Sub
|
||||||
Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
|
Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
|
||||||
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
|
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
|
||||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("PKFileName", PKFileName))
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("PKFileName", PKFileName))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("PKHistory", PKHistory))
|
||||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("PKLine", PKLine))
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("PKLine", PKLine))
|
||||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("fileVersion", fileVersion))
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("fileVersion", fileVersion))
|
||||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("recordType", recordType))
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("recordType", recordType))
|
||||||
@@ -575,6 +750,7 @@ Public Class cAsfinag
|
|||||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("VATamount", VATamount))
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("VATamount", VATamount))
|
||||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("receiptNumber", receiptNumber))
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("receiptNumber", receiptNumber))
|
||||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("OBUID", OBUID))
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("OBUID", OBUID))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("abrechnungsdatum", abrechnungsdatum))
|
||||||
|
|
||||||
Return list
|
Return list
|
||||||
End Function
|
End Function
|
||||||
@@ -582,11 +758,10 @@ Public Class cAsfinag
|
|||||||
Public Function SAVE() As Boolean
|
Public Function SAVE() As Boolean
|
||||||
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
||||||
|
|
||||||
Dim sqlstr = " BEGIN TRAN If EXISTS(Select * FROM TTRBody WHERE PKFileName=@PKFileName AND PKLine = @PKLine) " &
|
Dim sqlstr = " BEGIN TRAN If EXISTS(Select * FROM TTRBody WHERE PKFileName=@PKFileName AND PKLine = @PKLine AND PKHistory = @PKHistory) " &
|
||||||
" BEGIN " & getUpdateCmd() & " End " &
|
" BEGIN " & getUpdateCmd() & " End " &
|
||||||
" Else " &
|
" Else " &
|
||||||
" BEGIN " & getInsertCmd() & " End " &
|
" BEGIN " & getInsertCmd() & " End " & " commit tran "
|
||||||
" commit tran "
|
|
||||||
|
|
||||||
Return SQL.doSQLVarList(sqlstr, "ASFINAG", , list)
|
Return SQL.doSQLVarList(sqlstr, "ASFINAG", , list)
|
||||||
End Function
|
End Function
|
||||||
@@ -595,9 +770,10 @@ Public Class cAsfinag
|
|||||||
Try
|
Try
|
||||||
hasEntry = False
|
hasEntry = False
|
||||||
Using conn As SqlConnection = SQL.GetNewOpenConnectionAsfinag()
|
Using conn As SqlConnection = SQL.GetNewOpenConnectionAsfinag()
|
||||||
Using cmd As New SqlCommand("Select * FROM TTRBody WHERE PKFileName=@PKFileName AND PKLine = @PKLine ", conn)
|
Using cmd As New SqlCommand("Select * FROM TTRBody WHERE PKFileName=@PKFileName AND PKLine = @PKLine AND PKHistory = @PKHistory ", conn)
|
||||||
cmd.Parameters.AddWithValue("@PKFileName", PKFileName)
|
cmd.Parameters.AddWithValue("@PKFileName", PKFileName)
|
||||||
cmd.Parameters.AddWithValue("@PKLine", PKLine)
|
cmd.Parameters.AddWithValue("@PKLine", PKLine)
|
||||||
|
cmd.Parameters.AddWithValue("@PKHistory", PKHistory)
|
||||||
Dim dr = cmd.ExecuteReader()
|
Dim dr = cmd.ExecuteReader()
|
||||||
If dr.Read Then
|
If dr.Read Then
|
||||||
For Each li In getParameterList()
|
For Each li In getParameterList()
|
||||||
@@ -633,7 +809,7 @@ Public Class cAsfinag
|
|||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
str = str.Substring(0, str.Length - 1) 'wg. ','
|
str = str.Substring(0, str.Length - 1) 'wg. ','
|
||||||
Return (" UPDATE [TTRBody] SET " & str & " WHERE PKFileName=@PKFileName AND PKLine = @PKLine ")
|
Return (" UPDATE [TTRBody] SET " & str & " WHERE PKFileName=@PKFileName AND PKLine = @PKLine AND PKHistory = @PKHistory")
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
|
MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
|
||||||
@@ -671,6 +847,7 @@ Public Class cAsfinag
|
|||||||
Public Class TTRTrailer
|
Public Class TTRTrailer
|
||||||
|
|
||||||
Property PKFileName As Object = Nothing
|
Property PKFileName As Object = Nothing
|
||||||
|
Property PKHistory As Integer
|
||||||
Property recordType As Integer
|
Property recordType As Integer
|
||||||
Property fileVersion As Integer
|
Property fileVersion As Integer
|
||||||
Property recordCount As Integer
|
Property recordCount As Integer
|
||||||
@@ -681,13 +858,15 @@ Public Class cAsfinag
|
|||||||
|
|
||||||
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
||||||
|
|
||||||
Sub New(PKFileName)
|
Sub New(PKFileName, PKHistory)
|
||||||
Me.PKFileName = PKFileName
|
Me.PKFileName = PKFileName
|
||||||
|
Me.PKHistory = PKHistory
|
||||||
LOAD()
|
LOAD()
|
||||||
End Sub
|
End Sub
|
||||||
Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
|
Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
|
||||||
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
|
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
|
||||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("PKFileName", PKFileName))
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("PKFileName", PKFileName))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("PKHistory", PKHistory))
|
||||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("recordType", recordType))
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("recordType", recordType))
|
||||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("fileVersion", fileVersion))
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("fileVersion", fileVersion))
|
||||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("recordCount", recordCount))
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("recordCount", recordCount))
|
||||||
@@ -700,7 +879,7 @@ Public Class cAsfinag
|
|||||||
Public Function SAVE() As Boolean
|
Public Function SAVE() As Boolean
|
||||||
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
||||||
|
|
||||||
Dim sqlstr = " BEGIN TRAN If EXISTS(Select * FROM TTRTrailer WHERE PKFileName=@PKFileName) " &
|
Dim sqlstr = " BEGIN TRAN If EXISTS(Select * FROM TTRTrailer WHERE PKFileName=@PKFileName AND PKHistory = @PKHistory) " &
|
||||||
" BEGIN " & getUpdateCmd() & " End " &
|
" BEGIN " & getUpdateCmd() & " End " &
|
||||||
" Else " &
|
" Else " &
|
||||||
" BEGIN " & getInsertCmd() & " End " &
|
" BEGIN " & getInsertCmd() & " End " &
|
||||||
@@ -713,8 +892,9 @@ Public Class cAsfinag
|
|||||||
Try
|
Try
|
||||||
hasEntry = False
|
hasEntry = False
|
||||||
Using conn As SqlConnection = SQL.GetNewOpenConnectionAsfinag()
|
Using conn As SqlConnection = SQL.GetNewOpenConnectionAsfinag()
|
||||||
Using cmd As New SqlCommand("Select * FROM TTRTrailer WHERE PKFileName=@PKFileName", conn)
|
Using cmd As New SqlCommand("Select * FROM TTRTrailer WHERE PKFileName=@PKFileName AND PKHistory = @PKHistory", conn)
|
||||||
cmd.Parameters.AddWithValue("@PKFileName", PKFileName)
|
cmd.Parameters.AddWithValue("@PKFileName", PKFileName)
|
||||||
|
cmd.Parameters.AddWithValue("@PKHistory", PKHistory)
|
||||||
Dim dr = cmd.ExecuteReader()
|
Dim dr = cmd.ExecuteReader()
|
||||||
If dr.Read Then
|
If dr.Read Then
|
||||||
For Each li In getParameterList()
|
For Each li In getParameterList()
|
||||||
@@ -855,60 +1035,25 @@ Public Class cAsfinag
|
|||||||
End Structure
|
End Structure
|
||||||
|
|
||||||
|
|
||||||
|
Dim VERARBEITUNG_PFAD, ARCHIV_PFAD, BEREITSTELLUNG_PFAD, ERROR_PFAD, FTP_PFAD_TEST, FTP_PFAD
|
||||||
' Private Type TWLHeader ' Format Muss von bis Kommentar
|
|
||||||
' SortField As String * 3 ' N3 Y 1 3 "000"
|
|
||||||
' RecordID As String * 2 ' N2 Y 4 5 "00"
|
|
||||||
' FileName As String * 3 ' C3 Y 6 8 "TWL"
|
|
||||||
' LiveTestIndicator As String * 1 ' C1 Y 9 9 "L" oder "T"
|
|
||||||
' FileCreationDate As String * 8 ' N8 Y 10 17 YYYYMMDD
|
|
||||||
' FileCreationTime As String * 4 ' N4 Y 18 21 HHMM (24hr)
|
|
||||||
' RunNumber As String * 3 ' N3 Y 22 24 Laufende Nummer pro File-Type
|
|
||||||
' SenderID As String * 2 ' C2 Y 25 26 "VG"
|
|
||||||
' ReceiverID As String * 2 ' C2 Y 27 28 "EP"
|
|
||||||
' Filler As String * 56 ' C56 Y 29 84 Leerzeichen
|
|
||||||
'End Type
|
|
||||||
|
|
||||||
'Private Type TWLBody ' Format Muss von bis Kommentar
|
|
||||||
' SortField As String * 3 ' N3 Y 1 3 "000"
|
|
||||||
' RecordID As String * 2 ' N2 Y 4 5 "40"
|
|
||||||
' ISOCountryCode As String * 3 ' N3 Y 6 8 "040" (Österreich)
|
|
||||||
' CardNumber As String * 22 ' N22 Y 9 30 Komplette Tankkartennummer
|
|
||||||
' ValidFrom As String * 8 ' N8 Y 31 38 YYYYMMDD
|
|
||||||
' ValidTo As String * 8 ' N8 Y 39 46 YYYYMMDD
|
|
||||||
' NewCardNumber As String * 22 ' N22 N 47 68 Tankkartennummer der Folge- oder Ersatzkarte
|
|
||||||
' NewValidFrom As String * 8 ' N8 N 69 76 YYYYMMDD der Folge- oder Ersatzkarte
|
|
||||||
' NewValidTo As String * 8 ' N8 N 77 84 YYYYMMDD der Folge- oder Ersatzkarte
|
|
||||||
'End Type
|
|
||||||
|
|
||||||
'Private Type TWLTrailer ' Format Muss von bis Kommentar
|
|
||||||
' SortField As String * 3 ' N3 Y 1 3 "999"
|
|
||||||
' RecordID As String * 2 ' N2 Y 4 5 "99"
|
|
||||||
' FileName As String * 3 ' C3 Y 6 8 "TWL"
|
|
||||||
' RunNumber As String * 3 ' N3 Y 9 11 Gleiche Nr. wie im Header
|
|
||||||
' RecordCount As String * 7 ' N7 Y 12 18 Anzahl der Sätze inkl. Header und Trailer
|
|
||||||
' Filler As String * 66 ' C66 Y 19 84 Leerzeichen
|
|
||||||
'End Type
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Dim ASFINAG_PFAD, FTP_PFAD_TEST, FTP_PFAD
|
|
||||||
Dim sw As StreamWriter
|
Dim sw As StreamWriter
|
||||||
Dim Dateiname = ""
|
Dim Dateiname = ""
|
||||||
|
|
||||||
Public Function initPFad()
|
Public Function initExportPfade()
|
||||||
|
|
||||||
ASFINAG_PFAD = cAsfinag.Paramter.GET_PARAM_ByName("BEREITSTELLUNGS_PFAD", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
ERROR_PFAD = cAsfinag.Paramter.GET_PARAM_ByName("ERROR_PFAD", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
||||||
|
BEREITSTELLUNG_PFAD = cAsfinag.Paramter.GET_PARAM_ByName("BEREITSTELLUNG_PFAD", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
||||||
|
ARCHIV_PFAD = cAsfinag.Paramter.GET_PARAM_ByName("ARCHIV_PFAD", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
||||||
|
VERARBEITUNG_PFAD = cAsfinag.Paramter.GET_PARAM_ByName("VERARBEITUNG_PFAD", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
||||||
FTP_PFAD_TEST = cAsfinag.Paramter.GET_PARAM_ByName("SERVER_Path_Out_Test", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
FTP_PFAD_TEST = cAsfinag.Paramter.GET_PARAM_ByName("SERVER_Path_Out_Test", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
||||||
FTP_PFAD = cAsfinag.Paramter.GET_PARAM_ByName("SERVER_Path_Out", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
FTP_PFAD = cAsfinag.Paramter.GET_PARAM_ByName("SERVER_Path_Out", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
||||||
|
|
||||||
If Not IO.Directory.Exists(ASFINAG_PFAD) Then IO.Directory.CreateDirectory(ASFINAG_PFAD)
|
If Not IO.Directory.Exists(VERARBEITUNG_PFAD) Then IO.Directory.CreateDirectory(VERARBEITUNG_PFAD)
|
||||||
If Not IO.Directory.Exists(FTP_PFAD_TEST) Then IO.Directory.CreateDirectory(FTP_PFAD_TEST)
|
If Not IO.Directory.Exists(FTP_PFAD_TEST) Then IO.Directory.CreateDirectory(FTP_PFAD_TEST)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
Public Function exportiereBlackList() As Boolean
|
Public Function exportiereBlackList() As Boolean
|
||||||
|
|
||||||
Dim fileName = "TBL"
|
Dim fileName = "TBL"
|
||||||
@@ -948,7 +1093,7 @@ Public Class cAsfinag
|
|||||||
preFilename = "TVGEP"
|
preFilename = "TVGEP"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim strFile As String = ASFINAG_PFAD & "\" & preFilename & fileName & "." & currentFileNr
|
Dim strFile As String = BEREITSTELLUNG_PFAD & "\" & preFilename & fileName & "." & currentFileNr
|
||||||
|
|
||||||
Try
|
Try
|
||||||
|
|
||||||
@@ -1071,7 +1216,7 @@ Public Class cAsfinag
|
|||||||
preFilename = "TVGEP"
|
preFilename = "TVGEP"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim strFile As String = ASFINAG_PFAD & "\" & preFilename & fileName & "." & currentFileNr
|
Dim strFile As String = BEREITSTELLUNG_PFAD & "\" & preFilename & fileName & "." & currentFileNr
|
||||||
|
|
||||||
Try
|
Try
|
||||||
|
|
||||||
@@ -1197,13 +1342,13 @@ Public Class cAsfinag
|
|||||||
|
|
||||||
If VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then
|
If VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then
|
||||||
|
|
||||||
SERVER_Path = Me.FTP_PFAD_TEST
|
SERVER_Path = FTP_PFAD_TEST
|
||||||
Else
|
Else
|
||||||
|
|
||||||
SERVER_Path = Me.FTP_PFAD
|
SERVER_Path = FTP_PFAD
|
||||||
End If
|
End If
|
||||||
|
|
||||||
For Each f In IO.Directory.GetFiles(ASFINAG_PFAD)
|
For Each f In IO.Directory.GetFiles(BEREITSTELLUNG_PFAD)
|
||||||
Dim fi As New IO.FileInfo(f)
|
Dim fi As New IO.FileInfo(f)
|
||||||
|
|
||||||
If Not fi.Name.StartsWith(".") AndAlso fi.Name.Contains(filename) Then
|
If Not fi.Name.StartsWith(".") AndAlso fi.Name.Contains(filename) Then
|
||||||
@@ -1211,9 +1356,9 @@ Public Class cAsfinag
|
|||||||
'While IO.File.Exists(zielPfad)
|
'While IO.File.Exists(zielPfad)
|
||||||
' zielPfad = SERVER_Path & "\" & Now.ToString("yyyyMMdd_HHmmss_") & fi.Name
|
' zielPfad = SERVER_Path & "\" & Now.ToString("yyyyMMdd_HHmmss_") & fi.Name
|
||||||
'End While
|
'End While
|
||||||
IO.File.Copy(f, zielPfad & "\" & fi.Name)
|
IO.File.Copy(f, zielPfad & "\" & fi.Name, True)
|
||||||
If Not VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then
|
If VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM And IO.File.Exists(zielPfad & "\" & fi.Name) Then
|
||||||
If IO.File.Exists(zielPfad) Then IO.File.Delete(f)
|
IO.File.Move(BEREITSTELLUNG_PFAD & "\" & fi.Name, ARCHIV_PFAD & "\" & fi.Name)
|
||||||
End If
|
End If
|
||||||
cnt += 1
|
cnt += 1
|
||||||
End If
|
End If
|
||||||
@@ -1232,6 +1377,507 @@ Public Class cAsfinag
|
|||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
Public VERARBEITUNG_PFAD
|
||||||
|
Public ARCHIV_PFAD
|
||||||
|
Public BEREITSTELLUNG_PFAD
|
||||||
|
Public ERROR_PFAD
|
||||||
|
Public FTP_PFAD_TEST
|
||||||
|
Public FTP_PFAD
|
||||||
|
Dim Dateiname = ""
|
||||||
|
|
||||||
|
Public Function initImportPfade()
|
||||||
|
|
||||||
|
ERROR_PFAD = cAsfinag.Paramter.GET_PARAM_ByName("ERROR_PFAD", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
||||||
|
BEREITSTELLUNG_PFAD = cAsfinag.Paramter.GET_PARAM_ByName("BEREITSTELLUNG_PFAD", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
||||||
|
ARCHIV_PFAD = cAsfinag.Paramter.GET_PARAM_ByName("ARCHIV_PFAD", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
||||||
|
VERARBEITUNG_PFAD = cAsfinag.Paramter.GET_PARAM_ByName("VERARBEITUNG_PFAD", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
||||||
|
FTP_PFAD_TEST = cAsfinag.Paramter.GET_PARAM_ByName("SERVER_Path_In_Test", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
||||||
|
FTP_PFAD = cAsfinag.Paramter.GET_PARAM_ByName("SERVER_Path_In", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
||||||
|
|
||||||
|
If Not IO.Directory.Exists(VERARBEITUNG_PFAD) Then IO.Directory.CreateDirectory(VERARBEITUNG_PFAD)
|
||||||
|
If Not IO.Directory.Exists(FTP_PFAD_TEST) Then IO.Directory.CreateDirectory(FTP_PFAD_TEST)
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Function getNachrichtenDatenFromFTP(ByRef filenameList As List(Of String), ByVal fileType As String) As Integer
|
||||||
|
Dim cnt = 0
|
||||||
|
Try
|
||||||
|
Dim SERVERPath = ""
|
||||||
|
|
||||||
|
If VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then
|
||||||
|
|
||||||
|
SERVERPath = Me.FTP_PFAD_TEST
|
||||||
|
Else
|
||||||
|
|
||||||
|
SERVERPath = Me.FTP_PFAD
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
For Each f In IO.Directory.GetFiles(SERVERPath)
|
||||||
|
Dim fi As New IO.FileInfo(f)
|
||||||
|
If fi.Name.ToLower.Contains(fileType) Then
|
||||||
|
If Not fi.Name.StartsWith(".") Then
|
||||||
|
Dim zielPfad = VERARBEITUNG_PFAD & "\" & fi.Name
|
||||||
|
While IO.File.Exists(zielPfad)
|
||||||
|
zielPfad = VERARBEITUNG_PFAD & "\" & "DOPPELT" & "\" & fi.Name.Replace(fi.Extension, "") & fi.Extension & Now.ToString("_yyyyMMdd_HHmmss")
|
||||||
|
End While
|
||||||
|
IO.File.Copy(f, zielPfad)
|
||||||
|
If VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then
|
||||||
|
If IO.File.Exists(zielPfad) Then IO.File.Delete(f)
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim filename = frmStartOptions.cut_file((New FileInfo(zielPfad)).Name)
|
||||||
|
If filename.ToLower.Contains(fileType) Then
|
||||||
|
filenameList.Add(filename)
|
||||||
|
cnt += 1
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
Next
|
||||||
|
|
||||||
|
|
||||||
|
Return cnt
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return cnt
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function readAndSaveCLF(objFileRead As StreamReader, fi As FileInfo) As Boolean
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Dim booHeaderVorhanden = False
|
||||||
|
Dim booPrüfziffernfehler = False
|
||||||
|
Dim booInTransaktion = False
|
||||||
|
Dim booTrailerVorhanden = False
|
||||||
|
|
||||||
|
Dim lngRecordCount As Long
|
||||||
|
|
||||||
|
'Datei auf Fehler prüfen!
|
||||||
|
Do While (objFileRead.Peek() > -1)
|
||||||
|
Dim strZeile = objFileRead.ReadLine()
|
||||||
|
lngRecordCount = lngRecordCount + 1
|
||||||
|
|
||||||
|
Select Case Mid(strZeile, 1, 2)
|
||||||
|
Case "10"
|
||||||
|
booHeaderVorhanden = True
|
||||||
|
Case "20"
|
||||||
|
' Meldung bei nicht vorhandenen Haeder.
|
||||||
|
If Not booHeaderVorhanden Then
|
||||||
|
MsgBox("Datei kann wegen fehlenden Header nicht verarbeitet werden.")
|
||||||
|
objFileRead.Close()
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
|
'CardNumber prüfen.
|
||||||
|
If (Right(Trim(Mid(strZeile, 9, 22)), 1)) <> cAsfinag.fktMod10Prüfziffer(Left(Trim(Mid(strZeile, 9, 22)), Len(Trim(Mid(strZeile, 9, 22))) - 1)) Then
|
||||||
|
booPrüfziffernfehler = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Meldung bei Prüfziffernfehler.
|
||||||
|
If booPrüfziffernfehler Then
|
||||||
|
MsgBox("Prüfziffernfehler in Zeile " & CStr(lngRecordCount) & vbCrLf & "Datei kann nicht verarbeitet werden. " & vbNewLine & " " & fi.Name.ToString)
|
||||||
|
booInTransaktion = False
|
||||||
|
Return False
|
||||||
|
|
||||||
|
End If
|
||||||
|
Case "90"
|
||||||
|
' Meldung bei nicht vorhandenen Haeder.
|
||||||
|
If Not booHeaderVorhanden Then
|
||||||
|
MsgBox("Datei kann wegen fehlenden Header nicht verarbeitet werden.")
|
||||||
|
objFileRead.Close()
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
|
booTrailerVorhanden = True
|
||||||
|
Dim clfTrailer As New cAsfinag.CLFTrailer(fi.Name)
|
||||||
|
|
||||||
|
' Prüfsumme Anzahl der Sätze im File ohne Header und Trailer.
|
||||||
|
If Trim(Mid(strZeile, 9, 7)) <> (lngRecordCount) Then
|
||||||
|
MsgBox("Fehler: " & vbNewLine & "Prüfsumme in der Datei stimmt nicht mit der Zeilenanzahl der Datei überein! " & vbNewLine & "Record Count: " & Trim(Mid(strZeile, 9, 7)) & vbCrLf & "Prüfsumme: " & (lngRecordCount) & vbCrLf)
|
||||||
|
objFileRead.Close()
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
' Meldung bei Prüfsummenfehler.
|
||||||
|
If booPrüfziffernfehler Then
|
||||||
|
MsgBox("Datei kann wegen Prüfsummenfehler nicht verarbeitet werden.")
|
||||||
|
objFileRead.Close()
|
||||||
|
|
||||||
|
End If
|
||||||
|
Case Else
|
||||||
|
|
||||||
|
End Select
|
||||||
|
|
||||||
|
Loop
|
||||||
|
|
||||||
|
|
||||||
|
Dim lngPKLine As Long = 0
|
||||||
|
lngRecordCount = 0
|
||||||
|
|
||||||
|
'gleicher PKFileName wird nun aus CLFHeader gelöscht. CASCADE löscht dann zugehörige CLFBody und CLFTrailer (muss noch eingebaut werden).
|
||||||
|
SQL.doSQL("delete FROM CLFHeader WHERE (PKHistory = 0) AND (PKFileName = N'" & fi.Name.ToString & "')", "ASFINAG")
|
||||||
|
|
||||||
|
SQL.doSQL("UPDATE CLF SET PKFileName = '" & fi.Name.ToString & "'", "ASFINAG")
|
||||||
|
objFileRead.DiscardBufferedData()
|
||||||
|
objFileRead.BaseStream.Seek(0, System.IO.SeekOrigin.Begin)
|
||||||
|
|
||||||
|
Do While (objFileRead.Peek() > -1)
|
||||||
|
Dim strZeile = objFileRead.ReadLine()
|
||||||
|
lngRecordCount = lngRecordCount + 1
|
||||||
|
|
||||||
|
Select Case Mid(strZeile, 1, 2)
|
||||||
|
Case "10"
|
||||||
|
booHeaderVorhanden = True
|
||||||
|
Dim ext = CInt(fi.Extension.Remove(0, 1))
|
||||||
|
Dim clfHeader As New cAsfinag.CLFHeader(fi.Name.ToString, ext)
|
||||||
|
With clfHeader
|
||||||
|
.PKFileName = fi.Name
|
||||||
|
.recordType = Mid(strZeile, 1, 2)
|
||||||
|
.fileVersion = Mid(strZeile, 3, 2)
|
||||||
|
.indcator = Trim(Mid(strZeile, 9, 1))
|
||||||
|
.senderID = Trim(Mid(strZeile, 10, 6))
|
||||||
|
.receiverID = Trim(Mid(strZeile, 16, 6))
|
||||||
|
.fileCreationDate = DateSerial(Mid(strZeile, 22, 4), Mid(strZeile, 26, 2), Mid(strZeile, 28, 2))
|
||||||
|
.fileCreationTime = DateSerial(Mid(strZeile, 22, 4), Mid(strZeile, 26, 2), Mid(strZeile, 28, 2)) & " " & TimeSerial(Mid(strZeile, 30, 2), Mid(strZeile, 32, 2), 0)
|
||||||
|
'.fileCreationTime = DateSerial(Mid(strZeile, 22, 4), Mid(strZeile, 26, 2), Mid(strZeile, 28, 2)) & " " & TimeSerial(Mid(strZeile, 30, 2), Mid(strZeile, 32, 2), Mid(strZeile, 34, 2))
|
||||||
|
.ISOCountryCode = Trim(Mid(strZeile, 62, 3))
|
||||||
|
.SAVE()
|
||||||
|
End With
|
||||||
|
|
||||||
|
Case "20"
|
||||||
|
|
||||||
|
Dim clfBody As New cAsfinag.CLFBody(fi.Name, lngPKLine)
|
||||||
|
With clfBody
|
||||||
|
.PKFileName = fi.Name
|
||||||
|
lngPKLine = lngPKLine + 1
|
||||||
|
.RecordType = Trim(Mid(strZeile, 1, 2))
|
||||||
|
.fileVersion = Trim(Mid(strZeile, 3, 2))
|
||||||
|
.fileNumber = Trim(Mid(strZeile, 5, 3))
|
||||||
|
.cardNumber = Trim(Mid(strZeile, 9, 22))
|
||||||
|
.validTo = Trim(Mid(strZeile, 31, 4))
|
||||||
|
.OBUID = Trim(Mid(strZeile, 35, 18))
|
||||||
|
.vehicleLicensePlate = Trim(Mid(strZeile, 53, 10))
|
||||||
|
.nationality = Trim(Mid(strZeile, 63, 3))
|
||||||
|
.vehicleCategory = Trim(Mid(strZeile, 66, 1))
|
||||||
|
.emissionCategory = Trim(Mid(strZeile, 67, 2))
|
||||||
|
.status = Trim(Mid(strZeile, 69, 2))
|
||||||
|
.contractDate = DateSerial(Mid(strZeile, 71, 4), Mid(strZeile, 75, 2), Mid(strZeile, 77, 2))
|
||||||
|
.engineCharacteristics = Trim(Mid(strZeile, 79, 3))
|
||||||
|
.CO2EmissionsClass = Trim(Mid(strZeile, 82, 1))
|
||||||
|
.contractType = Trim(Mid(strZeile, 83, 1))
|
||||||
|
.SAVE()
|
||||||
|
End With
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Dim strSQLASFINAG = "SELECT * FROM CLFArchiv WHERE OBUID = N'" & Trim(Mid(strZeile, 35, 18)) & "'"
|
||||||
|
|
||||||
|
Dim dtAsfinag As DataTable = SQL.loadDgvBySql_Param(strSQLASFINAG, "ASFINAG")
|
||||||
|
|
||||||
|
Dim clfArchiv As New cAsfinag.CLFArchiv(fi.Name, Trim(Mid(strZeile, 35, 18)))
|
||||||
|
|
||||||
|
If dtAsfinag.Rows.Count = 0 Then
|
||||||
|
With clfArchiv
|
||||||
|
.PKFileName = fi.Name
|
||||||
|
.RecordType = Trim(Mid(strZeile, 1, 2))
|
||||||
|
.fileVersion = Trim(Mid(strZeile, 3, 2))
|
||||||
|
.fileNumber = Trim(Mid(strZeile, 5, 3))
|
||||||
|
.cardNumber = Trim(Mid(strZeile, 9, 22))
|
||||||
|
.validTo = Trim(Mid(strZeile, 31, 4))
|
||||||
|
.OBUID = Trim(Mid(strZeile, 35, 18))
|
||||||
|
.vehicleLicensePlate = Trim(Mid(strZeile, 53, 10))
|
||||||
|
.nationality = Trim(Mid(strZeile, 63, 3))
|
||||||
|
.vehicleCategory = Trim(Mid(strZeile, 66, 1))
|
||||||
|
.emissionCategory = Trim(Mid(strZeile, 67, 2))
|
||||||
|
.status = Trim(Mid(strZeile, 69, 2))
|
||||||
|
.contractDate = DateSerial(Mid(strZeile, 71, 4), Mid(strZeile, 75, 2), Mid(strZeile, 77, 2))
|
||||||
|
.engineCharacteristics = Trim(Mid(strZeile, 79, 3))
|
||||||
|
.CO2EmissionsClass = Trim(Mid(strZeile, 82, 1))
|
||||||
|
.contractType = Trim(Mid(strZeile, 83, 1))
|
||||||
|
.SAVE()
|
||||||
|
End With
|
||||||
|
End If
|
||||||
|
|
||||||
|
For Each r As DataRow In dtAsfinag.Rows
|
||||||
|
|
||||||
|
clfArchiv = New cAsfinag.CLFArchiv(r.Item("PKFileName"), r.Item("OBUID"))
|
||||||
|
|
||||||
|
With clfArchiv
|
||||||
|
.PKFileName = fi.Name
|
||||||
|
.RecordType = Trim(Mid(strZeile, 1, 2))
|
||||||
|
.fileVersion = Trim(Mid(strZeile, 3, 2))
|
||||||
|
.fileNumber = Trim(Mid(strZeile, 5, 3))
|
||||||
|
.cardNumber = Trim(Mid(strZeile, 9, 22))
|
||||||
|
.validTo = Trim(Mid(strZeile, 31, 4))
|
||||||
|
.OBUID = Trim(Mid(strZeile, 35, 18))
|
||||||
|
.vehicleLicensePlate = Trim(Mid(strZeile, 53, 10))
|
||||||
|
.nationality = Trim(Mid(strZeile, 63, 3))
|
||||||
|
.vehicleCategory = Trim(Mid(strZeile, 66, 1))
|
||||||
|
.emissionCategory = Trim(Mid(strZeile, 67, 2))
|
||||||
|
.status = Trim(Mid(strZeile, 69, 2))
|
||||||
|
.contractDate = DateSerial(Mid(strZeile, 71, 4), Mid(strZeile, 75, 2), Mid(strZeile, 77, 2))
|
||||||
|
.engineCharacteristics = Trim(Mid(strZeile, 79, 3))
|
||||||
|
.CO2EmissionsClass = Trim(Mid(strZeile, 82, 1))
|
||||||
|
.contractType = Trim(Mid(strZeile, 83, 1))
|
||||||
|
.SAVE()
|
||||||
|
End With
|
||||||
|
Next
|
||||||
|
|
||||||
|
|
||||||
|
Case "90"
|
||||||
|
|
||||||
|
Dim clfTrailer As New cAsfinag.CLFTrailer(fi.Name)
|
||||||
|
|
||||||
|
With clfTrailer
|
||||||
|
.PKFileName = fi.Name
|
||||||
|
.recordType = Trim(Mid(strZeile, 1, 2))
|
||||||
|
.fileVersion = Trim(Mid(strZeile, 3, 2))
|
||||||
|
.fileNumber = Trim(Mid(strZeile, 5, 4))
|
||||||
|
.recordCount = Trim(Mid(strZeile, 9, 7))
|
||||||
|
.SAVE()
|
||||||
|
End With
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Case Else
|
||||||
|
' Andere RecordNumber überlesen.
|
||||||
|
End Select
|
||||||
|
|
||||||
|
Loop
|
||||||
|
|
||||||
|
objFileRead.Close()
|
||||||
|
|
||||||
|
Return True
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function readAndSaveTTR(objFileRead As StreamReader, fi As FileInfo) As Boolean
|
||||||
|
|
||||||
|
Dim booHeaderVorhanden = False
|
||||||
|
Dim booPrüfziffernfehler = False
|
||||||
|
Dim booInTransaktion = False
|
||||||
|
Dim booTrailerVorhanden = False
|
||||||
|
Dim dblCheckSumQuantity As Double
|
||||||
|
Dim curCheckSumAmount As Double
|
||||||
|
|
||||||
|
Dim lngPKLine As Long = 0
|
||||||
|
Dim lngRecordCount As Long
|
||||||
|
|
||||||
|
'Datei auf Fehler prüfen
|
||||||
|
Do While (objFileRead.Peek() > -1)
|
||||||
|
Dim strZeile = objFileRead.ReadLine()
|
||||||
|
lngRecordCount = lngRecordCount + 1
|
||||||
|
|
||||||
|
Select Case Mid(strZeile, 1, 2)
|
||||||
|
Case "10"
|
||||||
|
booHeaderVorhanden = True
|
||||||
|
Case "20"
|
||||||
|
' Meldung bei nicht vorhandenen Haeder.
|
||||||
|
If Not booHeaderVorhanden Then
|
||||||
|
MsgBox("Datei kann wegen fehlenden Header nicht verarbeitet werden.")
|
||||||
|
objFileRead.Close()
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
' Bei den Checksummen wird unabhängig vom TransactionType immer der positive Betrag aufsummiert.
|
||||||
|
dblCheckSumQuantity = dblCheckSumQuantity + Trim(Mid(strZeile, 94, 6)) / 100
|
||||||
|
curCheckSumAmount = curCheckSumAmount + Trim(Mid(strZeile, 100, 10)) / 100
|
||||||
|
If (Right(Trim(Mid(strZeile, 43, 22)), 1)) <> (fktMod10Prüfziffer(Left(Trim(Mid(strZeile, 43, 22)), Len(Trim(Mid(strZeile, 43, 22))) - 1))) Then
|
||||||
|
booPrüfziffernfehler = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Meldung bei Prüfziffernfehler.
|
||||||
|
If booPrüfziffernfehler Then
|
||||||
|
MsgBox("Prüfziffernfehler in Zeile " & CStr(lngRecordCount) & vbCrLf & "Datei kann nicht verarbeitet werden. " & vbNewLine & " " & fi.Name.ToString)
|
||||||
|
booInTransaktion = False
|
||||||
|
objFileRead.Close()
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
Case "90"
|
||||||
|
' Meldung bei nicht vorhandenen Haeder.
|
||||||
|
If Not booHeaderVorhanden Then
|
||||||
|
MsgBox("Datei kann wegen fehlenden Header nicht verarbeitet werden.")
|
||||||
|
objFileRead.Close()
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
|
booTrailerVorhanden = True
|
||||||
|
|
||||||
|
Dim strPrompt
|
||||||
|
Dim recordCount = Trim(Mid(strZeile, 5, 9))
|
||||||
|
If recordCount <> lngRecordCount Then
|
||||||
|
strPrompt = strPrompt & "Record Count: " & recordCount & vbCrLf &
|
||||||
|
"Prüfsumme: " & lngRecordCount & vbCrLf
|
||||||
|
End If
|
||||||
|
' Prüfsumme Menge.
|
||||||
|
Dim checksumProductQuantity = Trim(Mid(strZeile, 14, 15)) / 100
|
||||||
|
If checksumProductQuantity <> dblCheckSumQuantity Then
|
||||||
|
strPrompt = strPrompt & "Check Sum Quantity: " & checksumProductQuantity & vbCrLf &
|
||||||
|
"Prüfsumme: " & dblCheckSumQuantity & vbCrLf
|
||||||
|
End If
|
||||||
|
' Prüfsumme Betrag.
|
||||||
|
Dim checksumAmounntInclVAT = Trim(Mid(strZeile, 29, 15)) / 100
|
||||||
|
If checksumAmounntInclVAT <> Math.Round(curCheckSumAmount, 2) Then
|
||||||
|
strPrompt = strPrompt & "Check Sum Amount: " & checksumAmounntInclVAT & vbCrLf &
|
||||||
|
"Prüfsumme: " & curCheckSumAmount & vbCrLf
|
||||||
|
End If
|
||||||
|
|
||||||
|
If strPrompt <> "" Then
|
||||||
|
MsgBox(strPrompt)
|
||||||
|
objFileRead.Close()
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Prüfsumme Anzahl der Sätze im File ohne Header und Trailer.
|
||||||
|
If recordCount <> (lngRecordCount) Then
|
||||||
|
MsgBox("Record Count: " & recordCount & vbCrLf & "Prüfsumme: " & (lngRecordCount) & vbCrLf)
|
||||||
|
objFileRead.Close()
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
' Meldung bei Prüfsummenfehler.
|
||||||
|
If booPrüfziffernfehler Then
|
||||||
|
MsgBox("Datei kann wegen Prüfsummenfehler nicht verarbeitet werden.")
|
||||||
|
objFileRead.Close()
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
Case Else
|
||||||
|
' Andere RecordNumber überlesen.
|
||||||
|
End Select
|
||||||
|
|
||||||
|
Loop
|
||||||
|
|
||||||
|
|
||||||
|
objFileRead.DiscardBufferedData()
|
||||||
|
objFileRead.BaseStream.Seek(0, System.IO.SeekOrigin.Begin)
|
||||||
|
|
||||||
|
lngPKLine = 0
|
||||||
|
lngRecordCount = 0
|
||||||
|
|
||||||
|
' -----------------------------------------------------------------------------------
|
||||||
|
' Wenn der FileName schon in der Tabelle TTRHeader existiert, die Einträge in der History verschieben.
|
||||||
|
' Die Tabellen TTRBody und TTRTrailer werden über CASCADE aktualisiert.
|
||||||
|
|
||||||
|
Dim SQLTTRHeader = "SELECT PKHistory, PKFileName, fileNumber FROM TTRHeader WHERE (PKHistory = 0) And (PKFileName = N'" & fi.Name.ToString & "') And (fileNumber = " & fi.Extension.Remove(0, 1) & ") "
|
||||||
|
Dim dtTTRHeader As DataTable = SQL.loadDgvBySql_Param(SQLTTRHeader, "ASFINAG")
|
||||||
|
|
||||||
|
If dtTTRHeader.Rows.Count > 0 Then
|
||||||
|
Dim hisorty = SQL.getValueTxtBySql("SELECT PKHistory FROM TTRHeader WHERE (PKFileName = N'" & fi.Name.ToString & "') ORDER BY PKHistory DESC", "ASFINAG")
|
||||||
|
hisorty = hisorty + 1
|
||||||
|
For Each row As DataRow In dtTTRHeader.Rows
|
||||||
|
Dim ttrHeaderArchiv As New cAsfinag.TTRHeader(row.Item("PKFileName"), row.Item("fileNumber"), "0")
|
||||||
|
ttrHeaderArchiv.PKHistory = hisorty
|
||||||
|
ttrHeaderArchiv.UPDATE("0")
|
||||||
|
Next
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
' -----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Do While (objFileRead.Peek() > -1)
|
||||||
|
Dim strZeile = objFileRead.ReadLine()
|
||||||
|
lngRecordCount = lngRecordCount + 1
|
||||||
|
|
||||||
|
Select Case Mid(strZeile, 1, 2)
|
||||||
|
Case "10"
|
||||||
|
Dim ext = CInt(fi.Extension.Remove(0, 1))
|
||||||
|
Dim ttrHeader As New cAsfinag.TTRHeader(fi.Name.ToString, ext, "0")
|
||||||
|
With ttrHeader
|
||||||
|
.PKFileName = fi.Name
|
||||||
|
.recordType = Trim(Mid(strZeile, 1, 2))
|
||||||
|
.fileVersion = Trim(Mid(strZeile, 3, 2))
|
||||||
|
.senderID = Trim(Mid(strZeile, 5, 6))
|
||||||
|
.receiverID = Trim(Mid(strZeile, 11, 6))
|
||||||
|
.fileCreationDate = DateSerial(Mid(strZeile, 17, 4), Mid(strZeile, 21, 2), Mid(strZeile, 23, 2))
|
||||||
|
.fileCreationTime = DateSerial(Mid(strZeile, 17, 4), Mid(strZeile, 21, 2), Mid(strZeile, 23, 2)) & " " & TimeSerial(Mid(strZeile, 25, 2), Mid(strZeile, 27, 2), 0)
|
||||||
|
.fileNumber = Trim(Mid(strZeile, 29, 4))
|
||||||
|
.currencyCode = Trim(Mid(strZeile, 33, 3))
|
||||||
|
.description = IIf(Trim(Mid(strZeile, 36, 25)) = "", Nothing, Trim(Mid(strZeile, 36, 25)))
|
||||||
|
.ISOCountryCode = Trim(Mid(strZeile, 61, 3))
|
||||||
|
.SAVE()
|
||||||
|
End With
|
||||||
|
|
||||||
|
Case "20"
|
||||||
|
|
||||||
|
Dim ttrBody As New cAsfinag.TTRBody(fi.Name, lngPKLine, "0")
|
||||||
|
With ttrBody
|
||||||
|
.PKFileName = fi.Name
|
||||||
|
.recordType = Trim(Mid(strZeile, 1, 2))
|
||||||
|
lngPKLine = lngPKLine + 1
|
||||||
|
.PKLine = lngPKLine
|
||||||
|
.fileVersion = Trim(Mid(strZeile, 3, 2))
|
||||||
|
.siteId = IIf(Trim(Mid(strZeile, 7, 15)) = "", Nothing, Trim(Mid(strZeile, 7, 15)))
|
||||||
|
.fileNumber = Trim(Mid(strZeile, 22, 4))
|
||||||
|
.fileCreationDate = DateSerial(Mid(strZeile, 26, 4), Mid(strZeile, 30, 2), Mid(strZeile, 32, 2))
|
||||||
|
.deliveryNoteNumber = IIf(Trim(Mid(strZeile, 35, 8)) = "", Nothing, Trim(Mid(strZeile, 35, 8)))
|
||||||
|
.cardNumber = Trim(Mid(strZeile, 43, 22))
|
||||||
|
.deliveryDate = DateSerial(Mid(strZeile, 65, 4), Mid(strZeile, 69, 2), Mid(strZeile, 71, 2))
|
||||||
|
.deliveryTime = IIf(Trim(Mid(strZeile, 73, 4)) = "", Nothing, DateSerial(Mid(strZeile, 65, 4), Mid(strZeile, 69, 2), Mid(strZeile, 71, 2)) & " " & TimeSerial(Mid(strZeile, 73, 2), Mid(strZeile, 75, 2), 0))
|
||||||
|
.transactionType = Trim(Mid(strZeile, 77, 2))
|
||||||
|
.productCode = Trim(Mid(strZeile, 79, 4))
|
||||||
|
.km = IIf(Trim(Mid(strZeile, 83, 7)) = "", Nothing, Trim(Mid(strZeile, 83, 7)))
|
||||||
|
.driverId = IIf(Trim(Mid(strZeile, 90, 4)) = "", Nothing, Trim(Mid(strZeile, 90, 4)))
|
||||||
|
.productQuantity = Trim(Mid(strZeile, 94, 6)) / 100
|
||||||
|
.amountInclVAT = Trim(Mid(strZeile, 100, 10)) / 100
|
||||||
|
.VATrate = Trim(Mid(strZeile, 155, 4)) / 100
|
||||||
|
.VATamount = Trim(Mid(strZeile, 159, 10)) / 100
|
||||||
|
.OBUID = Trim(Mid(strZeile, 130, 25))
|
||||||
|
.receiptNumber = Trim(Mid(strZeile, 110, 20))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If ttrBody.transactionType = 3 Then
|
||||||
|
' Vorzeichenänderung
|
||||||
|
ttrBody.km = 0 - ttrBody.km
|
||||||
|
ttrBody.productQuantity = 0 - ttrBody.productQuantity
|
||||||
|
ttrBody.amountInclVAT = 0 - ttrBody.amountInclVAT
|
||||||
|
ttrBody.VATamount = 0 - ttrBody.VATamount
|
||||||
|
End If
|
||||||
|
.SAVE()
|
||||||
|
|
||||||
|
End With
|
||||||
|
|
||||||
|
|
||||||
|
Case "90"
|
||||||
|
|
||||||
|
Dim ttrTrailer As New cAsfinag.TTRTrailer(fi.Name, "0")
|
||||||
|
With ttrTrailer
|
||||||
|
.PKFileName = fi.Name
|
||||||
|
.recordType = Trim(Mid(strZeile, 1, 2))
|
||||||
|
.fileVersion = Trim(Mid(strZeile, 3, 2))
|
||||||
|
'.fileNumber = Trim(Mid(strZeile, 5, 4))
|
||||||
|
.recordCount = Trim(Mid(strZeile, 5, 9))
|
||||||
|
.checksumProductQuantity = Trim(Mid(strZeile, 14, 15)) / 100
|
||||||
|
.checksumAmounntInclVAT = Trim(Mid(strZeile, 29, 15)) / 100
|
||||||
|
.SAVE()
|
||||||
|
|
||||||
|
End With
|
||||||
|
|
||||||
|
Case Else
|
||||||
|
' Andere RecordNumber überlesen.
|
||||||
|
End Select
|
||||||
|
|
||||||
|
Loop
|
||||||
|
|
||||||
|
objFileRead.Close()
|
||||||
|
|
||||||
|
Return True
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ Partial Class frmAsfinag_NachrichtenVerabeitung
|
|||||||
Me.pnl = New System.Windows.Forms.Panel()
|
Me.pnl = New System.Windows.Forms.Panel()
|
||||||
Me.lblDatenCnt = New System.Windows.Forms.Label()
|
Me.lblDatenCnt = New System.Windows.Forms.Label()
|
||||||
Me.dgvEinarbeitung = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
|
Me.dgvEinarbeitung = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
|
||||||
|
Me.clmnArt = New System.Windows.Forms.DataGridViewTextBoxColumn()
|
||||||
|
Me.Column1 = New System.Windows.Forms.DataGridViewTextBoxColumn()
|
||||||
Me.Label9 = New System.Windows.Forms.Label()
|
Me.Label9 = New System.Windows.Forms.Label()
|
||||||
Me.Button2 = New System.Windows.Forms.Button()
|
Me.Button2 = New System.Windows.Forms.Button()
|
||||||
Me.Label7 = New System.Windows.Forms.Label()
|
Me.Label7 = New System.Windows.Forms.Label()
|
||||||
@@ -38,8 +40,7 @@ Partial Class frmAsfinag_NachrichtenVerabeitung
|
|||||||
Me.btnOK = New System.Windows.Forms.Button()
|
Me.btnOK = New System.Windows.Forms.Button()
|
||||||
Me.Label2 = New System.Windows.Forms.Label()
|
Me.Label2 = New System.Windows.Forms.Label()
|
||||||
Me.Label1 = New System.Windows.Forms.Label()
|
Me.Label1 = New System.Windows.Forms.Label()
|
||||||
Me.clmnArt = New System.Windows.Forms.DataGridViewTextBoxColumn()
|
Me.lblTestsystem = New System.Windows.Forms.Label()
|
||||||
Me.Column1 = New System.Windows.Forms.DataGridViewTextBoxColumn()
|
|
||||||
Me.pnl.SuspendLayout()
|
Me.pnl.SuspendLayout()
|
||||||
CType(Me.dgvEinarbeitung, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.dgvEinarbeitung, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
Me.SuspendLayout()
|
Me.SuspendLayout()
|
||||||
@@ -64,6 +65,7 @@ Partial Class frmAsfinag_NachrichtenVerabeitung
|
|||||||
'
|
'
|
||||||
Me.pnl.BackColor = System.Drawing.Color.White
|
Me.pnl.BackColor = System.Drawing.Color.White
|
||||||
Me.pnl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
|
Me.pnl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
|
||||||
|
Me.pnl.Controls.Add(Me.lblTestsystem)
|
||||||
Me.pnl.Controls.Add(Me.lblDatenCnt)
|
Me.pnl.Controls.Add(Me.lblDatenCnt)
|
||||||
Me.pnl.Controls.Add(Me.dgvEinarbeitung)
|
Me.pnl.Controls.Add(Me.dgvEinarbeitung)
|
||||||
Me.pnl.Controls.Add(Me.Label9)
|
Me.pnl.Controls.Add(Me.Label9)
|
||||||
@@ -111,6 +113,18 @@ Partial Class frmAsfinag_NachrichtenVerabeitung
|
|||||||
Me.dgvEinarbeitung.Size = New System.Drawing.Size(291, 145)
|
Me.dgvEinarbeitung.Size = New System.Drawing.Size(291, 145)
|
||||||
Me.dgvEinarbeitung.TabIndex = 18
|
Me.dgvEinarbeitung.TabIndex = 18
|
||||||
'
|
'
|
||||||
|
'clmnArt
|
||||||
|
'
|
||||||
|
Me.clmnArt.HeaderText = "Dateiname"
|
||||||
|
Me.clmnArt.Name = "clmnArt"
|
||||||
|
Me.clmnArt.Width = 150
|
||||||
|
'
|
||||||
|
'Column1
|
||||||
|
'
|
||||||
|
Me.Column1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill
|
||||||
|
Me.Column1.HeaderText = "Status"
|
||||||
|
Me.Column1.Name = "Column1"
|
||||||
|
'
|
||||||
'Label9
|
'Label9
|
||||||
'
|
'
|
||||||
Me.Label9.AutoSize = True
|
Me.Label9.AutoSize = True
|
||||||
@@ -212,17 +226,17 @@ Partial Class frmAsfinag_NachrichtenVerabeitung
|
|||||||
Me.Label1.TabIndex = 8
|
Me.Label1.TabIndex = 8
|
||||||
Me.Label1.Text = "Einarbeitung:"
|
Me.Label1.Text = "Einarbeitung:"
|
||||||
'
|
'
|
||||||
'clmnArt
|
'lblTestsystem
|
||||||
'
|
'
|
||||||
Me.clmnArt.HeaderText = "Dateiname"
|
Me.lblTestsystem.AutoSize = True
|
||||||
Me.clmnArt.Name = "clmnArt"
|
Me.lblTestsystem.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
Me.clmnArt.Width = 150
|
Me.lblTestsystem.ForeColor = System.Drawing.Color.Red
|
||||||
'
|
Me.lblTestsystem.Location = New System.Drawing.Point(274, 8)
|
||||||
'Column1
|
Me.lblTestsystem.Name = "lblTestsystem"
|
||||||
'
|
Me.lblTestsystem.Size = New System.Drawing.Size(89, 13)
|
||||||
Me.Column1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill
|
Me.lblTestsystem.TabIndex = 20
|
||||||
Me.Column1.HeaderText = "Status"
|
Me.lblTestsystem.Text = "TESTSYSTEM"
|
||||||
Me.Column1.Name = "Column1"
|
Me.lblTestsystem.Visible = False
|
||||||
'
|
'
|
||||||
'frmAsfinag_NachrichtenVerabeitung
|
'frmAsfinag_NachrichtenVerabeitung
|
||||||
'
|
'
|
||||||
@@ -257,4 +271,5 @@ Partial Class frmAsfinag_NachrichtenVerabeitung
|
|||||||
Friend WithEvents lblDatenCnt As Label
|
Friend WithEvents lblDatenCnt As Label
|
||||||
Friend WithEvents clmnArt As DataGridViewTextBoxColumn
|
Friend WithEvents clmnArt As DataGridViewTextBoxColumn
|
||||||
Friend WithEvents Column1 As DataGridViewTextBoxColumn
|
Friend WithEvents Column1 As DataGridViewTextBoxColumn
|
||||||
|
Friend WithEvents lblTestsystem As Label
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -15,15 +15,9 @@ Public Class frmAsfinag_NachrichtenVerabeitung
|
|||||||
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
||||||
Dim allowClose = False
|
Dim allowClose = False
|
||||||
' Dim DY_PFAD = "C:\Users\DEVELOPER1\Desktop\test\TEST\"
|
' Dim DY_PFAD = "C:\Users\DEVELOPER1\Desktop\test\TEST\"
|
||||||
|
|
||||||
Dim ASFINAG_PFAD = "" '"C:\Users\DEVELOPER1\Desktop\test\TEST\Nachrichtendaten_Einarbeitung\"
|
|
||||||
Dim VERARBEITUNGS_PFAD = "" '"C:\Users\DEVELOPER1\Desktop\test\TEST\Nachrichtendaten_Einarbeitung\"
|
|
||||||
Dim ZIEL_PFAD = "" '"C:\Users\DEVELOPER1\Desktop\test\TEST\Nachrichtendaten_Ablage\"
|
|
||||||
Dim ERROR_PFAD = "" '"C:\Users\DEVELOPER1\Desktop\test\TEST\Nachrichtendaten_ERROR\"
|
|
||||||
Dim PARTNERSYSTEM = "ASFINAG"
|
Dim PARTNERSYSTEM = "ASFINAG"
|
||||||
Dim SERVER_Path = ""
|
|
||||||
Dim SERVER_Path_TEST = ""
|
|
||||||
Dim FileType As String
|
Dim FileType As String
|
||||||
|
Dim asfinag As New cAsfinag()
|
||||||
|
|
||||||
Dim Dateiname = ""
|
Dim Dateiname = ""
|
||||||
|
|
||||||
@@ -45,39 +39,27 @@ Public Class frmAsfinag_NachrichtenVerabeitung
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub initPfade()
|
|
||||||
Me.SERVER_Path = cAsfinag.Paramter.GET_PARAM_ByName("SERVER_Path_In", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
|
||||||
Me.SERVER_Path_TEST = cAsfinag.Paramter.GET_PARAM_ByName("SERVER_Path_In_Test", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
|
||||||
Me.ASFINAG_PFAD = cAsfinag.Paramter.GET_PARAM_ByName("BEREITSTELLUNGS_PFAD", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
|
||||||
Me.VERARBEITUNGS_PFAD = cAsfinag.Paramter.GET_PARAM_ByName("VERARBEITUNGS_PFAD", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
|
||||||
Me.ZIEL_PFAD = cAsfinag.Paramter.GET_PARAM_ByName("ZIEL_PFAD", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
|
||||||
Me.ERROR_PFAD = cAsfinag.Paramter.GET_PARAM_ByName("ERROR_PFAD", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
|
||||||
|
|
||||||
If Not IO.Directory.Exists(VERARBEITUNGS_PFAD) Then IO.Directory.CreateDirectory(VERARBEITUNGS_PFAD)
|
|
||||||
If Not IO.Directory.Exists(ZIEL_PFAD) Then IO.Directory.CreateDirectory(ZIEL_PFAD)
|
|
||||||
If Not IO.Directory.Exists(ERROR_PFAD) Then IO.Directory.CreateDirectory(ERROR_PFAD)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'Me.BOX_VERSION = NCTSTR_Worker.cDY_Paramter.GET_PARAM_ByName("BOX_VERSION", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
|
||||||
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
|
|
||||||
Private Sub frmDYNachrichtenVerarbeitung_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Private Sub frmDYNachrichtenVerarbeitung_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
initPfade()
|
lblTestsystem.Visible = VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM
|
||||||
|
asfinag.initImportPfade()
|
||||||
|
|
||||||
If FileType <> "" Then
|
If FileType <> "" Then
|
||||||
|
|
||||||
Label2.Text &= " " & FileType.ToUpper
|
Label2.Text &= " " & FileType.ToUpper
|
||||||
|
|
||||||
For Each d In System.IO.Directory.GetFiles(VERARBEITUNGS_PFAD)
|
For Each d In System.IO.Directory.GetFiles(asfinag.VERARBEITUNG_PFAD)
|
||||||
Dim filename = frmStartOptions.cut_file(d)
|
Dim filename = frmStartOptions.cut_file(d)
|
||||||
If filename.ToLower.Contains(FileType) Then
|
If filename.ToLower.Contains(FileType) Then
|
||||||
|
Dim targetsystem As String = "nicht definiert"
|
||||||
|
If filename.Substring(0, 1) = "T" Then
|
||||||
|
targetsystem = "Test"
|
||||||
|
ElseIf filename.Substring(0, 1) = "L" Then
|
||||||
|
targetsystem = "Produktiv"
|
||||||
|
End If
|
||||||
ListBox3.Items.Add(filename)
|
ListBox3.Items.Add(filename)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Me.Refresh()
|
Me.Refresh()
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -86,8 +68,18 @@ Public Class frmAsfinag_NachrichtenVerabeitung
|
|||||||
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
|
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
|
||||||
Me.Enabled = False
|
Me.Enabled = False
|
||||||
Try
|
Try
|
||||||
|
Dim stringLIst As New List(Of String)
|
||||||
Label9.Visible = True
|
Label9.Visible = True
|
||||||
Dim cnt = getNachrichtenDatenFromFTP()
|
Dim cnt = asfinag.getNachrichtenDatenFromFTP(stringLIst, FileType)
|
||||||
|
For Each s In stringLIst
|
||||||
|
Dim targetsystem As String = "nicht definiert"
|
||||||
|
If s.Substring(0, 1) = "T" Then
|
||||||
|
targetsystem = "Test"
|
||||||
|
ElseIf s.Substring(0, 1) = "L" Then
|
||||||
|
targetsystem = "Produktiv"
|
||||||
|
End If
|
||||||
|
ListBox3.Items.Add(s)
|
||||||
|
Next
|
||||||
Label9.Text = cnt & " Datensätze empfangen."
|
Label9.Text = cnt & " Datensätze empfangen."
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
@@ -117,56 +109,6 @@ Public Class frmAsfinag_NachrichtenVerabeitung
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Function getNachrichtenDatenFromFTP() As Integer
|
|
||||||
Dim cnt = 0
|
|
||||||
Try
|
|
||||||
Dim SERVERPath = ""
|
|
||||||
|
|
||||||
If VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then
|
|
||||||
|
|
||||||
SERVERPath = Me.SERVER_Path '"\\ftps.verag.ag\FTP\MAVI\IN\"
|
|
||||||
Else
|
|
||||||
|
|
||||||
SERVERPath = Me.SERVER_Path_TEST '"\\ftps.verag.ag\FTP\MAVI\IN\"
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
For Each f In IO.Directory.GetFiles(SERVER_Path)
|
|
||||||
Dim fi As New IO.FileInfo(f)
|
|
||||||
If fi.Name.ToLower.Contains(FileType) Then
|
|
||||||
If Not fi.Name.StartsWith(".") Then
|
|
||||||
Dim zielPfad = VERARBEITUNGS_PFAD & "\" & fi.Name
|
|
||||||
While IO.File.Exists(zielPfad)
|
|
||||||
zielPfad = VERARBEITUNGS_PFAD & "\" & Now.ToString("yyyyMMdd_HHmmss_") & fi.Name
|
|
||||||
End While
|
|
||||||
IO.File.Copy(f, zielPfad)
|
|
||||||
If Not VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then
|
|
||||||
If IO.File.Exists(zielPfad) Then IO.File.Delete(f)
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim filename = frmStartOptions.cut_file((New FileInfo(zielPfad)).Name)
|
|
||||||
If filename.ToLower.Contains(FileType) Then
|
|
||||||
ListBox3.Items.Add(filename)
|
|
||||||
cnt += 1
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
Next
|
|
||||||
|
|
||||||
|
|
||||||
Return cnt
|
|
||||||
|
|
||||||
Catch ex As Exception
|
|
||||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
|
||||||
End Try
|
|
||||||
|
|
||||||
Return cnt
|
|
||||||
End Function
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Sub DatenEinlesen()
|
Sub DatenEinlesen()
|
||||||
|
|
||||||
VERAG_PROG_ALLGEMEIN.cAllgemein.ERR_OP_GLOBAL = VERAG_PROG_ALLGEMEIN.ERROR_OP.SHOW
|
VERAG_PROG_ALLGEMEIN.cAllgemein.ERR_OP_GLOBAL = VERAG_PROG_ALLGEMEIN.ERROR_OP.SHOW
|
||||||
@@ -178,7 +120,7 @@ Public Class frmAsfinag_NachrichtenVerabeitung
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
For Each d In System.IO.Directory.GetFiles(VERARBEITUNGS_PFAD)
|
For Each d In System.IO.Directory.GetFiles(asfinag.VERARBEITUNG_PFAD)
|
||||||
|
|
||||||
Try
|
Try
|
||||||
Dim correctFile As Boolean = False
|
Dim correctFile As Boolean = False
|
||||||
@@ -214,7 +156,7 @@ Public Class frmAsfinag_NachrichtenVerabeitung
|
|||||||
|
|
||||||
ElseIf FileType = "clf" Then
|
ElseIf FileType = "clf" Then
|
||||||
|
|
||||||
If readAndSaveCLF(objFileRead, fi) Then
|
If asfinag.readAndSaveCLF(objFileRead, fi) Then
|
||||||
addDGVEinarbeitung(fi.Name, "OK")
|
addDGVEinarbeitung(fi.Name, "OK")
|
||||||
found = True
|
found = True
|
||||||
Else
|
Else
|
||||||
@@ -224,7 +166,7 @@ Public Class frmAsfinag_NachrichtenVerabeitung
|
|||||||
|
|
||||||
ElseIf FileType = "ttr" Then
|
ElseIf FileType = "ttr" Then
|
||||||
|
|
||||||
If readAndSaveTTR(objFileRead, fi) Then
|
If asfinag.readAndSaveTTR(objFileRead, fi) Then
|
||||||
addDGVEinarbeitung(fi.Name, "OK")
|
addDGVEinarbeitung(fi.Name, "OK")
|
||||||
found = True
|
found = True
|
||||||
Else
|
Else
|
||||||
@@ -236,12 +178,14 @@ Public Class frmAsfinag_NachrichtenVerabeitung
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If found Then
|
If found Then
|
||||||
If Not IO.Directory.Exists(ZIEL_PFAD & "\" & Now.Year & "\" & Now.ToString("MMdd") & "\") Then IO.Directory.CreateDirectory(ZIEL_PFAD & "\" & Now.Year & "\" & Now.ToString("MMdd") & "\")
|
If Not IO.Directory.Exists(asfinag.ARCHIV_PFAD & "\" & Now.Year & "\" & Now.ToString("MMdd") & "\") Then IO.Directory.CreateDirectory(asfinag.ARCHIV_PFAD & "\" & Now.Year & "\" & Now.ToString("MMdd") & "\")
|
||||||
frmStartOptions.moveFile(d, ZIEL_PFAD & "\" & Now.Year & "\" & Now.ToString("MMdd") & "\", VERARBEITUNGS_PFAD)
|
frmStartOptions.moveFile(d, asfinag.ARCHIV_PFAD & "\" & Now.Year & "\" & Now.ToString("MMdd") & "\", asfinag.VERARBEITUNG_PFAD)
|
||||||
cntDatenEingelesen += 1
|
cntDatenEingelesen += 1
|
||||||
Else
|
Else
|
||||||
If Not found Then
|
If Not found Then
|
||||||
frmStartOptions.moveFile(d, ERROR_PFAD, VERARBEITUNGS_PFAD) ' nciht gefunden, oder durch ERROR nicht eingearbt,.
|
If Not IO.Directory.Exists(asfinag.ERROR_PFAD & "\" & Now.Year & "\" & Now.ToString("MMdd") & "\") Then IO.Directory.CreateDirectory(asfinag.ERROR_PFAD & "\" & Now.Year & "\" & Now.ToString("MMdd") & "\")
|
||||||
|
frmStartOptions.moveFile(d, asfinag.ERROR_PFAD & "\" & Now.Year & "\" & Now.ToString("MMdd") & "\", asfinag.VERARBEITUNG_PFAD)
|
||||||
|
' nciht gefunden, oder durch ERROR nicht eingearbt,.
|
||||||
dsNichtErkannt += 1
|
dsNichtErkannt += 1
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -276,357 +220,6 @@ Public Class frmAsfinag_NachrichtenVerabeitung
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Public Function readAndSaveCLF(objFileRead As StreamReader, fi As FileInfo) As Boolean
|
|
||||||
|
|
||||||
Dim booHeaderVorhanden = False
|
|
||||||
Dim booPrüfziffernfehler = False
|
|
||||||
Dim booInTransaktion = False
|
|
||||||
Dim booTrailerVorhanden = False
|
|
||||||
|
|
||||||
Dim lngPKLine As Long = 0
|
|
||||||
Dim lngRecordCount As Long
|
|
||||||
|
|
||||||
Do While (objFileRead.Peek() > -1)
|
|
||||||
Dim strZeile = objFileRead.ReadLine()
|
|
||||||
lngRecordCount = lngRecordCount + 1
|
|
||||||
|
|
||||||
Select Case Mid(strZeile, 1, 2)
|
|
||||||
Case "10"
|
|
||||||
booHeaderVorhanden = True
|
|
||||||
Dim ext = CInt(fi.Extension.Remove(0, 1))
|
|
||||||
Dim clfHeader As New cAsfinag.CLFHeader(fi.Name.ToString, ext)
|
|
||||||
With clfHeader
|
|
||||||
.PKFileName = fi.Name
|
|
||||||
.recordType = Mid(strZeile, 1, 2)
|
|
||||||
.fileVersion = Mid(strZeile, 3, 2)
|
|
||||||
.indcator = Trim(Mid(strZeile, 9, 1))
|
|
||||||
.senderID = Trim(Mid(strZeile, 10, 6))
|
|
||||||
.receiverID = Trim(Mid(strZeile, 16, 6))
|
|
||||||
.fileCreationDate = DateSerial(Mid(strZeile, 22, 4), Mid(strZeile, 26, 2), Mid(strZeile, 28, 2))
|
|
||||||
.fileCreationTime = Now()
|
|
||||||
'.fileCreationTime = DateSerial(Mid(strZeile, 22, 4), Mid(strZeile, 26, 2), Mid(strZeile, 28, 2)) & " " & TimeSerial(Mid(strZeile, 30, 2), Mid(strZeile, 32, 2), Mid(strZeile, 34, 2))
|
|
||||||
.ISOCountryCode = Trim(Mid(strZeile, 62, 3))
|
|
||||||
.SAVE()
|
|
||||||
End With
|
|
||||||
|
|
||||||
Case "20"
|
|
||||||
' Meldung bei nicht vorhandenen Haeder.
|
|
||||||
If Not booHeaderVorhanden Then
|
|
||||||
MsgBox("Datei kann wegen fehlenden Header nicht verarbeitet werden.")
|
|
||||||
objFileRead.Close()
|
|
||||||
Return False
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim clfBody As New cAsfinag.CLFBody(fi.Name, lngPKLine)
|
|
||||||
With clfBody
|
|
||||||
.PKFileName = fi.Name
|
|
||||||
lngPKLine = lngPKLine + 1
|
|
||||||
.RecordType = Trim(Mid(strZeile, 1, 2))
|
|
||||||
.fileVersion = Trim(Mid(strZeile, 3, 2))
|
|
||||||
.fileNumber = Trim(Mid(strZeile, 5, 3))
|
|
||||||
.cardNumber = Trim(Mid(strZeile, 9, 22))
|
|
||||||
.validTo = Trim(Mid(strZeile, 31, 4))
|
|
||||||
.OBUID = Trim(Mid(strZeile, 35, 18))
|
|
||||||
.vehicleLicensePlate = Trim(Mid(strZeile, 53, 10))
|
|
||||||
.nationality = Trim(Mid(strZeile, 63, 3))
|
|
||||||
.vehicleCategory = Trim(Mid(strZeile, 66, 1))
|
|
||||||
.emissionCategory = Trim(Mid(strZeile, 67, 2))
|
|
||||||
.status = Trim(Mid(strZeile, 69, 2))
|
|
||||||
.contractDate = DateSerial(Mid(strZeile, 71, 4), Mid(strZeile, 75, 2), Mid(strZeile, 77, 2))
|
|
||||||
.SAVE()
|
|
||||||
End With
|
|
||||||
'CardNumber prüfen.
|
|
||||||
If (Right(clfBody.cardNumber, 1)) <> cAsfinag.fktMod10Prüfziffer(Left(clfBody.cardNumber, Len(clfBody.cardNumber) - 1)) Then
|
|
||||||
booPrüfziffernfehler = True
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
'strSQL = "SELECT * FROM CLFArchiv WHERE (OBUID = N'" & Trim(Mid(strZeile, 37, 18)) & "')"
|
|
||||||
'rstCLFArchiv.Open strSQL, cnnASFINAG, adOpenStatic, adLockOptimistic, adCmdText
|
|
||||||
|
|
||||||
|
|
||||||
'With rstCLFArchiv
|
|
||||||
' If .EOF Then
|
|
||||||
' .AddNew
|
|
||||||
' !OBUID = Trim(Mid(strZeile, 37, 18))
|
|
||||||
' End If
|
|
||||||
' !FileName = strPKFileName
|
|
||||||
' !RecordType = Trim(Mid(strZeile, 1, 2))
|
|
||||||
' !RunNumber = Trim(Mid(strZeile, 3, 8))
|
|
||||||
' !CardNumber = Trim(Mid(strZeile, 11, 22))
|
|
||||||
' !ValidTo = Trim(Mid(strZeile, 33, 4))
|
|
||||||
' !KfzKennzeichen = Trim(Mid(strZeile, 55, 10))
|
|
||||||
' !Nationalität = Trim(Mid(strZeile, 65, 3))
|
|
||||||
' !Kategorie = Trim(Mid(strZeile, 68, 1))
|
|
||||||
' !Schadstoffklasse = Trim(Mid(strZeile, 69, 2))
|
|
||||||
' !Status = Trim(Mid(strZeile, 71, 2))
|
|
||||||
' !DatumVertragsabschluss = DateSerial(Mid(strZeile, 73, 4), Mid(strZeile, 77, 2), Mid(strZeile, 79, 2))
|
|
||||||
' .Update
|
|
||||||
' .Close
|
|
||||||
'End With
|
|
||||||
|
|
||||||
' Meldung bei Prüfziffernfehler.
|
|
||||||
If booPrüfziffernfehler Then
|
|
||||||
MsgBox("Prüfziffernfehler in Zeile " & CStr(lngRecordCount) & vbCrLf & "Datei kann nicht verarbeitet werden. " & vbNewLine & " " & fi.Name.ToString)
|
|
||||||
booInTransaktion = False
|
|
||||||
Return False
|
|
||||||
|
|
||||||
End If
|
|
||||||
Case "90"
|
|
||||||
' Meldung bei nicht vorhandenen Haeder.
|
|
||||||
If Not booHeaderVorhanden Then
|
|
||||||
MsgBox("Datei kann wegen fehlenden Header nicht verarbeitet werden.")
|
|
||||||
objFileRead.Close()
|
|
||||||
Return False
|
|
||||||
End If
|
|
||||||
|
|
||||||
booTrailerVorhanden = True
|
|
||||||
Dim clfTrailer As New cAsfinag.CLFTrailer(fi.Name)
|
|
||||||
|
|
||||||
With clfTrailer
|
|
||||||
.PKFileName = fi.Name
|
|
||||||
.recordType = Trim(Mid(strZeile, 1, 2))
|
|
||||||
.fileVersion = Trim(Mid(strZeile, 3, 2))
|
|
||||||
.fileNumber = Trim(Mid(strZeile, 5, 4))
|
|
||||||
.recordCount = Trim(Mid(strZeile, 9, 7))
|
|
||||||
.SAVE()
|
|
||||||
End With
|
|
||||||
' Prüfsumme Anzahl der Sätze im File ohne Header und Trailer.
|
|
||||||
If clfTrailer.recordCount <> (lngRecordCount) Then
|
|
||||||
MsgBox("Record Count: " & clfTrailer.recordCount & vbCrLf & "Prüfsumme: " & (lngRecordCount) & vbCrLf)
|
|
||||||
objFileRead.Close()
|
|
||||||
Return False
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
' Meldung bei Prüfsummenfehler.
|
|
||||||
If booPrüfziffernfehler Then
|
|
||||||
MsgBox("Datei kann wegen Prüfsummenfehler nicht verarbeitet werden.")
|
|
||||||
objFileRead.Close()
|
|
||||||
' MsgBox strPrompt, , strPKFileName
|
|
||||||
' ' Zurücksetzen der Transaktion.
|
|
||||||
'cnnASFINAG.RollbackTrans
|
|
||||||
' booInTransaktion = False
|
|
||||||
End If
|
|
||||||
Case Else
|
|
||||||
' Andere RecordNumber überlesen.
|
|
||||||
End Select
|
|
||||||
|
|
||||||
Loop
|
|
||||||
|
|
||||||
objFileRead.Close()
|
|
||||||
|
|
||||||
Return True
|
|
||||||
|
|
||||||
End Function
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Public Function readAndSaveTTR(objFileRead As StreamReader, fi As FileInfo) As Boolean
|
|
||||||
|
|
||||||
Dim booHeaderVorhanden = False
|
|
||||||
Dim booPrüfziffernfehler = False
|
|
||||||
Dim booInTransaktion = False
|
|
||||||
Dim booTrailerVorhanden = False
|
|
||||||
Dim dblCheckSumQuantity As Double
|
|
||||||
Dim curCheckSumAmount As Double
|
|
||||||
|
|
||||||
Dim lngPKLine As Long = 0
|
|
||||||
Dim lngRecordCount As Long
|
|
||||||
|
|
||||||
Do While (objFileRead.Peek() > -1)
|
|
||||||
Dim strZeile = objFileRead.ReadLine()
|
|
||||||
lngRecordCount = lngRecordCount + 1
|
|
||||||
|
|
||||||
Select Case Mid(strZeile, 1, 2)
|
|
||||||
Case "10"
|
|
||||||
booHeaderVorhanden = True
|
|
||||||
Dim ext = CInt(fi.Extension.Remove(0, 1))
|
|
||||||
Dim ttrHeader As New cAsfinag.TTRHeader(fi.Name.ToString, ext)
|
|
||||||
With ttrHeader
|
|
||||||
.PKFileName = fi.Name
|
|
||||||
.recordType = Trim(Mid(strZeile, 1, 2))
|
|
||||||
.fileVersion = Trim(Mid(strZeile, 3, 2))
|
|
||||||
.senderID = Trim(Mid(strZeile, 5, 6))
|
|
||||||
.receiverID = Trim(Mid(strZeile, 11, 6))
|
|
||||||
.fileCreationDate = DateSerial(Mid(strZeile, 17, 4), Mid(strZeile, 21, 2), Mid(strZeile, 23, 2))
|
|
||||||
.fileCreationTime = DateSerial(Mid(strZeile, 17, 4), Mid(strZeile, 21, 2), Mid(strZeile, 23, 2)) & " " & TimeSerial(Mid(strZeile, 25, 2), Mid(strZeile, 27, 2), 0)
|
|
||||||
.fileNumber = Trim(Mid(strZeile, 29, 4))
|
|
||||||
.currencyCode = Trim(Mid(strZeile, 33, 3))
|
|
||||||
.description = IIf(Trim(Mid(strZeile, 36, 25)) = "", Nothing, Trim(Mid(strZeile, 36, 25)))
|
|
||||||
.ISOCountryCode = Trim(Mid(strZeile, 61, 3))
|
|
||||||
.SAVE()
|
|
||||||
End With
|
|
||||||
|
|
||||||
Case "20"
|
|
||||||
' Meldung bei nicht vorhandenen Haeder.
|
|
||||||
If Not booHeaderVorhanden Then
|
|
||||||
MsgBox("Datei kann wegen fehlenden Header nicht verarbeitet werden.")
|
|
||||||
objFileRead.Close()
|
|
||||||
Return False
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
Dim ttrBody As New cAsfinag.TTRBody(fi.Name, lngPKLine)
|
|
||||||
|
|
||||||
With ttrBody
|
|
||||||
.PKFileName = fi.Name
|
|
||||||
.recordType = Trim(Mid(strZeile, 1, 2))
|
|
||||||
lngPKLine = lngPKLine + 1
|
|
||||||
.PKLine = lngPKLine
|
|
||||||
.fileVersion = Trim(Mid(strZeile, 3, 2))
|
|
||||||
.siteId = IIf(Trim(Mid(strZeile, 7, 15)) = "", Nothing, Trim(Mid(strZeile, 7, 15)))
|
|
||||||
.fileNumber = Trim(Mid(strZeile, 22, 4))
|
|
||||||
.fileCreationDate = DateSerial(Mid(strZeile, 26, 4), Mid(strZeile, 30, 2), Mid(strZeile, 32, 2))
|
|
||||||
.deliveryNoteNumber = IIf(Trim(Mid(strZeile, 35, 8)) = "", Nothing, Trim(Mid(strZeile, 35, 8)))
|
|
||||||
.cardNumber = Trim(Mid(strZeile, 43, 22))
|
|
||||||
.deliveryDate = DateSerial(Mid(strZeile, 65, 4), Mid(strZeile, 69, 2), Mid(strZeile, 71, 2))
|
|
||||||
.deliveryTime = IIf(Trim(Mid(strZeile, 73, 4)) = "", Nothing, DateSerial(Mid(strZeile, 65, 4), Mid(strZeile, 69, 2), Mid(strZeile, 71, 2)) & " " & TimeSerial(Mid(strZeile, 73, 2), Mid(strZeile, 75, 2), 0))
|
|
||||||
.transactionType = Trim(Mid(strZeile, 77, 2))
|
|
||||||
.productCode = Trim(Mid(strZeile, 79, 4))
|
|
||||||
.km = IIf(Trim(Mid(strZeile, 83, 7)) = "", Nothing, Trim(Mid(strZeile, 83, 7)))
|
|
||||||
.driverId = IIf(Trim(Mid(strZeile, 90, 4)) = "", Nothing, Trim(Mid(strZeile, 90, 4)))
|
|
||||||
.productQuantity = Trim(Mid(strZeile, 94, 6)) / 100
|
|
||||||
.amountInclVAT = Trim(Mid(strZeile, 100, 10)) / 100
|
|
||||||
.VATrate = Trim(Mid(strZeile, 155, 4)) / 100
|
|
||||||
.VATamount = Trim(Mid(strZeile, 159, 10)) / 100
|
|
||||||
.OBUID = Trim(Mid(strZeile, 130, 25))
|
|
||||||
.receiptNumber = Trim(Mid(strZeile, 110, 20))
|
|
||||||
|
|
||||||
' Bei den Checksummen wird unabhängig vom TransactionType immer der positive Betrag aufsummiert.
|
|
||||||
dblCheckSumQuantity = dblCheckSumQuantity + ttrBody.productQuantity
|
|
||||||
curCheckSumAmount = curCheckSumAmount + ttrBody.amountInclVAT
|
|
||||||
' Bei TransactionType 03 .......Credit-Transaktion (negativ)
|
|
||||||
|
|
||||||
If ttrBody.transactionType = 3 Then
|
|
||||||
' Vorzeichenänderung
|
|
||||||
ttrBody.km = 0 - ttrBody.km
|
|
||||||
ttrBody.productQuantity = 0 - ttrBody.productQuantity
|
|
||||||
ttrBody.amountInclVAT = 0 - ttrBody.amountInclVAT
|
|
||||||
ttrBody.VATamount = 0 - ttrBody.VATamount
|
|
||||||
End If
|
|
||||||
|
|
||||||
' CardNumber prüfen.
|
|
||||||
If (Right(ttrBody.cardNumber, 1)) <> (fktMod10Prüfziffer(Left(ttrBody.cardNumber, Len(ttrBody.cardNumber) - 1))) Then
|
|
||||||
booPrüfziffernfehler = True
|
|
||||||
End If
|
|
||||||
.SAVE()
|
|
||||||
|
|
||||||
End With
|
|
||||||
|
|
||||||
'strSQL = "SELECT * FROM CLFArchiv WHERE (OBUID = N'" & Trim(Mid(strZeile, 37, 18)) & "')"
|
|
||||||
'rstCLFArchiv.Open strSQL, cnnASFINAG, adOpenStatic, adLockOptimistic, adCmdText
|
|
||||||
|
|
||||||
|
|
||||||
'With rstCLFArchiv
|
|
||||||
' If .EOF Then
|
|
||||||
' .AddNew
|
|
||||||
' !OBUID = Trim(Mid(strZeile, 37, 18))
|
|
||||||
' End If
|
|
||||||
' !FileName = strPKFileName
|
|
||||||
' !RecordType = Trim(Mid(strZeile, 1, 2))
|
|
||||||
' !RunNumber = Trim(Mid(strZeile, 3, 8))
|
|
||||||
' !CardNumber = Trim(Mid(strZeile, 11, 22))
|
|
||||||
' !ValidTo = Trim(Mid(strZeile, 33, 4))
|
|
||||||
' !KfzKennzeichen = Trim(Mid(strZeile, 55, 10))
|
|
||||||
' !Nationalität = Trim(Mid(strZeile, 65, 3))
|
|
||||||
' !Kategorie = Trim(Mid(strZeile, 68, 1))
|
|
||||||
' !Schadstoffklasse = Trim(Mid(strZeile, 69, 2))
|
|
||||||
' !Status = Trim(Mid(strZeile, 71, 2))
|
|
||||||
' !DatumVertragsabschluss = DateSerial(Mid(strZeile, 73, 4), Mid(strZeile, 77, 2), Mid(strZeile, 79, 2))
|
|
||||||
' .Update
|
|
||||||
' .Close
|
|
||||||
'End With
|
|
||||||
|
|
||||||
' Meldung bei Prüfziffernfehler.
|
|
||||||
If booPrüfziffernfehler Then
|
|
||||||
MsgBox("Prüfziffernfehler in Zeile " & CStr(lngRecordCount) & vbCrLf & "Datei kann nicht verarbeitet werden. " & vbNewLine & " " & fi.Name.ToString)
|
|
||||||
booInTransaktion = False
|
|
||||||
objFileRead.Close()
|
|
||||||
Return False
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
Case "90"
|
|
||||||
' Meldung bei nicht vorhandenen Haeder.
|
|
||||||
If Not booHeaderVorhanden Then
|
|
||||||
MsgBox("Datei kann wegen fehlenden Header nicht verarbeitet werden.")
|
|
||||||
objFileRead.Close()
|
|
||||||
Return False
|
|
||||||
End If
|
|
||||||
|
|
||||||
booTrailerVorhanden = True
|
|
||||||
|
|
||||||
|
|
||||||
Dim ttrTrailer As New cAsfinag.TTRTrailer(fi.Name)
|
|
||||||
With ttrTrailer
|
|
||||||
.PKFileName = fi.Name
|
|
||||||
.recordType = Trim(Mid(strZeile, 1, 2))
|
|
||||||
.fileVersion = Trim(Mid(strZeile, 3, 2))
|
|
||||||
'.fileNumber = Trim(Mid(strZeile, 5, 4))
|
|
||||||
.recordCount = Trim(Mid(strZeile, 5, 9))
|
|
||||||
.checksumProductQuantity = Trim(Mid(strZeile, 14, 15)) / 100
|
|
||||||
.checksumAmounntInclVAT = Trim(Mid(strZeile, 29, 15)) / 100
|
|
||||||
.SAVE()
|
|
||||||
|
|
||||||
Dim strPrompt
|
|
||||||
If ttrTrailer.recordCount <> lngRecordCount Then
|
|
||||||
strPrompt = strPrompt & "Record Count: " & ttrTrailer.recordCount & vbCrLf &
|
|
||||||
"Prüfsumme: " & lngRecordCount & vbCrLf
|
|
||||||
End If
|
|
||||||
' Prüfsumme Menge.
|
|
||||||
If ttrTrailer.checksumProductQuantity <> dblCheckSumQuantity Then
|
|
||||||
strPrompt = strPrompt & "Check Sum Quantity: " & ttrTrailer.checksumProductQuantity & vbCrLf &
|
|
||||||
"Prüfsumme: " & dblCheckSumQuantity & vbCrLf
|
|
||||||
End If
|
|
||||||
' Prüfsumme Betrag.
|
|
||||||
If ttrTrailer.checksumAmounntInclVAT <> Math.Round(curCheckSumAmount, 2) Then
|
|
||||||
strPrompt = strPrompt & "Check Sum Amount: " & ttrTrailer.checksumAmounntInclVAT & vbCrLf &
|
|
||||||
"Prüfsumme: " & curCheckSumAmount & vbCrLf
|
|
||||||
End If
|
|
||||||
|
|
||||||
If strPrompt <> "" Then
|
|
||||||
MsgBox(strPrompt)
|
|
||||||
objFileRead.Close()
|
|
||||||
Return False
|
|
||||||
End If
|
|
||||||
|
|
||||||
End With
|
|
||||||
' Prüfsumme Anzahl der Sätze im File ohne Header und Trailer.
|
|
||||||
|
|
||||||
If ttrTrailer.recordCount <> (lngRecordCount) Then
|
|
||||||
MsgBox("Record Count: " & ttrTrailer.recordCount & vbCrLf & "Prüfsumme: " & (lngRecordCount) & vbCrLf)
|
|
||||||
objFileRead.Close()
|
|
||||||
Return False
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
' Meldung bei Prüfsummenfehler.
|
|
||||||
If booPrüfziffernfehler Then
|
|
||||||
MsgBox("Datei kann wegen Prüfsummenfehler nicht verarbeitet werden.")
|
|
||||||
objFileRead.Close()
|
|
||||||
Return False
|
|
||||||
' MsgBox strPrompt, , strPKFileName
|
|
||||||
' ' Zurücksetzen der Transaktion.
|
|
||||||
'cnnASFINAG.RollbackTrans
|
|
||||||
' booInTransaktion = False
|
|
||||||
End If
|
|
||||||
Case Else
|
|
||||||
' Andere RecordNumber überlesen.
|
|
||||||
End Select
|
|
||||||
|
|
||||||
Loop
|
|
||||||
|
|
||||||
objFileRead.Close()
|
|
||||||
|
|
||||||
Return True
|
|
||||||
|
|
||||||
End Function
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Private Sub dgvEinarbeitung_SelectionChanged(sender As Object, e As EventArgs) Handles dgvEinarbeitung.SelectionChanged
|
Private Sub dgvEinarbeitung_SelectionChanged(sender As Object, e As EventArgs) Handles dgvEinarbeitung.SelectionChanged
|
||||||
dgvEinarbeitung.ClearSelection()
|
dgvEinarbeitung.ClearSelection()
|
||||||
|
|
||||||
|
|||||||
72
initATLASAufschubkonten/frmStartOptions.Designer.vb
generated
72
initATLASAufschubkonten/frmStartOptions.Designer.vb
generated
@@ -69,6 +69,7 @@ Partial Class frmStartOptions
|
|||||||
Me.LinkLabel99 = New System.Windows.Forms.LinkLabel()
|
Me.LinkLabel99 = New System.Windows.Forms.LinkLabel()
|
||||||
Me.PictureBox99 = New System.Windows.Forms.PictureBox()
|
Me.PictureBox99 = New System.Windows.Forms.PictureBox()
|
||||||
Me.Button99 = New System.Windows.Forms.Button()
|
Me.Button99 = New System.Windows.Forms.Button()
|
||||||
|
Me.Button21 = New System.Windows.Forms.Button()
|
||||||
Me.Button20 = New System.Windows.Forms.Button()
|
Me.Button20 = New System.Windows.Forms.Button()
|
||||||
Me.Button19 = New System.Windows.Forms.Button()
|
Me.Button19 = New System.Windows.Forms.Button()
|
||||||
Me.Label99 = New System.Windows.Forms.Label()
|
Me.Label99 = New System.Windows.Forms.Label()
|
||||||
@@ -159,6 +160,7 @@ Partial Class frmStartOptions
|
|||||||
Me.LinkLabel30 = New System.Windows.Forms.LinkLabel()
|
Me.LinkLabel30 = New System.Windows.Forms.LinkLabel()
|
||||||
Me.Label11 = New System.Windows.Forms.Label()
|
Me.Label11 = New System.Windows.Forms.Label()
|
||||||
Me.TabPage4 = New System.Windows.Forms.TabPage()
|
Me.TabPage4 = New System.Windows.Forms.TabPage()
|
||||||
|
Me.LinkLabel46 = New System.Windows.Forms.LinkLabel()
|
||||||
Me.PictureBox19 = New System.Windows.Forms.PictureBox()
|
Me.PictureBox19 = New System.Windows.Forms.PictureBox()
|
||||||
Me.PictureBox18 = New System.Windows.Forms.PictureBox()
|
Me.PictureBox18 = New System.Windows.Forms.PictureBox()
|
||||||
Me.LinkLabel41 = New System.Windows.Forms.LinkLabel()
|
Me.LinkLabel41 = New System.Windows.Forms.LinkLabel()
|
||||||
@@ -191,6 +193,8 @@ Partial Class frmStartOptions
|
|||||||
Me.lklAufschubkontenATLASEZOLL = New System.Windows.Forms.LinkLabel()
|
Me.lklAufschubkontenATLASEZOLL = New System.Windows.Forms.LinkLabel()
|
||||||
Me.lblRoutineManager = New System.Windows.Forms.Label()
|
Me.lblRoutineManager = New System.Windows.Forms.Label()
|
||||||
Me.txtGJ_UNISPED = New VERAG_PROG_ALLGEMEIN.MyTextBox()
|
Me.txtGJ_UNISPED = New VERAG_PROG_ALLGEMEIN.MyTextBox()
|
||||||
|
Me.LinkLabel47 = New System.Windows.Forms.LinkLabel()
|
||||||
|
Me.PictureBox21 = New System.Windows.Forms.PictureBox()
|
||||||
Me.pnl.SuspendLayout()
|
Me.pnl.SuspendLayout()
|
||||||
CType(Me.piceZollAnh, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.piceZollAnh, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
Me.tbcntr.SuspendLayout()
|
Me.tbcntr.SuspendLayout()
|
||||||
@@ -221,6 +225,7 @@ Partial Class frmStartOptions
|
|||||||
CType(Me.PictureBox11, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.PictureBox11, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
CType(Me.PictureBox10, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.PictureBox10, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
CType(Me.PictureBox9, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.PictureBox9, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
|
CType(Me.PictureBox21, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
Me.SuspendLayout()
|
Me.SuspendLayout()
|
||||||
'
|
'
|
||||||
'pnl
|
'pnl
|
||||||
@@ -881,6 +886,18 @@ Partial Class frmStartOptions
|
|||||||
Me.Button99.Text = "AAS Sendung 24h"
|
Me.Button99.Text = "AAS Sendung 24h"
|
||||||
Me.Button99.UseVisualStyleBackColor = True
|
Me.Button99.UseVisualStyleBackColor = True
|
||||||
'
|
'
|
||||||
|
'Button21
|
||||||
|
'
|
||||||
|
Me.Button21.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||||
|
Me.Button21.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
|
||||||
|
Me.Button21.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
|
||||||
|
Me.Button21.Location = New System.Drawing.Point(581, 346)
|
||||||
|
Me.Button21.Name = "Button21"
|
||||||
|
Me.Button21.Size = New System.Drawing.Size(211, 24)
|
||||||
|
Me.Button21.TabIndex = 81
|
||||||
|
Me.Button21.Text = "AAS Sendung 24h"
|
||||||
|
Me.Button21.UseVisualStyleBackColor = True
|
||||||
|
'
|
||||||
'Button20
|
'Button20
|
||||||
'
|
'
|
||||||
Me.Button20.Enabled = False
|
Me.Button20.Enabled = False
|
||||||
@@ -932,7 +949,7 @@ Partial Class frmStartOptions
|
|||||||
'
|
'
|
||||||
Me.PictureBox20.BackgroundImage = CType(resources.GetObject("PictureBox20.BackgroundImage"), System.Drawing.Image)
|
Me.PictureBox20.BackgroundImage = CType(resources.GetObject("PictureBox20.BackgroundImage"), System.Drawing.Image)
|
||||||
Me.PictureBox20.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
|
Me.PictureBox20.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
|
||||||
Me.PictureBox20.Location = New System.Drawing.Point(661, 90)
|
Me.PictureBox20.Location = New System.Drawing.Point(586, 90)
|
||||||
Me.PictureBox20.Name = "PictureBox20"
|
Me.PictureBox20.Name = "PictureBox20"
|
||||||
Me.PictureBox20.Size = New System.Drawing.Size(18, 18)
|
Me.PictureBox20.Size = New System.Drawing.Size(18, 18)
|
||||||
Me.PictureBox20.TabIndex = 62
|
Me.PictureBox20.TabIndex = 62
|
||||||
@@ -943,7 +960,7 @@ Partial Class frmStartOptions
|
|||||||
'
|
'
|
||||||
Me.LinkLabel45.AutoSize = True
|
Me.LinkLabel45.AutoSize = True
|
||||||
Me.LinkLabel45.LinkColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
|
Me.LinkLabel45.LinkColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
|
||||||
Me.LinkLabel45.Location = New System.Drawing.Point(543, 95)
|
Me.LinkLabel45.Location = New System.Drawing.Point(475, 95)
|
||||||
Me.LinkLabel45.Name = "LinkLabel45"
|
Me.LinkLabel45.Name = "LinkLabel45"
|
||||||
Me.LinkLabel45.Size = New System.Drawing.Size(112, 13)
|
Me.LinkLabel45.Size = New System.Drawing.Size(112, 13)
|
||||||
Me.LinkLabel45.TabIndex = 61
|
Me.LinkLabel45.TabIndex = 61
|
||||||
@@ -1959,6 +1976,9 @@ Partial Class frmStartOptions
|
|||||||
'
|
'
|
||||||
'TabPage4
|
'TabPage4
|
||||||
'
|
'
|
||||||
|
Me.TabPage4.Controls.Add(Me.PictureBox21)
|
||||||
|
Me.TabPage4.Controls.Add(Me.LinkLabel47)
|
||||||
|
Me.TabPage4.Controls.Add(Me.LinkLabel46)
|
||||||
Me.TabPage4.Controls.Add(Me.PictureBox19)
|
Me.TabPage4.Controls.Add(Me.PictureBox19)
|
||||||
Me.TabPage4.Controls.Add(Me.PictureBox18)
|
Me.TabPage4.Controls.Add(Me.PictureBox18)
|
||||||
Me.TabPage4.Controls.Add(Me.LinkLabel41)
|
Me.TabPage4.Controls.Add(Me.LinkLabel41)
|
||||||
@@ -1974,11 +1994,22 @@ Partial Class frmStartOptions
|
|||||||
Me.TabPage4.Text = "Asfinag"
|
Me.TabPage4.Text = "Asfinag"
|
||||||
Me.TabPage4.UseVisualStyleBackColor = True
|
Me.TabPage4.UseVisualStyleBackColor = True
|
||||||
'
|
'
|
||||||
|
'LinkLabel46
|
||||||
|
'
|
||||||
|
Me.LinkLabel46.AutoSize = True
|
||||||
|
Me.LinkLabel46.LinkColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
|
||||||
|
Me.LinkLabel46.Location = New System.Drawing.Point(17, 91)
|
||||||
|
Me.LinkLabel46.Name = "LinkLabel46"
|
||||||
|
Me.LinkLabel46.Size = New System.Drawing.Size(120, 13)
|
||||||
|
Me.LinkLabel46.TabIndex = 38
|
||||||
|
Me.LinkLabel46.TabStop = True
|
||||||
|
Me.LinkLabel46.Text = "Contractdaten anzeigen"
|
||||||
|
'
|
||||||
'PictureBox19
|
'PictureBox19
|
||||||
'
|
'
|
||||||
Me.PictureBox19.BackgroundImage = CType(resources.GetObject("PictureBox19.BackgroundImage"), System.Drawing.Image)
|
Me.PictureBox19.BackgroundImage = CType(resources.GetObject("PictureBox19.BackgroundImage"), System.Drawing.Image)
|
||||||
Me.PictureBox19.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
|
Me.PictureBox19.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
|
||||||
Me.PictureBox19.Location = New System.Drawing.Point(110, 165)
|
Me.PictureBox19.Location = New System.Drawing.Point(321, 68)
|
||||||
Me.PictureBox19.Name = "PictureBox19"
|
Me.PictureBox19.Name = "PictureBox19"
|
||||||
Me.PictureBox19.Size = New System.Drawing.Size(18, 18)
|
Me.PictureBox19.Size = New System.Drawing.Size(18, 18)
|
||||||
Me.PictureBox19.TabIndex = 37
|
Me.PictureBox19.TabIndex = 37
|
||||||
@@ -1989,7 +2020,7 @@ Partial Class frmStartOptions
|
|||||||
'
|
'
|
||||||
Me.PictureBox18.BackgroundImage = CType(resources.GetObject("PictureBox18.BackgroundImage"), System.Drawing.Image)
|
Me.PictureBox18.BackgroundImage = CType(resources.GetObject("PictureBox18.BackgroundImage"), System.Drawing.Image)
|
||||||
Me.PictureBox18.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
|
Me.PictureBox18.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
|
||||||
Me.PictureBox18.Location = New System.Drawing.Point(110, 135)
|
Me.PictureBox18.Location = New System.Drawing.Point(321, 38)
|
||||||
Me.PictureBox18.Name = "PictureBox18"
|
Me.PictureBox18.Name = "PictureBox18"
|
||||||
Me.PictureBox18.Size = New System.Drawing.Size(18, 18)
|
Me.PictureBox18.Size = New System.Drawing.Size(18, 18)
|
||||||
Me.PictureBox18.TabIndex = 36
|
Me.PictureBox18.TabIndex = 36
|
||||||
@@ -2000,7 +2031,7 @@ Partial Class frmStartOptions
|
|||||||
'
|
'
|
||||||
Me.LinkLabel41.AutoSize = True
|
Me.LinkLabel41.AutoSize = True
|
||||||
Me.LinkLabel41.LinkColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
|
Me.LinkLabel41.LinkColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
|
||||||
Me.LinkLabel41.Location = New System.Drawing.Point(17, 165)
|
Me.LinkLabel41.Location = New System.Drawing.Point(228, 68)
|
||||||
Me.LinkLabel41.Name = "LinkLabel41"
|
Me.LinkLabel41.Name = "LinkLabel41"
|
||||||
Me.LinkLabel41.Size = New System.Drawing.Size(82, 13)
|
Me.LinkLabel41.Size = New System.Drawing.Size(82, 13)
|
||||||
Me.LinkLabel41.TabIndex = 35
|
Me.LinkLabel41.TabIndex = 35
|
||||||
@@ -2011,7 +2042,7 @@ Partial Class frmStartOptions
|
|||||||
'
|
'
|
||||||
Me.LinkLabel42.AutoSize = True
|
Me.LinkLabel42.AutoSize = True
|
||||||
Me.LinkLabel42.LinkColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
|
Me.LinkLabel42.LinkColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
|
||||||
Me.LinkLabel42.Location = New System.Drawing.Point(17, 140)
|
Me.LinkLabel42.Location = New System.Drawing.Point(228, 43)
|
||||||
Me.LinkLabel42.Name = "LinkLabel42"
|
Me.LinkLabel42.Name = "LinkLabel42"
|
||||||
Me.LinkLabel42.Size = New System.Drawing.Size(87, 13)
|
Me.LinkLabel42.Size = New System.Drawing.Size(87, 13)
|
||||||
Me.LinkLabel42.TabIndex = 34
|
Me.LinkLabel42.TabIndex = 34
|
||||||
@@ -2021,7 +2052,7 @@ Partial Class frmStartOptions
|
|||||||
'Label23
|
'Label23
|
||||||
'
|
'
|
||||||
Me.Label23.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
Me.Label23.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
Me.Label23.Location = New System.Drawing.Point(17, 113)
|
Me.Label23.Location = New System.Drawing.Point(228, 16)
|
||||||
Me.Label23.Name = "Label23"
|
Me.Label23.Name = "Label23"
|
||||||
Me.Label23.Size = New System.Drawing.Size(296, 16)
|
Me.Label23.Size = New System.Drawing.Size(296, 16)
|
||||||
Me.Label23.TabIndex = 33
|
Me.Label23.TabIndex = 33
|
||||||
@@ -2353,6 +2384,28 @@ Partial Class frmStartOptions
|
|||||||
Me.txtGJ_UNISPED.Size = New System.Drawing.Size(53, 20)
|
Me.txtGJ_UNISPED.Size = New System.Drawing.Size(53, 20)
|
||||||
Me.txtGJ_UNISPED.TabIndex = 68
|
Me.txtGJ_UNISPED.TabIndex = 68
|
||||||
'
|
'
|
||||||
|
'LinkLabel47
|
||||||
|
'
|
||||||
|
Me.LinkLabel47.AutoSize = True
|
||||||
|
Me.LinkLabel47.LinkColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
|
||||||
|
Me.LinkLabel47.Location = New System.Drawing.Point(17, 115)
|
||||||
|
Me.LinkLabel47.Name = "LinkLabel47"
|
||||||
|
Me.LinkLabel47.Size = New System.Drawing.Size(72, 13)
|
||||||
|
Me.LinkLabel47.TabIndex = 39
|
||||||
|
Me.LinkLabel47.TabStop = True
|
||||||
|
Me.LinkLabel47.Text = "Import to SDL"
|
||||||
|
'
|
||||||
|
'PictureBox21
|
||||||
|
'
|
||||||
|
Me.PictureBox21.BackgroundImage = CType(resources.GetObject("PictureBox21.BackgroundImage"), System.Drawing.Image)
|
||||||
|
Me.PictureBox21.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
|
||||||
|
Me.PictureBox21.Location = New System.Drawing.Point(99, 115)
|
||||||
|
Me.PictureBox21.Name = "PictureBox21"
|
||||||
|
Me.PictureBox21.Size = New System.Drawing.Size(18, 18)
|
||||||
|
Me.PictureBox21.TabIndex = 40
|
||||||
|
Me.PictureBox21.TabStop = False
|
||||||
|
Me.PictureBox21.Visible = False
|
||||||
|
'
|
||||||
'frmStartOptions
|
'frmStartOptions
|
||||||
'
|
'
|
||||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||||
@@ -2401,6 +2454,7 @@ Partial Class frmStartOptions
|
|||||||
CType(Me.PictureBox11, System.ComponentModel.ISupportInitialize).EndInit()
|
CType(Me.PictureBox11, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
CType(Me.PictureBox10, System.ComponentModel.ISupportInitialize).EndInit()
|
CType(Me.PictureBox10, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
CType(Me.PictureBox9, System.ComponentModel.ISupportInitialize).EndInit()
|
CType(Me.PictureBox9, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
|
CType(Me.PictureBox21, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
Me.ResumeLayout(False)
|
Me.ResumeLayout(False)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
@@ -2571,4 +2625,8 @@ Partial Class frmStartOptions
|
|||||||
Friend WithEvents Button99 As Button
|
Friend WithEvents Button99 As Button
|
||||||
Friend WithEvents LinkLabel99 As LinkLabel
|
Friend WithEvents LinkLabel99 As LinkLabel
|
||||||
Friend WithEvents PictureBox99 As PictureBox
|
Friend WithEvents PictureBox99 As PictureBox
|
||||||
|
Friend WithEvents Button21 As Button
|
||||||
|
Friend WithEvents LinkLabel46 As LinkLabel
|
||||||
|
Friend WithEvents LinkLabel47 As LinkLabel
|
||||||
|
Friend WithEvents PictureBox21 As PictureBox
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -527,6 +527,30 @@
|
|||||||
WOhxEFgYvLZus64EJhQtqBTtALDEsQ/aHnRf3FTcASpEWwBsbQkBLQW1uqiTUJABFxcXg7y8PJupqSm/
|
WOhxEFgYvLZus64EJhQtqBTtALDEsQ/aHnRf3FTcASpEWwBsbQkBLQW1uqiTUJABFxcXg7y8PJupqSm/
|
||||||
nZ2diL29vSgyBooJm5ub88nKyrIC1VLezgQ2zRk9PT0F6urqVCdNmmQwbdo0Y2Q8efJk3ebmZkVXV1de
|
nZ2diL29vSgyBooJm5ub88nKyrIC1VLezgQ2zRk9PT0F6urqVCdNmmQwbdo0Y2Q8efJk3ebmZkVXV1de
|
||||||
CQkJEjM9AwMAOTMC2xlgxuQAAAAASUVORK5CYII=
|
CQkJEjM9AwMAOTMC2xlgxuQAAAAASUVORK5CYII=
|
||||||
|
</value>
|
||||||
|
</data>
|
||||||
|
<data name="PictureBox21.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>
|
||||||
|
iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAABGdBTUEAALGPC/xhBQAABEhJREFUSEtj
|
||||||
|
oDZg4WThlrSSdLPOtc53zHaMl5SUZGBnZ4fKUhMwMjCK6IloGhUYZdn32a/wX+Z/0Ge2z0L9eH0rQVVB
|
||||||
|
QSZ2JqhCKgEBNQFFoyKjnPAj4cdjz8d+jb8U/z/iaMR9z2WeE3XSdByEdYWFGVkYGaHKKQdWTVYF4YfC
|
||||||
|
j8VdjPsHwiALYezo89HTzWrNHNj42VigyikHDv0OC2POxrwDWYSOgZY+DNoRNMV5urMdVDn5gFOUU0rJ
|
||||||
|
VynOd7XvBSwW/QHiHx4LPPYDQ6DUpMzEEKqNPMDKw8on5ywXBHT9w+hT0d/QLPsefTr6Rei+0Iuqwaox
|
||||||
|
XGJcElBt5AMFT4UIYDBtjzkT8zPuQtxfNAuv+G/wn6CdoG3Bp8AnysjMSH78MXMyc0tZSbnZtNksDtsf
|
||||||
|
9hJoODiRgC26EPcD6IDbPit9Oo3yjWz4Ffm5gXmTGaqVPMAuwC6il6ZXgx5vsedif4YfDH/kNsdtIlDe
|
||||||
|
VlRflDo5HpeFkUcj33jM89gqbigux8bNBlVNIeCR4pFX9ldO8F7qfTLyWORHmGUx52N+2/XYrRTRFTFh
|
||||||
|
42PjAMYZVAcOwMzBzA2MXHUFDwVLGXsZDS4JLjZ0TeyC7CLghDLVeWvU8ahPyL7z3+u/STNdMwSqFD8A
|
||||||
|
pSBeOV41rTitYr/1ftNd57jmKnorygKDjpUBqQgU1BA0NKsym4JsESifAfFzyxmWXhKeEqxQpfgBpxin
|
||||||
|
lEqgSnLI3pBn0Wei30aeiNzlucQzWdxEXBKY1+DJGYeF12IuxBTJe8srsfAQkfKBQckFzJgp7vPdD4KS
|
||||||
|
d9ylOJAhL4AF73aHCQ5RwKpGjomViZWVl1VAP0u/wXeN70WYZbEXYi/7b/Lv0c3Q1eGR5eGBGokfKLgp
|
||||||
|
hALjZBuyq0EYaOkHoIErzWvN/cWMxSSAcSoLTO57oXK/gPhp4PbAqUAfO7MLsbMBHUVcTQD2FVLGRbIQ
|
||||||
|
LA5MfdNdZrnYolkIcswSs0ozL2Aw80KNIg5I20h7ApN5lGWdZQfQoPtAA8F1GZLFD4HVznGQZUD6NUgs
|
||||||
|
8kjka5t2m25pW2kzFm4yShFgvuGVMJEwNq0wrXSd6bopeGfwA2RLkTHIUrfZbnvkXOWCQYkNagT5QNZZ
|
||||||
|
NsCu225Z9MnoD8By8TfQEkQ5eTHuJzDRHAMmnkJ2EXYhqBbKADCIeIGZ29t9nvvSqJNRL4AW/UKy8L7P
|
||||||
|
ap8Juum6BsBCgHotI25JbgkZBxkHtVC1JGDc7Qa2UX4CE8n3oJ1B64GpMlpYR5ifmZ2Zyq0iKFANUk3x
|
||||||
|
WOhxEFgYvLZus64EJhQtqBTtALDEsQ/aHnRf3FTcASpEWwBsbQkBLQW1uqiTUJABFxcXg7y8PJupqSm/
|
||||||
|
nZ2diL29vSgyBooJm5ub88nKyrIC1VLezgQ2zRk9PT0F6urqVCdNmmQwbdo0Y2Q8efJk3ebmZkVXV1de
|
||||||
|
CQkJEjM9AwMAOTMC2xlgxuQAAAAASUVORK5CYII=
|
||||||
</value>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="PictureBox19.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="PictureBox19.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ Imports System.IO
|
|||||||
Imports System.Net
|
Imports System.Net
|
||||||
Imports System.Text
|
Imports System.Text
|
||||||
Imports System.Xml
|
Imports System.Xml
|
||||||
|
|
||||||
Imports DocumentFormat.OpenXml.Drawing.Diagrams
|
Imports DocumentFormat.OpenXml.Drawing.Diagrams
|
||||||
|
|
||||||
Imports DocumentFormat.OpenXml.Wordprocessing
|
Imports DocumentFormat.OpenXml.Wordprocessing
|
||||||
Imports iTextSharp.text.pdf.qrcode.Version
|
Imports iTextSharp.text.pdf.qrcode.Version
|
||||||
Imports Org.BouncyCastle.Asn1.Pkcs
|
Imports Org.BouncyCastle.Asn1.Pkcs
|
||||||
@@ -244,6 +246,8 @@ Public Class frmStartOptions
|
|||||||
Me.Refresh()
|
Me.Refresh()
|
||||||
DAKOSY_Worker.cIMPORT_Codelisten.IMPORT("I6010", True)
|
DAKOSY_Worker.cIMPORT_Codelisten.IMPORT("I6010", True)
|
||||||
DAKOSY_Worker.cIMPORT_Codelisten.IMPORT("I6010", False)
|
DAKOSY_Worker.cIMPORT_Codelisten.IMPORT("I6010", False)
|
||||||
|
importEZOLLWechselkurse(True)
|
||||||
|
importEZOLLWechselkurse(False)
|
||||||
Me.Refresh()
|
Me.Refresh()
|
||||||
DAKOSY_Worker.cIMPORT_Codelisten.IMPORT("C0219", True)
|
DAKOSY_Worker.cIMPORT_Codelisten.IMPORT("C0219", True)
|
||||||
DAKOSY_Worker.cIMPORT_Codelisten.IMPORT("C0219", False)
|
DAKOSY_Worker.cIMPORT_Codelisten.IMPORT("C0219", False)
|
||||||
@@ -2005,6 +2009,7 @@ Public Class frmStartOptions
|
|||||||
PictureBox18.Visible = False
|
PictureBox18.Visible = False
|
||||||
PictureBox19.Visible = False
|
PictureBox19.Visible = False
|
||||||
PictureBox20.Visible = False
|
PictureBox20.Visible = False
|
||||||
|
PictureBox21.Visible = False
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -3108,13 +3113,13 @@ Public Class frmStartOptions
|
|||||||
ASFINAG_LKW()
|
ASFINAG_LKW()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Function ASFINAG_LKW()
|
Function ASFINAG_LKW(Optional isFMZoll As Boolean = True) As Boolean
|
||||||
Try
|
Try
|
||||||
Dim SQl As New VERAG_PROG_ALLGEMEIN.SQL
|
Dim SQl As New VERAG_PROG_ALLGEMEIN.SQL
|
||||||
|
|
||||||
' CLF-Einträge aus den bestehenden SDL-Datensätzen entfernen,
|
' CLF-Einträge aus den bestehenden SDL-Datensätzen entfernen,
|
||||||
' damit nach dem Aktualisierungslauf der Istzustand der CLF in der SDL hergestellt wird.
|
' damit nach dem Aktualisierungslauf der Istzustand der CLF in der SDL hergestellt wird.
|
||||||
If Not SQl.getValueTxtBySql("UPDATE SDL Set OBUID = NULL, Vertragsabschlussdatum = NULL, Kategorie = NULL, Status = NULL WHERE (SDLNr = 200) AND (NOT Vertragsabschlussdatum IS NULL)", "SDL") Then
|
If Not SQl.doSQL("UPDATE SDL Set OBUID = NULL, Vertragsabschlussdatum = NULL, Kategorie = NULL, Status = NULL WHERE (SDLNr = 200) AND (NOT Vertragsabschlussdatum IS NULL)", "SDL") Then
|
||||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR("ERROR", "Fehler beim Reset SDL-Daten.", System.Reflection.MethodBase.GetCurrentMethod.Name)
|
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR("ERROR", "Fehler beim Reset SDL-Daten.", System.Reflection.MethodBase.GetCurrentMethod.Name)
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
@@ -3127,74 +3132,150 @@ Public Class frmStartOptions
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If isFMZoll Then
|
||||||
|
|
||||||
|
' Verbindung zur ASFINAG Datenbank herstellen
|
||||||
|
Dim connectionString = ""
|
||||||
|
If VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then
|
||||||
|
connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\DEVELOPER\f\FMZoll\Mautmanager.adp"
|
||||||
|
Else
|
||||||
|
connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\FMZOLL\f\FMZoll\Mautmanager.adp"
|
||||||
|
End If
|
||||||
|
Dim con As New OleDbConnection(connectionString)
|
||||||
|
Dim cmd As New OleDbCommand
|
||||||
|
Dim var1 As String
|
||||||
|
Dim adapter As OleDbDataAdapter = New OleDbDataAdapter()
|
||||||
|
Dim reader As OleDbDataReader = Nothing
|
||||||
|
|
||||||
' Verbindung zur ASFINAG Datenbank herstellen
|
' Kfz Kennzeichen einlesen.
|
||||||
Dim connectionString = ""
|
Dim SQLQuery = "SELECT CardNumber, ValidTo, OBUID, KfzKennzeichen, Nationalität, DatumVertragsabschluss, Kategorie, Schadstoffklasse, Status FROM vwCLFBody "
|
||||||
If VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then
|
Using Command As New OleDbCommand(SQLQuery, con)
|
||||||
connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\DEVELOPER\f\FMZoll\Mautmanager.adp"
|
Using oRDR As OleDbDataReader = Command.ExecuteReader
|
||||||
|
While (oRDR.Read)
|
||||||
|
Dim KartenNr = oRDR.GetValue("CardNumber")
|
||||||
|
|
||||||
|
Dim KfzKennzeichen = fktConvert(oRDR.GetValue("KfzKennzeichen"))
|
||||||
|
|
||||||
|
' Kundennummer einlesen
|
||||||
|
Dim KdNr As Integer = SQl.getValueTxtBySql("SELECT AdressenNr FROM Kreditkarten WHERE KartenNr='" & KartenNr & "'", "SDL",,, -1)
|
||||||
|
|
||||||
|
If KdNr > 0 Then
|
||||||
|
|
||||||
|
Call fktKundenSDLVerwalten(KdNr, SDLNr)
|
||||||
|
Call fktKundenLkwVerwalten(KdNr, oRDR.GetValue("KfzKennzeichen"), oRDR.GetValue("Nationalität"))
|
||||||
|
|
||||||
|
Dim SDL = New VERAG_PROG_ALLGEMEIN.cSDL(KdNr, oRDR.GetValue("KfzKennzeichen"), SDLNr)
|
||||||
|
If Not SDL.hasentry Then
|
||||||
|
SDL.KundenNr = KdNr
|
||||||
|
SDL.KfzKennzeichen = KfzKennzeichen
|
||||||
|
SDL.SDLNr = SDLNr
|
||||||
|
SDL.History = 0 'fktLiefereHistorywert(!KundenNr, !SDLNr)
|
||||||
|
SDL.Erfassungsdatum = Now
|
||||||
|
Else
|
||||||
|
SDL.Änderungsdatum = Now
|
||||||
|
End If
|
||||||
|
SDL.Sachbearbeiter = "ASFINAG"
|
||||||
|
|
||||||
|
Dim Validto = SQl.checkNullStr(oRDR.GetValue("DatumVertragsabschluss"))
|
||||||
|
|
||||||
|
SDL.KartenNr = SQl.checkNullStr(oRDR.GetValue("CardNumber"))
|
||||||
|
If Validto <> "" Then
|
||||||
|
SDL.GültigBis = DateAdd("d", -1, DateAdd("m", 1, DateSerial("20" & Mid(Validto, 1, 2), Mid(Validto, 3, 2), 1)))
|
||||||
|
End If
|
||||||
|
|
||||||
|
SDL.OBUID = SQl.checkNullStr(oRDR.GetValue("OBUID"))
|
||||||
|
SDL.Vertragsabschlussdatum = SQl.checkNullStr(oRDR.GetValue("DatumVertragsabschluss"))
|
||||||
|
SDL.Kategorie = SQl.checkNullStr(oRDR.GetValue("Kategorie"))
|
||||||
|
SDL.Schadstoffklasse = SQl.checkNullStr(oRDR.GetValue("Schadstoffklasse"))
|
||||||
|
SDL.Status = SQl.checkNullStr(oRDR.GetValue("Status"))
|
||||||
|
SDL.SAVE()
|
||||||
|
End If
|
||||||
|
|
||||||
|
End While
|
||||||
|
End Using
|
||||||
|
End Using
|
||||||
|
con.Close()
|
||||||
Else
|
Else
|
||||||
connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\FMZOLL\f\FMZoll\Mautmanager.adp"
|
|
||||||
End If
|
|
||||||
Dim con As New OleDbConnection(connectionString)
|
|
||||||
Dim cmd As New OleDbCommand
|
|
||||||
Dim var1 As String
|
|
||||||
Dim adapter As OleDbDataAdapter = New OleDbDataAdapter()
|
|
||||||
Dim reader As OleDbDataReader = Nothing
|
|
||||||
|
|
||||||
' Kfz Kennzeichen einlesen.
|
' Kfz Kennzeichen einlesen.
|
||||||
Dim SQLQuery = "SELECT CardNumber, ValidTo, OBUID, KfzKennzeichen, Nationalität, DatumVertragsabschluss, Kategorie, Schadstoffklasse, Status FROM vwCLFBody "
|
|
||||||
Using Command As New OleDbCommand(SQLQuery, con)
|
|
||||||
Using oRDR As OleDbDataReader = Command.ExecuteReader
|
|
||||||
While (oRDR.Read)
|
|
||||||
Dim KartenNr = oRDR.GetValue("CardNumber")
|
|
||||||
|
|
||||||
Dim KfzKennzeichen = fktConvert(oRDR.GetValue("KfzKennzeichen"))
|
|
||||||
|
|
||||||
' Kundennummer einlesen
|
Dim strSQLASFINAG = "SELECT cardNumber, ValidTo, OBUID, vehicleLicensePlate, nationality, contractDate, vehicleCategory, emissionCategory, status FROM vwCLFBody"
|
||||||
Dim KdNr As Integer = SQl.getValueTxtBySql("SELECT AdressenNr FROM Kreditkarten WHERE KartenNr='" & KartenNr & "'", "SDL",,, -1)
|
|
||||||
|
|
||||||
If KdNr > 0 Then
|
Dim dtAsfinag As DataTable = SQl.loadDgvBySql_Param(strSQLASFINAG, "ASFINAG")
|
||||||
|
|
||||||
Call fktKundenSDLVerwalten(KdNr, SDLNr)
|
If dtAsfinag.Rows.Count < 1 Then
|
||||||
Call fktKundenLkwVerwalten(KdNr, oRDR.GetValue("KfzKennzeichen"), oRDR.GetValue("Nationalität"))
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
Dim SDL = New VERAG_PROG_ALLGEMEIN.cSDL(KdNr, oRDR.GetValue("KfzKennzeichen"), SDLNr)
|
For Each row As DataRow In dtAsfinag.Rows
|
||||||
If Not SDL.hasentry Then
|
|
||||||
SDL.KundenNr = KdNr
|
|
||||||
SDL.KfzKennzeichen = KfzKennzeichen
|
|
||||||
SDL.SDLNr = SDLNr
|
|
||||||
SDL.History = 0 'fktLiefereHistorywert(!KundenNr, !SDLNr)
|
|
||||||
SDL.Erfassungsdatum = Now
|
|
||||||
Else
|
|
||||||
SDL.Änderungsdatum = Now
|
|
||||||
End If
|
|
||||||
SDL.Sachbearbeiter = "ASFINAG"
|
|
||||||
|
|
||||||
Dim Validto = SQL.checkNullStr(oRDR.GetValue("DatumVertragsabschluss"))
|
Dim KdNr As Integer = SQl.getValueTxtBySql("SELECT Kreditkarten.AdressenNr FROM Kreditkarten WHERE Kreditkarten.KartenNr='" & row.Item("cardNumber") & "'", "FMZOLL",,, -1)
|
||||||
|
|
||||||
SDL.KartenNr = SQL.checkNullStr(oRDR.GetValue("CardNumber"))
|
|
||||||
If Validto <> "" Then
|
|
||||||
SDL.GültigBis = DateAdd("d", -1, DateAdd("m", 1, DateSerial("20" & Mid(Validto, 1, 2), Mid(Validto, 3, 2), 1)))
|
|
||||||
End If
|
|
||||||
|
|
||||||
SDL.OBUID = SQL.checkNullStr(oRDR.GetValue("OBUID"))
|
If KdNr > 0 Then
|
||||||
SDL.Vertragsabschlussdatum = SQL.checkNullStr(oRDR.GetValue("DatumVertragsabschluss"))
|
|
||||||
SDL.Kategorie = SQL.checkNullStr(oRDR.GetValue("Kategorie"))
|
Call fktKundenSDLVerwalten(KdNr, SDLNr)
|
||||||
SDL.Schadstoffklasse = SQL.checkNullStr(oRDR.GetValue("Schadstoffklasse"))
|
Call fktKundenLkwVerwalten(KdNr, row.Item("vehicleLicensePlate"), row.Item("nationality"))
|
||||||
SDL.Status = SQL.checkNullStr(oRDR.GetValue("Status"))
|
|
||||||
SDL.SAVE()
|
' Die MautAT Tabelle aktualisieren.
|
||||||
|
|
||||||
|
Dim SDL = New VERAG_PROG_ALLGEMEIN.cSDL(KdNr, row.Item("vehicleLicensePlate"), SDLNr)
|
||||||
|
|
||||||
|
If Not SDL.hasentry Then
|
||||||
|
SDL.KundenNr = KdNr
|
||||||
|
SDL.KfzKennzeichen = row.Item("vehicleLicensePlate")
|
||||||
|
SDL.SDLNr = SDLNr
|
||||||
|
SDL.History = 0 'fktLiefereHistorywert(!KundenNr, !SDLNr)
|
||||||
|
SDL.Erfassungsdatum = Now
|
||||||
|
Else
|
||||||
|
SDL.Änderungsdatum = Now
|
||||||
|
End If
|
||||||
|
SDL.Sachbearbeiter = "ASFINAG"
|
||||||
|
|
||||||
|
Dim Validto = SQl.checkNullStr(row.Item("contractDate"))
|
||||||
|
|
||||||
|
SDL.KartenNr = SQl.checkNullStr(row.Item("cardNumber"))
|
||||||
|
If Validto <> "" Then
|
||||||
|
'MsgBox(Mid(Validto, 7, 2) & " " & Mid(Validto, 4, 2))
|
||||||
|
SDL.GültigBis = DateAdd("d", -1, DateAdd("m", 1, DateSerial("20" & Mid(Validto, 7, 2), Mid(Validto, 4, 2), 1))) 'noch im DETAIL checken!
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End While
|
SDL.OBUID = SQl.checkNullStr(row.Item("OBUID"))
|
||||||
End Using
|
SDL.Vertragsabschlussdatum = SQl.checkNullStr(row.Item("contractDate"))
|
||||||
End Using
|
SDL.Kategorie = SQl.checkNullStr(row.Item("vehicleCategory"))
|
||||||
con.Close()
|
SDL.Schadstoffklasse = SQl.checkNullStr(row.Item("emissionCategory"))
|
||||||
|
SDL.Status = SQl.checkNullStr(row.Item("status"))
|
||||||
|
SDL.SAVE()
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim strOBU = "OBU " & row.Item("OBUID") & " jetzt in " & KdNr & "/" & row.Item("vehicleLicensePlate") & "/" & SDLNr & "/" & 0 & "."
|
||||||
|
|
||||||
|
' Mehrfachvorkommen der OBU-ID prüfen.
|
||||||
|
Dim strSQL = "SELECT OBUID, Vermerk FROM vwSDL WHERE (SDLNr = " & SDLNr & ") And (OBUID = '" & row.Item("OBUID") & "') And ((KundenNr <> " & KdNr & ") Or (KfzKennzeichen <> '" & row.Item("vehicleLicensePlate") & "'))"
|
||||||
|
Dim dtCheckOBUID As DataTable = SQl.loadDgvBySql_Param(strSQL, "SDL")
|
||||||
|
|
||||||
|
If dtCheckOBUID.Rows.Count > 0 Then
|
||||||
|
|
||||||
|
For Each rowCheckOBUID As DataRow In dtCheckOBUID.Rows
|
||||||
|
Dim SDL = New VERAG_PROG_ALLGEMEIN.cSDL(KdNr, row.Item("vehicleLicensePlate"), SDLNr)
|
||||||
|
Dim leftString = Trim(strOBU & " " & SDL.Vermerk.Substring(0, 100))
|
||||||
|
SDL.Vermerk = Trim(strOBU & " " & SDL.Vermerk.Substring(0, 100))
|
||||||
|
SDL.OBUID = DBNull.Value
|
||||||
|
SDL.SAVE()
|
||||||
|
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
|
Next
|
||||||
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
Return True
|
Return True
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodBase.GetCurrentMethod.Name, VERAG_PROG_ALLGEMEIN.ERROR_OP.MAIL)
|
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodBase.GetCurrentMethod.Name, VERAG_PROG_ALLGEMEIN.ERROR_OP.SHOW)
|
||||||
Return False
|
Return False
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
@@ -3215,7 +3296,6 @@ Public Class frmStartOptions
|
|||||||
fktConvert = fktConvert & Mid(KfzKennzeichen, I, 1)
|
fktConvert = fktConvert & Mid(KfzKennzeichen, I, 1)
|
||||||
End Select
|
End Select
|
||||||
Next I
|
Next I
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function fktKundenLkwVerwalten(ByRef KdNr As Integer, ByRef KfzKennzeichen As String, Nationalitaet As String)
|
Public Function fktKundenLkwVerwalten(ByRef KdNr As Integer, ByRef KfzKennzeichen As String, Nationalitaet As String)
|
||||||
@@ -3494,13 +3574,14 @@ Public Class frmStartOptions
|
|||||||
Dim f As New frmAsfinag_NachrichtenVerabeitung("clf")
|
Dim f As New frmAsfinag_NachrichtenVerabeitung("clf")
|
||||||
f.ShowDialog()
|
f.ShowDialog()
|
||||||
Me.Visible = True
|
Me.Visible = True
|
||||||
|
'ASFINAG_LKW(False)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub LinkLabel42_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel42.LinkClicked
|
Private Sub LinkLabel42_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel42.LinkClicked
|
||||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
|
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
|
||||||
Me.Cursor = Cursors.WaitCursor
|
Me.Cursor = Cursors.WaitCursor
|
||||||
Dim blt = New cAsfinag.Exportist
|
Dim blt = New cAsfinag.Exportist
|
||||||
blt.initPFad()
|
blt.initExportPfade()
|
||||||
showPic(blt.exportiereWhiteList, PictureBox18)
|
showPic(blt.exportiereWhiteList, PictureBox18)
|
||||||
Me.Cursor = Cursors.Default
|
Me.Cursor = Cursors.Default
|
||||||
End Sub
|
End Sub
|
||||||
@@ -3509,103 +3590,15 @@ Public Class frmStartOptions
|
|||||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
|
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
|
||||||
Me.Cursor = Cursors.WaitCursor
|
Me.Cursor = Cursors.WaitCursor
|
||||||
Dim blt = New cAsfinag.Exportist
|
Dim blt = New cAsfinag.Exportist
|
||||||
blt.initPFad()
|
blt.initExportPfade()
|
||||||
showPic(blt.exportiereBlackList, PictureBox19)
|
showPic(blt.exportiereBlackList, PictureBox19)
|
||||||
Me.Cursor = Cursors.Default
|
Me.Cursor = Cursors.Default
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub LinkLabel45_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel45.LinkClicked
|
Private Sub LinkLabel45_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel45.LinkClicked
|
||||||
|
|
||||||
Dim MyData As String = ""
|
showPic(importEZOLLWechselkurse(VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM), PictureBox20)
|
||||||
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 Sub
|
||||||
Private Sub Button17_Click(sender As Object, e As EventArgs) Handles Button17.Click
|
Private Sub Button17_Click(sender As Object, e As EventArgs) Handles Button17.Click
|
||||||
Dim f As New frmDatenarchivarchiv
|
Dim f As New frmDatenarchivarchiv
|
||||||
@@ -3755,6 +3748,136 @@ Public Class frmStartOptions
|
|||||||
doAASVermerke_Ankunft()
|
doAASVermerke_Ankunft()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub LinkLabel46_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel46.LinkClicked
|
||||||
|
|
||||||
|
Try
|
||||||
|
|
||||||
|
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
||||||
|
Dim frm As New Form
|
||||||
|
Dim dgv As New DataGridView()
|
||||||
|
Dim dt As DataTable = SQL.loadDgvBySql("SELECT dbo.CLFBody.* FROM dbo.CLF INNER JOIN dbo.CLFBody ON dbo.CLF.PKHistory = dbo.CLFBody.PKHistory AND dbo.CLF.PKFileName = dbo.CLFBody.PKFileName", "ASFINAG")
|
||||||
|
|
||||||
|
dgv.DataSource = dt
|
||||||
|
If dgv IsNot Nothing Then
|
||||||
|
frm.Size = New Size(1400, 1000)
|
||||||
|
dgv.Size = New Size(frm.Size.Width - 50, frm.Size.Height - 50)
|
||||||
|
dgv.Dock = DockStyle.Fill
|
||||||
|
dgv.Anchor = AnchorStyles.Left
|
||||||
|
dgv.Anchor = AnchorStyles.Top
|
||||||
|
frm.Controls.Add(dgv)
|
||||||
|
frm.StartPosition = FormStartPosition.CenterScreen
|
||||||
|
frm.ShowDialog()
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
|
||||||
|
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Function importEZOLLWechselkurse(isTestsystem As Boolean) As Boolean
|
||||||
|
|
||||||
|
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = isTestsystem
|
||||||
|
|
||||||
|
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 Return False
|
||||||
|
|
||||||
|
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
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Using
|
||||||
|
|
||||||
|
Return erg
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
MsgBox(ex.Message & ex.StackTrace)
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Sub LinkLabel47_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel47.LinkClicked
|
||||||
|
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
|
||||||
|
showPic(ASFINAG_LKW(False), PictureBox21)
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub LinkLabel46_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel99.LinkClicked
|
Private Sub LinkLabel46_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel99.LinkClicked
|
||||||
Me.Cursor = Cursors.WaitCursor
|
Me.Cursor = Cursors.WaitCursor
|
||||||
Try
|
Try
|
||||||
|
|||||||
Reference in New Issue
Block a user