Revert "commit"

This commit is contained in:
2024-10-02 08:59:41 +00:00
parent 298156bc8d
commit a39d888c67
2987 changed files with 174 additions and 13775 deletions

View File

@@ -0,0 +1,103 @@
Imports System.Data.SqlClient
Imports System.Reflection
Public Class cAsfinagMaut
Property cardnumber As Object = Nothing
Property licenceplate As Object = Nothing
Property turnoverdate As Object = Nothing
Property contractPartner As Object = Nothing
Property netAmount As Object = Nothing
Property VATamount As Object = Nothing
Property totalAmount As Object = Nothing
Property additionalData As Object = Nothing
Property receiptnumber As Object = Nothing
Property receiptCreated As Boolean = False
Public hasEntry = False
Dim SQL As New SQL
Sub New()
End Sub
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("cardnumber", cardnumber))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("licenceplate", licenceplate))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("turnoverdate", turnoverdate))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("contractPartner", contractPartner))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("netAmount", netAmount))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("VATamount", VATamount))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("totalAmount", totalAmount))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("additionalData", additionalData))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("receiptnumber", receiptnumber))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("receiptCreated", receiptCreated))
Return list
End Function
Public Function SAVE() As Boolean
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim sqlstr = " BEGIN TRAN " &
" BEGIN " & getInsertCmd() & " END " &
" commit tran "
Return SQL.doSQLVarList(sqlstr, "FMZOLL", , list)
End Function
Public Sub LOAD()
Try
hasEntry = False
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
Using cmd As New SqlCommand("SELECT * FROM tblAsfinagMaut WHERE cardnumber=@cardnumber ", conn)
cmd.Parameters.AddWithValue("@cardnumber", cardnumber)
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
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End Sub
Public Function getInsertCmd() As String
Try
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim str As String = ""
Dim values As String = ""
For Each i In list
If Not i.isPrimaryParam Then
str &= "[" & i.Text & "],"
values &= "@" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
End If
Next
str = str.Substring(0, str.Length - 1) 'wg. ','
values = values.Substring(0, values.Length - 1) 'wg. ','
Return (" INSERT INTO tblAsfinagMaut (" & str & ") VALUES(" & values & ") ")
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
Return ""
End Function
End Class