Handling-Abrechnung, etc.

This commit is contained in:
2026-05-07 17:07:52 +02:00
parent 9ff0ccb60a
commit 1b677dee85
7 changed files with 614 additions and 69 deletions

View File

@@ -5,26 +5,45 @@ Imports System.Data.SqlClient
Public Class cHandlingssaetzeInternLIST
Property hs_Bezeichnung As Object = Nothing
Property hs_jahr As Object = Nothing
' Property OffertenNr As Object = Nothing
Public LIST As New List(Of cHandlingssaetzeIntern)
Dim SQL As New SQL
'Dim listTodelete As New List(Of cHandlingssaetzeIntern)
Sub New(hs_Bezeichnung)
Sub New(hs_Bezeichnung, hs_jahr)
Me.hs_Bezeichnung = hs_Bezeichnung
Me.hs_jahr = hs_jahr
' Me.OffertenNr = OffertenNr
LOAD_LIST(Me.hs_Bezeichnung)
LOAD_LIST(Me.hs_Bezeichnung, Me.hs_jahr)
End Sub
Public Sub CLEAR()
LIST.Clear()
End Sub
Public Sub LOAD_LIST(hs_Bezeichnung)
Public Sub LOAD_LIST(hs_Bezeichnung, Jahr)
Dim SQLString = " AND ISNULL(hs_gueltigAbJahr, " & Jahr & ") =
CASE
WHEN EXISTS (
SELECT 1
FROM [VERAG].[dbo].[tblHandlingssaetzeIntern]
WHERE hs_Bezeichnung = @hs_Bezeichnung
AND ISNULL(hs_gueltigAbJahr, " & Jahr & ") = " & Jahr & "
)
THEN 2023
ELSE (
SELECT MAX(ISNULL(hs_gueltigAbJahr, " & Jahr & "))
FROM [VERAG].[dbo].[tblHandlingssaetzeIntern]
WHERE hs_Bezeichnung = @hs_Bezeichnung
)
END"
Try
LIST.Clear()
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
Using cmd As New SqlCommand("SELECT * FROM tblHandlingssaetzeIntern WHERE hs_Bezeichnung=@hs_Bezeichnung ", conn)
Using cmd As New SqlCommand("SELECT * FROM tblHandlingssaetzeIntern WHERE hs_Bezeichnung=@hs_Bezeichnung " & SQLString, conn)
cmd.Parameters.AddWithValue("@hs_Bezeichnung", hs_Bezeichnung)
' cmd.Parameters.AddWithValue("@OffertenNr", OffertenNr)
Dim dr = cmd.ExecuteReader()