fiskaluebersicht

This commit is contained in:
2023-05-16 09:36:40 +02:00
parent 0544a5aeb3
commit 9f39fed031
12 changed files with 961 additions and 95 deletions

View File

@@ -0,0 +1,122 @@
Imports System.Data.SqlClient
Imports System.Reflection
Public Class cFiskalkunden
Property FK_Id As Integer
Property FK_Kdnr As Object = Nothing
Property FK_Datum As Object = Nothing
Property FK_Art As Object = Nothing
Property FK_locked As Object = Nothing
Public hasEntry = False
Dim SQL As New SQL
Sub New(FK_Id)
Me.FK_Id = FK_Id
LOAD()
End Sub
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("FK_Id", FK_Id,, True))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("FK_Kdnr", FK_Kdnr))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("FK_Datum", FK_Datum))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("FK_Art", FK_Art))
Return list
End Function
Public Function SAVE() As Boolean
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM [tblFiskalkunden] WHERE FK_Id=@FK_Id) " &
" BEGIN " & getUpdateCmd() & " END " &
" Else " &
" 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 tblTABLE WHERE FK_Id=@FK_Id ", conn)
cmd.Parameters.AddWithValue("@FK_Id", FK_Id)
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 Function getUpdateCmd() As String
Try
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim str As String = ""
For Each i In list
If Not i.isPrimaryParam Then
str &= "[" & i.Text & "] = @" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
End If
Next
str = str.Substring(0, str.Length - 1) 'wg. ','
Return (" UPDATE [tblFiskalkunden] SET " & str & " WHERE FK_Id=@FK_Id ")
Catch ex As Exception
MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
End Try
Return ""
End Function
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 [tblFiskalkunden] (" & str & ") VALUES(" & values & ") ")
Catch ex As Exception
MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
End Try
Return ""
End Function
End Class

View File

@@ -15,10 +15,8 @@ Public Class cCreditSafeAPI
'Test
'Shared API_STRING As String = "https://connect.sandbox.creditsafe.com"
'PROD
Shared API_STRING As String = "https://connect.creditsafe.com"
Shared token As String = ""
Public dataTable As New DataTable()
@@ -424,9 +422,9 @@ Public Class cCreditSafeAPI
rest.AddQueryParam("vatNo", company.vatNo)
Else
If company.name <> "" Then rest.AddQueryParam("name", company.name)
If company.csStreet <> "" Then rest.AddQueryParam("street", company.csStreet)
If company.csPostalcode <> "" Then rest.AddQueryParam("postCode", company.csPostalcode)
If company.csCity <> "" Then rest.AddQueryParam("city", company.csCity)
If company.Street <> "" Then rest.AddQueryParam("street", company.Street)
If company.Postalcode <> "" Then rest.AddQueryParam("postCode", company.Postalcode)
If company.City <> "" Then rest.AddQueryParam("city", company.City)
End If
@@ -495,6 +493,9 @@ Public Class cCreditSafeAPI
Public Property country As String
Public Property creditsafeNo As String
Public Property lastChecked As Date
Public Property City As String
Public Property Postalcode As String
Public Property Street As String
Public Property csIndex As String
Public Property csScore As String
Public Property csRiskclass As String
@@ -502,9 +503,7 @@ Public Class cCreditSafeAPI
Public Property csDFoundingDate As Date
Public Property csPDF As String
Public Property csFailure As String
Public Property csCity As String
Public Property csPostalcode As String
Public Property csStreet As String
Public Sub New(_name As String, _vatNo As String, _country As String, _creditsafeNo As String, _creditSafeId As String, _lastChecked As Date, _street As String, _postalCode As String, _city As String)
@@ -514,9 +513,9 @@ Public Class cCreditSafeAPI
country = _country
creditsafeNo = _creditsafeNo
lastChecked = _lastChecked
csStreet = _street
csPostalcode = _postalCode
csCity = _city
Street = _street
Postalcode = _postalCode
City = _city
End Sub
Public Sub New()

View File

@@ -339,6 +339,7 @@
<Compile Include="Classes\cFeiertage.vb" />
<Compile Include="Classes\cFilialen.vb" />
<Compile Include="Classes\cFirmen.vb" />
<Compile Include="Classes\cFiskalkunden.vb" />
<Compile Include="Classes\cFremdSpeditionenZuordnung.vb" />
<Compile Include="Classes\cGelangensbestaetigung.vb" />
<Compile Include="Classes\cGesamtsicherheitsPositionen.vb" />