This commit is contained in:
2021-09-14 13:00:45 +02:00
parent 0a0ac4a065
commit 13f28aa1d8
16 changed files with 373 additions and 52 deletions

View File

@@ -102,6 +102,34 @@ Public Class cFirmen
End Try
End Sub
Public Shared Function LOAD_LIST() As List(Of cFirmen)
Dim FIRMEN As New List(Of cFirmen)
Try
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
Using cmd As New SqlCommand("SELECT * FROM tblFirma ", conn)
Dim dr = cmd.ExecuteReader()
While dr.Read
Dim FIMRA As New cFirmen
For Each li In FIMRA.getParameterList()
Dim propInfo As PropertyInfo = FIMRA.GetType.GetProperty(li.Scalarvariable)
If dr.Item(li.Text) Is DBNull.Value Then
propInfo.SetValue(FIMRA, Nothing)
Else
propInfo.SetValue(FIMRA, dr.Item(li.Text))
End If
Next
FIRMEN.Add(FIMRA)
End While
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
Return FIRMEN
End Function
End Class