Kundensicherheiten, CBAM-Rechner, etc.

This commit is contained in:
2026-10-21 16:55:38 +02:00
parent c6c5b7d1c2
commit 11f432ec67
7 changed files with 391 additions and 124 deletions

View File

@@ -24,6 +24,9 @@ Public Class cKundenSicherheiten
Public Property sc_stornoDatum As Date? = Nothing
Public Property sc_stornoMaId As Integer? = Nothing
Public Property sc_cbam_jahr As Integer? = Nothing
Public Property sc_cbam_quartal As Integer? = Nothing
Public hasEntry As Boolean = False
@@ -34,6 +37,13 @@ Public Class cKundenSicherheiten
LOAD()
End Sub
Sub New(sc_kundenNr As String, sc_cbam_quartal As Integer, sc_cbam_jahr As Integer)
sc_kundenNr = sc_kundenNr
sc_cbam_quartal = sc_cbam_quartal
sc_cbam_jahr = sc_cbam_jahr
LOADCBAM()
End Sub
Public Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
@@ -57,6 +67,8 @@ Public Class cKundenSicherheiten
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("sc_storno", sc_storno))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("sc_stornoDatum", sc_stornoDatum))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("sc_stornoMaId", sc_stornoMaId))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("sc_cbam_jahr", sc_cbam_jahr))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("sc_cbam_quartal", sc_cbam_quartal))
Return list
End Function
@@ -103,6 +115,33 @@ Public Class cKundenSicherheiten
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, MethodInfo.GetCurrentMethod.Name)
End Try
End Sub
Public Sub LOADCBAM()
Try
hasEntry = False
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
Using cmd As New SqlCommand("SELECT * FROM tblKundenSicherheiten WHERE sc_kundenNr=@sc_kundenNr and sc_cbam_quartal = @sc_cbam_quartal and sc_cbam_jahr = @sc_cbamsc_cbam_jahr_year", conn)
cmd.Parameters.AddWithValue("@sc_kundenNr", sc_kundenNr)
cmd.Parameters.AddWithValue("@sc_cbam_quartal", sc_cbam_quartal)
cmd.Parameters.AddWithValue("@sc_cbam_jahr", sc_cbam_jahr)
Dim dr = cmd.ExecuteReader()
If dr.Read Then
For Each li In getParameterList()
Dim prop As PropertyInfo = Me.GetType.GetProperty(li.Scalarvariable)
If dr(li.Text) Is DBNull.Value Then
prop.SetValue(Me, Nothing)
Else
prop.SetValue(Me, dr(li.Text))
End If
Next
hasEntry = True
End If
dr.Close()
End Using
End Using
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, MethodInfo.GetCurrentMethod.Name)
End Try
End Sub
Public Function getUpdateCmd() As String
Dim list = getParameterList()