CBAM
This commit is contained in:
@@ -89,6 +89,9 @@ Public Class cKunde
|
||||
Public hasEntry As Boolean = False
|
||||
Dim SQL As New SQL
|
||||
|
||||
Sub New()
|
||||
|
||||
End Sub
|
||||
Sub New(KundenNr)
|
||||
Me.KundenNr = KundenNr
|
||||
If KundenNr <= 0 Then
|
||||
@@ -311,6 +314,54 @@ Public Class cKunde
|
||||
' Return Nothing
|
||||
End Sub
|
||||
|
||||
Public Shared Function LOAD_ByEORI(EORI) As cKunde
|
||||
Dim test = ""
|
||||
Dim KUNDE As New cKunde()
|
||||
Try
|
||||
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
|
||||
Using cmd As New SqlCommand("SELECT * FROM Kunden INNER JOIN Filialen on Filialen.FilialenNr=Kunden.FilialenNr WHERE EORITIN=@EORITIN and ( '" & VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA.Replace("ATILLA", "VERAG") & "' IN (Filialen.Firma,Filialen.Cluster)) ", conn)
|
||||
cmd.Parameters.AddWithValue("@EORITIN", EORI)
|
||||
|
||||
Dim dr = cmd.ExecuteReader()
|
||||
If dr.Read Then
|
||||
For Each li In KUNDE.getParameterList()
|
||||
' Me.GetType.GetProperty(l.Scalarvariable) = dr.Item(l.Text)
|
||||
Dim propInfo As PropertyInfo = KUNDE.GetType.GetProperty(li.Scalarvariable)
|
||||
' MsgBox(l.Text)
|
||||
' MsgBox(propInfo.PropertyType.ToString)
|
||||
' propInfo.SetValue(GetType(Object), l.Text)
|
||||
|
||||
'propInfo.SetValue(Me, l.Text)
|
||||
|
||||
' Try
|
||||
test = li.Text
|
||||
If dr.Item(li.Text) Is DBNull.Value Then
|
||||
propInfo.SetValue(KUNDE, Nothing)
|
||||
Else
|
||||
propInfo.SetValue(KUNDE, dr.Item(li.Text))
|
||||
End If
|
||||
|
||||
' Catch ex As Exception
|
||||
|
||||
' End Try
|
||||
|
||||
' Me.GetType.GetProperty(l.Scalarvariable).setSetValue(GetType(Object), l.Text)
|
||||
'If propInfo IsNot Nothing Then
|
||||
'propInfo.SetValue(l.Scalarvariable, l.Text)
|
||||
' End If
|
||||
Next
|
||||
KUNDE.hasEntry = True
|
||||
End If
|
||||
dr.Close()
|
||||
End Using
|
||||
End Using
|
||||
Return KUNDE
|
||||
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 Nothing
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Public Function getUpdateCmd() As String
|
||||
|
||||
Reference in New Issue
Block a user