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.

178 lines
4.4 KiB

Public Class clsdata
Dim m_dsdaten As DataSet
Property Dsdaten As DataSet
Get
Return m_dsdaten
End Get
Set(value As DataSet)
m_dsdaten = value
End Set
End Property
Dim m_partnercollection As Collection
Property PartnerCollection As Collection
Get
Return m_partnercollection
End Get
Set(value As Collection)
m_partnercollection = value
End Set
End Property
Dim m_ParamCollection As Collection
Property ParamCollection As Collection
Get
Return m_ParamCollection
End Get
Set(value As Collection)
m_ParamCollection = value
End Set
End Property
Dim m_jahr As String
Property Jahr As String
Get
Return m_jahr
End Get
Set(value As String)
m_jahr = value
End Set
End Property
Sub New()
Me.ParamCollection = New Collection
Me.PartnerCollection = New Collection
End Sub
Public Function Check_Parameter() As Boolean
Try
PartnerCollection.Clear()
ParamCollection.Clear()
For Each r As DataRow In Me.Dsdaten.Tables(0).Rows
Select Case UCase(r("Paramtyp"))
Case "S"
Me.Jahr = r("Inhalt").ToString
Case "P"
Me.PartnerCollection.Add(New Partnerclass(r("Inhalt")))
Case "M"
Me.ParamCollection.Add(New ParamClass(r("Paramtyp"), r("Inhalt"), r("Erweiterung")))
Case "D"
Me.ParamCollection.Add(New ParamClass(r("Paramtyp"), r("Inhalt"), r("Erweiterung")))
Case Else
Return False
End Select
Next
Check_Partner()
Check_Parameters()
Catch
End Try
End Function
Private Sub Check_Partner()
Dim db As New clsdb
For i = 1 To Me.PartnerCollection.Count
Dim pc As Partnerclass = PartnerCollection(i)
If db.Check_Partner_Exists(pc.Partner) = False Then pc.HasError = 1
Next
For i As Integer = 1 To PartnerCollection.Count
Dim pc As Partnerclass = PartnerCollection.Item(i)
Next
End Sub
Private Sub Check_Parameters()
Dim db As New clsdb
For i = 1 To ParamCollection.Count
Dim pc As ParamClass = ParamCollection.Item(i)
If pc.DocType = "" Then pc.HasError = 1
If pc.Zeitraum <> 0 And pc.Zeitraum <> 1 And pc.Zeitraum <> 2 Then pc.HasError = 1
Next
End Sub
End Class
Public Class Partnerclass
Dim m_partner As String
Property Partner As String
Get
Return m_partner
End Get
Set(value As String)
m_partner = value
End Set
End Property
Dim m_error As Integer
Property HasError As Integer
Get
Return m_error
End Get
Set(value As Integer)
m_error = value
End Set
End Property
Sub New(ByVal Partnernr As String)
Me.Partner = Partnernr
Me.HasError = 0
End Sub
End Class
Public Class ParamClass
Dim m_paramtyp As String
Property Paramtyp As String
Get
Return m_paramtyp
End Get
Set(value As String)
m_paramtyp = value
End Set
End Property
Dim m_doctyp As String
Property DocType As String
Get
Return m_doctyp
End Get
Set(value As String)
m_doctyp = value
End Set
End Property
Dim m_zeitraum As String
Property Zeitraum As String
Get
Return m_zeitraum
End Get
Set(value As String)
Select Case value
Case "0", "1", "2"
m_zeitraum = value
Case Else
m_zeitraum = -1
End Select
End Set
End Property
Dim m_error As Integer
Property HasError As Integer
Get
Return m_error
End Get
Set(value As Integer)
m_error = value
End Set
End Property
Sub New(ByVal Typ As String, ByVal Doctype As String, ByVal Zeitraum As String)
Me.Paramtyp = Typ
Me.DocType = Doctype
Me.Zeitraum = Zeitraum
Me.HasError = 0
End Sub
End Class