neu
This commit is contained in:
@@ -505,31 +505,34 @@ Public Class cDakosyNCTSOut
|
||||
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
||||
|
||||
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
|
||||
' Using cmd As New SqlCommand("SELECT TOP 1 * FROM (SELECT * FROM tblDakosy_NCTSOut WHERE ncts_ObjectName LIKE @bezugsNr " & If(checkValidStatus, " AND ncts_status BETWEEN 40 and 90 ", "") & " ) AS T order by ncts_status desc, (SELECT top 1 dySt_ts FROM [tblDakosy_Statusmeldungen] WHERE ncts_dyaAnmID=ncts_dyaAnmID order by dySt_ts desc) desc,ncts_LetzteBearbeitung desc ", conn)
|
||||
'Using cmd As New SqlCommand("SELECT TOP 1 * FROM tblDakosy_NCTSOut WHERE ncts_ObjectName LIKE @bezugsNr " & If(checkValidStatus, " AND ncts_status BETWEEN 40 and 90 ", "") & " order by ncts_status desc, (SELECT top 1 dySt_ts FROM [tblDakosy_Statusmeldungen] WHERE ncts_dyaAnmID=ncts_dyaAnmID order by dySt_ts desc) desc,ncts_LetzteBearbeitung desc ", conn)
|
||||
Using cmd As New SqlCommand("SELECT TOP 1 * FROM tblDakosy_NCTSOut WHERE ncts_ObjectName LIKE @bezugsNr " & If(checkValidStatus, " AND ncts_status BETWEEN 40 and 90 ", "") & " order by ncts_LetzteBearbeitung desc", conn)
|
||||
cmd.Parameters.AddWithValue("@bezugsNr", bezugsNr)
|
||||
Dim dr = cmd.ExecuteReader()
|
||||
If dr.Read Then
|
||||
For Each l In NCTS.getParameterList()
|
||||
Dim propInfo As PropertyInfo = NCTS.GetType.GetProperty(l.Scalarvariable)
|
||||
'MsgBox("SELECT TOP 1 * FROM tblDakosy_NCTSOut WHERE ncts_ObjectName LIKE " & bezugsNr & " " & If(checkValidStatus, " AND ncts_status BETWEEN 40 and 90 ", "") & " order by ncts_status desc, (SELECT top 1 dySt_ts FROM [tblDakosy_Statusmeldungen] inner join tblDakosy_Zollanmeldungen on dy_id = dySt_dyId WHERE ncts_dyaAnmID=dy_id order by dySt_ts desc) desc,ncts_LetzteBearbeitung desc ")
|
||||
cmd.Parameters.AddWithValue("@bezugsNr", bezugsNr)
|
||||
Dim dr = cmd.ExecuteReader()
|
||||
If dr.Read Then
|
||||
For Each l In NCTS.getParameterList()
|
||||
Dim propInfo As PropertyInfo = NCTS.GetType.GetProperty(l.Scalarvariable)
|
||||
|
||||
If dr.Item(l.Text) Is DBNull.Value Then
|
||||
propInfo.SetValue(NCTS, Nothing)
|
||||
Else
|
||||
propInfo.SetValue(NCTS, dr.Item(l.Text))
|
||||
If dr.Item(l.Text) Is DBNull.Value Then
|
||||
propInfo.SetValue(NCTS, Nothing)
|
||||
Else
|
||||
propInfo.SetValue(NCTS, dr.Item(l.Text))
|
||||
End If
|
||||
|
||||
Next
|
||||
If loadALL Then
|
||||
NCTS.LOAD_Sicherheitsangaben()
|
||||
NCTS.LOAD_Warenposition()
|
||||
End If
|
||||
|
||||
Next
|
||||
If loadALL Then
|
||||
NCTS.LOAD_Sicherheitsangaben()
|
||||
NCTS.LOAD_Warenposition()
|
||||
dr.Close()
|
||||
Return NCTS
|
||||
End If
|
||||
|
||||
dr.Close()
|
||||
Return NCTS
|
||||
End If
|
||||
dr.Close()
|
||||
End Using
|
||||
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
|
||||
@@ -652,8 +655,42 @@ Public Class cDakosyNCTSOut
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
Public Shared Function get_Warenposition(ncts_Id As Integer, Optional loadAll As Boolean = False) As List(Of cDakosy_NCTSOut_Warenposition)
|
||||
Try
|
||||
Dim ncts_WARENPOS As New List(Of cDakosy_NCTSOut_Warenposition)
|
||||
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
||||
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
|
||||
Using cmd As New SqlCommand("SELECT * FROM tblDakosy_NCTSOut_Warenposition WHERE nctsWP_NctsId=@ncts_Id ", conn)
|
||||
cmd.Parameters.AddWithValue("@ncts_Id", ncts_Id)
|
||||
Dim dr = cmd.ExecuteReader()
|
||||
While dr.Read
|
||||
Dim l As New cDakosy_NCTSOut_Warenposition()
|
||||
For Each i In l.getParameterList()
|
||||
Dim propInfo As PropertyInfo = l.GetType.GetProperty(i.Scalarvariable)
|
||||
If dr.Item(i.Text) Is DBNull.Value Then
|
||||
propInfo.SetValue(l, Nothing)
|
||||
Else
|
||||
propInfo.SetValue(l, dr.Item(i.Text))
|
||||
End If
|
||||
Next
|
||||
l.LOAD_WarenpositionPackstuecke()
|
||||
l.LOAD_WarenpositionUnterlagen()
|
||||
ncts_WARENPOS.Add(l)
|
||||
End While
|
||||
dr.Close()
|
||||
End Using
|
||||
End Using
|
||||
Return ncts_WARENPOS
|
||||
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 DELETE_Warenpositionen() As Boolean 'obj As Object, tablename As String, where As String) As Boolean
|
||||
Dim sqlstr = " DELETE FROM [tblDakosy_NCTSOut_Warenposition] WHERE nctsWP_NctsId=" & Me.ncts_Id & " "
|
||||
' MsgBox(sqlstr)
|
||||
Return SQL.doSQL(sqlstr, "FMZOLL")
|
||||
End Function
|
||||
|
||||
@@ -1024,7 +1061,7 @@ Public Class cDakosyNCTSOut
|
||||
If sumBrg > 0 Then SPEDITIONSBUCH.Rechnungsbetrag = sumBrg
|
||||
End If
|
||||
|
||||
If packSt.Trim <> String.Empty Then SPEDITIONSBUCH.Packstücke = packSt.Trim
|
||||
If packSt.Trim <> String.Empty Then SPEDITIONSBUCH.Packstücke = packSt.Trim & ", " & CDbl(DY.ncts_GesamtRohmasse).ToString("N1") & " kg"
|
||||
|
||||
If DY.ncts_GesamtRohmasse IsNot Nothing AndAlso IsNumeric(DY.ncts_GesamtRohmasse) Then SPEDITIONSBUCH.Rohmasse = CInt(DY.ncts_GesamtRohmasse) 'CDbl(DY.ncts_GesamtRohmasse).ToString("N2")
|
||||
'Personal Abfertigung:
|
||||
@@ -1212,6 +1249,7 @@ Public Class cDakosy_NCTSOut_Warenposition
|
||||
Property nctsWP_SumAEmpfaenger_Land As Object = Nothing
|
||||
|
||||
|
||||
Property nctsWP_KdRefNr As Object = Nothing
|
||||
|
||||
|
||||
Property nctsWP_PACKSTUECKE As New List(Of cDakosy_NCTSOut_WarenpositionPackstuecke)
|
||||
@@ -1309,6 +1347,7 @@ Public Class cDakosy_NCTSOut_Warenposition
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("nctsWP_SumAEmpfaenger_Ort", nctsWP_SumAEmpfaenger_Ort))
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("nctsWP_SumAEmpfaenger_PLZ", nctsWP_SumAEmpfaenger_PLZ))
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("nctsWP_SumAEmpfaenger_Land", nctsWP_SumAEmpfaenger_Land))
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("nctsWP_KdRefNr", nctsWP_KdRefNr))
|
||||
|
||||
|
||||
Return list
|
||||
|
||||
Reference in New Issue
Block a user