You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
3.9 KiB

Public Class clsFileCounter
Dim Al As New ArrayList()
Dim m_sent As Integer
Property Sent() As Integer
Get
Return m_sent
End Get
Set(ByVal Value As Integer)
m_sent = Value
End Set
End Property
Dim m_got As Integer
Property got() As Integer
Get
Return m_got
End Get
Set(ByVal Value As Integer)
m_got = Value
End Set
End Property
Public Sub Add(ByVal Application As String, ByVal counter As Integer)
Dim i As Integer
Dim setvalue As Boolean = False
Dim d As New GenericList("", 0)
For i = 0 To Me.Al.Count - 1
d = Al.Item(i)
If d.Application = Application Then
d.Counter = d.Counter + counter
Al(i) = d
setvalue = True
End If
Next
If Not setvalue Then
Al.Add(New GenericList(Application, counter))
End If
d = Nothing
End Sub
Public Sub Write_File(ByVal log As clsLog)
Dim i As Integer
Dim d As New GenericList("", 0)
FileOpen(11, Params.PathColdDateien + "FileCount.txt", OpenMode.Output)
For i = 0 To Al.Count - 1
d = Al(i)
PrintLine(11, d.Application & ": " & LTrim(Str(d.Counter)))
ArchivierteDokumente = d.Counter
log.InsertJournale("Anzahl Dokumente - " & d.Application & ": " & LTrim(Str(d.Counter)), clsLog.Enum_InfoTyp.Information)
Next
FileClose(11)
Al.Clear()
End Sub
Public Function CountReturnfiles(ByVal log As clsLog) As Boolean
FileOpen(11, Params.PathColdDateien + "FileCount.txt", OpenMode.Input)
Dim total1 As Integer = 0
Dim total2 As Integer = 0
Dim i As Integer
Dim s As String = ""
Try
Input(11, s)
While s <> Nothing Or EOF(11)
s = Right(s, Len(s) - 12)
i = Val(s)
total1 = total1 + i
Input(11, s)
End While
Catch
Finally
FileClose(11)
End Try
FileOpen(11, Params.PathColdDateien + Params.FileReturnCode, OpenMode.Input)
Try
Input(11, s)
Input(11, s)
While s <> Nothing Or EOF(11)
s = Right(s, Len(s) - 11)
i = Val(s)
total2 = total2 + i
Input(11, s)
End While
Catch
Finally
FileClose(11)
End Try
Me.Sent = total1
Me.got = total2
If total2 > total1 Then
log.InsertJournale("COLD-Return: Warnung: Anzahl zur<75>ckgemeldete Dateien stimmt nicht mit der Anz. gesendeten <20>berein: Anzahl Return: " & Str(total2) & " - gesendet: " & Str(total1), clsLog.Enum_InfoTyp.Information)
Return True
Else
If total2 <> total1 Then
log.InsertJournale("COLD-Return: Anzahl zur<75>ckgemeldete Dateien stimmt nicht mit der Anz. gesendeten <20>berein: Anzahl Return: " & Str(total2) & " - gesendet: " & Str(total1), clsLog.Enum_InfoTyp.Information)
Return False
End If
Return True
End If
End Function
End Class
Public Class GenericList
Private _Application As String
Private _counter As Integer
Property Application() As String
Get
Return _Application
End Get
Set(ByVal Value As String)
_Application = Value
End Set
End Property
Property Counter() As Integer
Get
Return _counter
End Get
Set(ByVal Value As Integer)
_counter = Value
End Set
End Property
Public Sub New(ByVal Application As String, ByVal Counter As Integer)
Me.Application = Application
Me.Counter = Counter
End Sub
End Class