Rechnungdrucks-Art: Mail+Kopie, VERAG Parkplatzkarte NEU
This commit is contained in:
@@ -1,6 +1,42 @@
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Reflection
|
||||
|
||||
Public Class cKundenBesonderheiten_LIST
|
||||
Sub New(KundenNr, Optional hervorheben = Nothing, Optional kdb_kategorie_in = Nothing)
|
||||
LOAD(KundenNr, hervorheben, kdb_kategorie_in)
|
||||
End Sub
|
||||
Public LIST As New List(Of cKundenBesonderheiten)
|
||||
Public Sub LOAD(KundenNr, Optional hervorheben = Nothing, Optional kdb_kategorie_in = Nothing)
|
||||
LIST.Clear()
|
||||
Try
|
||||
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
|
||||
Using cmd As New SqlCommand("SELECT * FROM tblKundenBesonderheiten WHERE kdb_KundenNr=@kdb_KundenNr " & If(hervorheben IsNot Nothing, " AND [kdb_hervorheben]=@kdb_hervorheben ", "") & If(kdb_kategorie_in IsNot Nothing, " AND [kdb_kategorie] IN (" & kdb_kategorie_in & ") ", ""), conn)
|
||||
cmd.Parameters.AddWithValue("@kdb_KundenNr", KundenNr)
|
||||
If hervorheben IsNot Nothing Then cmd.Parameters.AddWithValue("@kdb_hervorheben", CBool(hervorheben))
|
||||
Dim dr = cmd.ExecuteReader()
|
||||
While dr.Read
|
||||
Dim BH As New cKundenBesonderheiten
|
||||
For Each li In BH.getParameterList()
|
||||
Dim propInfo As PropertyInfo = BH.GetType.GetProperty(li.Scalarvariable)
|
||||
|
||||
If dr.Item(li.Text) Is DBNull.Value Then
|
||||
propInfo.SetValue(BH, Nothing)
|
||||
Else
|
||||
propInfo.SetValue(BH, dr.Item(li.Text))
|
||||
End If
|
||||
|
||||
Next
|
||||
LIST.Add(BH)
|
||||
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
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Public Class cKundenBesonderheiten
|
||||
Property kdb_id As Integer
|
||||
Property kdb_KundenNr As Integer
|
||||
|
||||
Reference in New Issue
Block a user