This commit is contained in:
2020-11-05 07:59:47 +01:00
parent dcb3cea10e
commit 3b532b0a10
37 changed files with 2804 additions and 189 deletions

View File

@@ -361,6 +361,45 @@ Public Class cSpeditionsbuch
' Return Nothing
End Sub
Shared Function LOADByBezugsNr(bezugsNr As String, loadALL As Boolean, Optional checkValidStatus As Boolean = False) As cSpeditionsbuch 'PROBLEM!
Try
Dim SPEDBUCH As New cSpeditionsbuch
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
Using cmd As New SqlCommand("SELECT TOP 1 * FROM Speditionsbuch WHERE ([AtlasBezNrEZA]=@bezugsNr OR [AtlasBezNrNCTS]=@bezugsNr )", conn)
cmd.Parameters.AddWithValue("@bezugsNr", bezugsNr)
Dim dr = cmd.ExecuteReader()
If dr.Read Then
For Each l In SPEDBUCH.getParameterList()
Dim propInfo As PropertyInfo = SPEDBUCH.GetType.GetProperty(l.Scalarvariable)
If dr.Item(l.Text) Is DBNull.Value Then
propInfo.SetValue(SPEDBUCH, Nothing)
Else
propInfo.SetValue(SPEDBUCH, dr.Item(l.Text))
End If
Next
If loadALL Then
SPEDBUCH.LOAD_VORKOSTEN()
SPEDBUCH.LOAD_ENDEMPFAENGER()
End If
dr.Close()
SPEDBUCH.hasEntry = True
Return SPEDBUCH
End If
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 Nothing
End Function
Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)