Offert, Sicherheiten, etc.

This commit is contained in:
2025-12-17 11:21:05 +01:00
parent eb7d05101e
commit e9ce8f66c8
6 changed files with 455 additions and 89 deletions

View File

@@ -40,6 +40,13 @@ Public Class cSicherheiten
LOAD()
End Sub
Sub New(gs_gsID, gs_posNr, gs_posSubNr)
Me.gs_gsId = gs_gsID
Me.gs_posNr = gs_posNr
Me.gs_posSubNr = gs_posSubNr
LOADSubNr()
End Sub
Sub New(gs_gsNr)
Me.gs_gsNr = gs_gsNr
LOADGSNR()
@@ -49,7 +56,7 @@ Public Class cSicherheiten
End Sub
Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
Function getParameterList(Optional WithoutPosSubNr As Boolean = False) As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("gs_gsId", gs_gsId,, True))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("gs_ATBNr", gs_ATBNr))
@@ -76,7 +83,7 @@ Public Class cSicherheiten
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("gs_zuletztgeandert", gs_zuletztgeandert))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("gs_systemuser", gs_systemuser))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("gs_MRNNr", gs_MRNNr))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("gs_posSubNr", gs_posSubNr))
If Not WithoutPosSubNr Then list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("gs_posSubNr", gs_posSubNr))
Return list
End Function
@@ -110,19 +117,21 @@ Public Class cSicherheiten
Public Function UPDATEWithNewPosNr() As Integer
Public Function UPDATEWithNewPosNr(Optional ingorePosSubNr As Boolean = False) As Integer
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList(ingorePosSubNr)
Dim sqlstr = " BEGIN " & getUpdateCmd() & " END "
Dim sqlstr = " BEGIN " & getUpdateCmd(ingorePosSubNr) & " END "
gs_gsId = SQL.doSQLVarListID(gs_gsId, sqlstr, "AVISO", , List)
gs_gsId = SQL.doSQLVarListID(gs_gsId, sqlstr, "AVISO", , list)
Return gs_gsId
End Function
Public Sub LOAD()
Try
hasEntry = False
@@ -152,6 +161,36 @@ Public Class cSicherheiten
End Try
End Sub
Public Sub LOADSubNr()
Try
hasEntry = False
Using conn As SqlConnection = SQL.GetNewOpenConnectionAVISO()
Using cmd As New SqlCommand("SELECT * FROM [tblGesamtsicherheit] WHERE gs_gsId=@gs_gsId AND gs_posNr=@gs_posNr AND gs_posSubNr=@gs_posSubNr ", conn)
cmd.Parameters.AddWithValue("@gs_gsID", gs_gsId)
cmd.Parameters.AddWithValue("@gs_posNr", gs_posNr)
cmd.Parameters.AddWithValue("@gs_posSubNr", gs_posSubNr)
Dim dr = cmd.ExecuteReader()
If dr.Read Then
For Each li In getParameterList()
Dim propInfo As PropertyInfo = Me.GetType.GetProperty(li.Scalarvariable)
If dr.Item(li.Text) Is DBNull.Value Then
propInfo.SetValue(Me, Nothing)
Else
propInfo.SetValue(Me, dr.Item(li.Text))
End If
Next
hasEntry = True
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
End Sub
Public Sub LOADGSNR()
Try
@@ -184,9 +223,9 @@ Public Class cSicherheiten
Public Function getUpdateCmd() As String
Public Function getUpdateCmd(Optional ingorePosSubNr As Boolean = False) As String
Try
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList(ingorePosSubNr)
Dim str As String = ""
For Each i In list