Feature_Gesamtsicherheiten
This commit is contained in:
@@ -22,9 +22,10 @@ Public Class cGesamtsicherheitsPositionen
|
||||
|
||||
Dim SQL As New SQL
|
||||
|
||||
Sub New(gsp_gspPosId)
|
||||
Sub New(gsp_gsId, gsp_gspPosId)
|
||||
Me.gsp_gsId = gsp_gsId
|
||||
Me.gsp_gspPosId = gsp_gspPosId
|
||||
LOAD()
|
||||
'LOAD()
|
||||
End Sub
|
||||
|
||||
Sub New()
|
||||
@@ -33,7 +34,7 @@ Public Class cGesamtsicherheitsPositionen
|
||||
|
||||
Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
|
||||
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("gsp_gspPosId", gsp_gspPosId,, True))
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("gsp_gspPosId", gsp_gspPosId))
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("gsp_gsId", gsp_gsId))
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("gsp_warenwert", gsp_warenwert))
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("gsp_sicherheitsbetrag", gsp_sicherheitsbetrag))
|
||||
@@ -54,20 +55,20 @@ Public Class cGesamtsicherheitsPositionen
|
||||
Public Function SAVE() As Boolean
|
||||
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
||||
|
||||
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM [tblGesamtsicherheitsPositionen] WHERE gsp_gspPosId=@gsp_gspPosId AND gsp_gsId=@gsp_gsId ) " &
|
||||
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblGesamtsicherheitsPositionen WHERE gsp_gspPosId=@gsp_gspPosId AND gsp_gsId=@gsp_gsId ) " &
|
||||
" BEGIN " & getUpdateCmd() & " END " &
|
||||
" Else " &
|
||||
" BEGIN " & getInsertCmd() & " END " &
|
||||
" commit tran "
|
||||
|
||||
Return SQL.doSQLVarList(sqlstr, "FMZOLL", , list)
|
||||
Return SQL.doSQLVarList(sqlstr, "AVISO", , list)
|
||||
End Function
|
||||
|
||||
Public Sub LOAD()
|
||||
Try
|
||||
hasEntry = False
|
||||
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
|
||||
Using cmd As New SqlCommand("SELECT * FROM [tblGesamtsicherheitsPositionen] WHERE gsp_gspPosId=@gsp_gspPosId AND gsp_gsId=@gsp_gsId ", conn)
|
||||
Using conn As SqlConnection = SQL.GetNewOpenConnectionAVISO()
|
||||
Using cmd As New SqlCommand("SELECT * FROM tblGesamtsicherheitsPositionen WHERE gsp_gspPosId=@gsp_gspPosId AND gsp_gsId=@gsp_gsId ", conn)
|
||||
cmd.Parameters.AddWithValue("@gsp_gspPosId", gsp_gspPosId)
|
||||
cmd.Parameters.AddWithValue("@gsp_gsId", gsp_gsId)
|
||||
Dim dr = cmd.ExecuteReader()
|
||||
@@ -105,7 +106,7 @@ Public Class cGesamtsicherheitsPositionen
|
||||
End If
|
||||
Next
|
||||
str = str.Substring(0, str.Length - 1) 'wg. ','
|
||||
Return (" UPDATE [[tblGesamtsicherheitsPositionen]] SET " & str & " WHERE gsp_gspPosId=@gsp_gspPosId AND gsp_gsId=@gsp_gsId")
|
||||
Return (" UPDATE [tblGesamtsicherheitsPositionen] SET " & str & " WHERE gsp_gspPosId=@gsp_gspPosId AND gsp_gsId=@gsp_gsId")
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
|
||||
@@ -135,7 +136,9 @@ Public Class cGesamtsicherheitsPositionen
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Public Function Delete()
|
||||
SQL.doSQL("delete from [tblGesamtsicherheitsPositionen] where gsp_gsId = '" & gsp_gsId & "' AND gsp_gspPosId = '" & gsp_gspPosId & "' ", "AVISO")
|
||||
End Function
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user