div. Änderungen

This commit is contained in:
2026-05-11 16:43:05 +02:00
parent 967839e5c6
commit 96a0eb9971
6 changed files with 267 additions and 134 deletions

View File

@@ -31,15 +31,12 @@ Public Class frmAbrechnungHandling
If HandlingList.LIST.Count > 0 Then If HandlingList.LIST.Count > 0 Then
Dim dt_temp As New DataTable() Dim dt_temp As New DataTable()
Dim props = HandlingList.LIST(0).GetType().GetProperties() Dim props = HandlingList.LIST(0).GetType().GetProperties()
' Create columns automatically
For Each p In props For Each p In props
dt_temp.Columns.Add(p.Name, p.PropertyType) dt_temp.Columns.Add(p.Name, p.PropertyType)
Next Next
' Fill rows
For Each item In HandlingList.LIST For Each item In HandlingList.LIST
Dim row = dt_temp.NewRow() Dim row = dt_temp.NewRow()
@@ -50,9 +47,7 @@ Public Class frmAbrechnungHandling
dt_temp.Rows.Add(row) dt_temp.Rows.Add(row)
Next Next
dgvHandling.DataSource = dt_temp VERAG_PROG_ALLGEMEIN.cProgramFunctions.genExcelFromDT_NEW(dt_temp,,,,,,,, True)
VERAG_PROG_ALLGEMEIN.cProgramFunctions.genExcelFromDT_NEW(dt_temp)
End If End If
End Sub End Sub

View File

@@ -909,7 +909,7 @@ Public Class frmBelegNeu
BELEG.FilialenNr = IIf(IsNumeric(cboFiliale._value), cboFiliale._value, -1) BELEG.FilialenNr = IIf(IsNumeric(cboFiliale._value), cboFiliale._value, -1)
BELEG.AbfertigungsNr = IIf(IsNumeric(txtAbfertigungsNr.Text), txtAbfertigungsNr.Text, -1) BELEG.AbfertigungsNr = IIf(IsNumeric(txtAbfertigungsNr.Text), txtAbfertigungsNr.Text, -1)
Case Else Case Else
If Not PERSONAL.isLeihgeldkasse Then 'Wird berits anders geregelt If Not PERSONAL.isLeihgeldkasse Then 'Wird bereits anders geregelt
BELEG.LKW_Beleg = (Not cbxSplittung.Checked And AvisoID IsNot Nothing) BELEG.LKW_Beleg = (Not cbxSplittung.Checked And AvisoID IsNot Nothing)
If Not BELEG.LKW_Beleg Then If Not BELEG.LKW_Beleg Then

View File

@@ -731,7 +731,7 @@ Public Class usrCntlOfferte
dgvOfferteNew.Enabled = False dgvOfferteNew.Enabled = False
currentOffert = New VERAG_PROG_ALLGEMEIN.cOfferte(kdNr, dgvOfferteNew.SelectedRows(0).Cells("OffertenNr").Value, False) currentOffert = New VERAG_PROG_ALLGEMEIN.cOfferte(kdNr, dgvOfferteNew.SelectedRows(0).Cells("OffertenNr").Value, False)
Dim orgDataTable As DataTable = dgvOfferteDetails.DataSource Dim orgDataTable As System.Data.DataTable = dgvOfferteDetails.DataSource
tmpDataTable = orgDataTable.Copy tmpDataTable = orgDataTable.Copy
Catch ex As Exception Catch ex As Exception

View File

@@ -2016,7 +2016,10 @@ Public Class frmMDMDatenverarbetiung
sqlstr &= " SELECT 'PLOSE',AdressenNr,plose_Kennzeichen,plose_DatumTransaktion,plp_Land,isnull([tblPLOSE_Produktbeschreibung].plp_Description_EN,plose_Produktbeschreibung) as plose_Produktbeschreibung ,isnull(plose_NummerKarteGeraet,plose_Kontonummer) as plose_NummerKarteGeraet ,plose_BeschreibungEinfahrt,case when plose_BeschreibungAusfahrt is null and plose_BeschreibungMautTankstelle = 'Bregana' then 'Bregana' else isnull(plose_BeschreibungAusfahrt,'') end as plose_BeschreibungAusfahrt,plose_NettobetragWaehrungAbbuchung,(plose_BruttobetragWaehrungAbbuchung-plose_NettobetragWaehrungAbbuchung) as Steuer,plose_BruttobetragWaehrungAbbuchung " sqlstr &= " SELECT 'PLOSE',AdressenNr,plose_Kennzeichen,plose_DatumTransaktion,plp_Land,isnull([tblPLOSE_Produktbeschreibung].plp_Description_EN,plose_Produktbeschreibung) as plose_Produktbeschreibung ,isnull(plose_NummerKarteGeraet,plose_Kontonummer) as plose_NummerKarteGeraet ,plose_BeschreibungEinfahrt,case when plose_BeschreibungAusfahrt is null and plose_BeschreibungMautTankstelle = 'Bregana' then 'Bregana' else isnull(plose_BeschreibungAusfahrt,'') end as plose_BeschreibungAusfahrt,plose_NettobetragWaehrungAbbuchung,(plose_BruttobetragWaehrungAbbuchung-plose_NettobetragWaehrungAbbuchung) as Steuer,plose_BruttobetragWaehrungAbbuchung "
sqlstr &= " FROM tblPLOSE_Details INNER JOIN [tblPLOSE_Produktbeschreibung] on plose_ProduktCode=plp_ProductCode INNER JOIN Adressen on plose_POLSEKundennummer=PLOSEKundenNr and plp_LeistungsNr is not null " sqlstr &= " FROM tblPLOSE_Details INNER JOIN [tblPLOSE_Produktbeschreibung] on plose_ProduktCode=plp_ProductCode INNER JOIN Adressen on plose_POLSEKundennummer=PLOSEKundenNr and plp_LeistungsNr is not null "
sqlstr &= " WHERE 1=1 " sqlstr &= " WHERE 1=1 "
sqlstr &= " AND plose_Fakturiert=0 AND plose_ProduktCode NOT IN (" & ProduktCode_NOT_IN & " ) AND plp_Land NOT IN ('AT','DE') " 'sqlstr &= " AND plose_Fakturiert=0 AND plose_ProduktCode NOT IN (" & ProduktCode_NOT_IN & " ) AND plp_Land NOT IN ('AT','DE') "
sqlstr &= " AND cast(plose_FakturiertDatum as date) = '20.04.2026' AND plose_ProduktCode NOT IN (" & ProduktCode_NOT_IN & " ) AND plp_Land NOT IN ('AT','DE') "
sqlstr &= " AND plose_DatumTransaktion between '" & von.ToShortDateString & "' and '" & bis.ToShortDateString & "' " sqlstr &= " AND plose_DatumTransaktion between '" & von.ToShortDateString & "' and '" & bis.ToShortDateString & "' "
sqlstr &= " order by plp_Land, plose_DatumTransaktion" sqlstr &= " order by plp_Land, plose_DatumTransaktion"
@@ -2029,7 +2032,10 @@ Public Class frmMDMDatenverarbetiung
sqlstrAT &= " SELECT 'PLOSE',AdressenNr,plose_Kennzeichen,plose_DatumTransaktion,plp_Land,'' as plose_Produktbeschreibung ,plose_NummerKarteGeraet as plose_NummerKarteGeraet ,'' as plose_BeschreibungEinfahrt,'' as plose_BeschreibungAusfahrt,sum(plose_NettobetragWaehrungAbbuchung) as plose_NettobetragWaehrungAbbuchung,sum(plose_BruttobetragWaehrungAbbuchung-plose_NettobetragWaehrungAbbuchung) as Steuer,sum(plose_BruttobetragWaehrungAbbuchung ) as plose_BruttobetragWaehrungAbbuchung " sqlstrAT &= " SELECT 'PLOSE',AdressenNr,plose_Kennzeichen,plose_DatumTransaktion,plp_Land,'' as plose_Produktbeschreibung ,plose_NummerKarteGeraet as plose_NummerKarteGeraet ,'' as plose_BeschreibungEinfahrt,'' as plose_BeschreibungAusfahrt,sum(plose_NettobetragWaehrungAbbuchung) as plose_NettobetragWaehrungAbbuchung,sum(plose_BruttobetragWaehrungAbbuchung-plose_NettobetragWaehrungAbbuchung) as Steuer,sum(plose_BruttobetragWaehrungAbbuchung ) as plose_BruttobetragWaehrungAbbuchung "
sqlstrAT &= " FROM tblPLOSE_Details INNER JOIN [tblPLOSE_Produktbeschreibung] on plose_ProduktCode=plp_ProductCode INNER JOIN Adressen on plose_POLSEKundennummer=PLOSEKundenNr and plp_LeistungsNr is not null " sqlstrAT &= " FROM tblPLOSE_Details INNER JOIN [tblPLOSE_Produktbeschreibung] on plose_ProduktCode=plp_ProductCode INNER JOIN Adressen on plose_POLSEKundennummer=PLOSEKundenNr and plp_LeistungsNr is not null "
sqlstrAT &= " WHERE 1=1 " sqlstrAT &= " WHERE 1=1 "
sqlstrAT &= " AND plose_Fakturiert=0 AND plose_ProduktCode NOT IN (" & ProduktCode_NOT_IN & " ) AND plp_Land IN ('AT','DE') " 'sqlstrAT &= " AND plose_Fakturiert=0 AND plose_ProduktCode NOT IN (" & ProduktCode_NOT_IN & " ) AND plp_Land IN ('AT','DE') "
sqlstr &= " AND cast(plose_FakturiertDatum as date) = '20.04.2026' AND plose_ProduktCode NOT IN (" & ProduktCode_NOT_IN & " ) AND plp_Land NOT IN ('AT','DE') "
sqlstrAT &= " AND plose_DatumTransaktion between '" & von.ToShortDateString & "' and '" & bis.ToShortDateString & "' " sqlstrAT &= " AND plose_DatumTransaktion between '" & von.ToShortDateString & "' and '" & bis.ToShortDateString & "' "
sqlstrAT &= " group by plp_Land, AdressenNr, plose_Kennzeichen,plose_DatumTransaktion,plose_NummerKarteGeraet" sqlstrAT &= " group by plp_Land, AdressenNr, plose_Kennzeichen,plose_DatumTransaktion,plose_NummerKarteGeraet"
sqlstrAT &= " order by plp_Land" sqlstrAT &= " order by plp_Land"

View File

@@ -346,6 +346,7 @@ Public Class cIDS
Dim savedTrans As Integer = 0 Dim savedTrans As Integer = 0
Dim MDMEinarb As New cMDMEinarbeitung("IDS", Now()) Dim MDMEinarb As New cMDMEinarbeitung("IDS", Now())
Dim isTransactionDetail As Boolean = False
Do While (objFileRead.Peek() > -1) Do While (objFileRead.Peek() > -1)
Dim currentRow As String() Dim currentRow As String()
@@ -354,140 +355,109 @@ Public Class cIDS
lngRecordCount = lngRecordCount + 1 lngRecordCount = lngRecordCount + 1
If lngRecordCount = 1 Then If lngRecordCount = 1 Then
If Not (isleernothing((currentRow(0))) = "Year Month Day" AndAlso isleernothing((currentRow(14))) = "OBO Number") Then If Not (isleernothing((currentRow(0))) = "Year Month Day") Then
Return False Return False
End If End If
If isleernothing((currentRow(14))) = "OBO Number" Then isTransactionDetail = False
If isleernothing((currentRow(14))) = "Transaction Volume" Then isTransactionDetail = True
Else Else
Try Try
Dim ymd = isleernothing((currentRow(0))) If Not isTransactionDetail Then
Dim cc = isleernothing((currentRow(1)))
Dim pyn = isleernothing((currentRow(2)))
Dim occ = isleernothing((currentRow(5)))
Dim oc = isleernothing((currentRow(6)))
Dim ptc = isleernothing((currentRow(7)))
Dim vr = isleernothing((currentRow(13))) Dim ymd = isleernothing((currentRow(0)))
Dim obo = isleernothing((currentRow(14))) Dim cc = isleernothing((currentRow(1)))
Dim pyn = isleernothing((currentRow(2)))
Dim occ = isleernothing((currentRow(5)))
Dim oc = isleernothing((currentRow(6)))
Dim ptc = isleernothing((currentRow(7)))
Dim vr = isleernothing((currentRow(13)))
Dim obo = isleernothing((currentRow(14)))
'.VRNumber = isleernothing((currentRow(13))) Dim MDMEinarb_check As New cMDMEinarbeitung("IDS", ymd)
'.OBONumber = isleernothing((currentRow(14))) If MDMEinarb_check.hasEntry AndAlso MDMEinarb_check.completed Then Return False
Dim zusParam = ""
Dim isOBO As Boolean = False
If vr IsNot Nothing AndAlso vr <> "" Then
zusParam = vr
ElseIf obo IsNot Nothing AndAlso obo <> "" Then
zusParam = obo
isOBO = True
End If
Dim ids As New cIDS(ymd, pyn, cc, occ, oc, ptc, zusParam, isOBO)
Dim avprive = isleernothing((currentRow(12)))
Dim zusParam = "" With ids
Dim isOBO As Boolean = False .YearMonthDay = isleernothing((currentRow(0)))
If vr IsNot Nothing AndAlso vr <> "" Then .CustomerCode = isleernothing((currentRow(1)))
zusParam = vr .Paymentsummarynumber = isleernothing((currentRow(2)))
ElseIf obo IsNot Nothing AndAlso obo <> "" Then .CustomerName = isleernothing((currentRow(3)))
zusParam = obo .OutletCountry = isleernothing((currentRow(4)))
isOBO = True .OutletCountryCode = isleernothing((currentRow(5)))
End If .OutletCode = isleernothing((currentRow(6)))
.ProductTypeCode = isleernothing((currentRow(7)))
Dim ids As New cIDS(ymd, pyn, cc, occ, oc, ptc, zusParam, isOBO) If lngRecordCount = 2 Then
MDMEinarb.invoicedate = CDate(.YearMonthDay)
Dim avprive = isleernothing((currentRow(12))) End If
.TransactionVolume = isleernothing((currentRow(8)))
.AmminclVAT = isleernothing((currentRow(9)))
.TotalNetAmount = isleernothing((currentRow(10)))
.VATAmount = isleernothing((currentRow(11)))
.avpriceexclVAT = IIf(avprive <> "" AndAlso IsNumeric(avprive), avprive, 0)
Console.WriteLine("IDS: " & isleernothing((currentRow(1))) & " - " & lngRecordCount & " - " & isleernothing((currentRow(10))))
If isOBO Then
If .SAVE_OBO() Then counTrans += 1
Else
If .SAVE_VR() Then counTrans += 1
End If
End With
Else
Dim ymd = isleernothing((currentRow(0)))
Dim cc = isleernothing((currentRow(1)))
Dim cn = isleernothing((currentRow(2)))
Dim occ = isleernothing((currentRow(8)))
Dim oc = isleernothing((currentRow(9)))
Dim ptc = isleernothing((currentRow(11)))
Dim tv = isleernothing((currentRow(14)))
Dim t_time = isleernothing((currentRow(13)))
Dim t_date = isleernothing((currentRow(12)))
Dim tna = isleernothing((currentRow(16)))
Dim MDMEinarb_check As New cMDMEinarbeitung("IDS_Details", ymd)
If MDMEinarb_check.hasEntry AndAlso MDMEinarb_check.completed Then Return False
With ids Dim ids_detail As New cIDSDetails(ymd, cc, cn, occ, oc, ptc, t_time, t_date, tv, tna)
.YearMonthDay = isleernothing((currentRow(0))) ids_detail.AmminclVAT = isleernothing((currentRow(15)))
.CustomerCode = isleernothing((currentRow(1))) ids_detail.VATAmount = isleernothing((currentRow(17)))
.Paymentsummarynumber = isleernothing((currentRow(2))) ids_detail.avpriceexclVAT = isleernothing((currentRow(18)))
.CustomerName = isleernothing((currentRow(3))) ids_detail.Paymentsummarynumber = ""
.OutletCountry = isleernothing((currentRow(4))) If ids_detail.SAVE() Then counTrans += 1
.OutletCountryCode = isleernothing((currentRow(5)))
.OutletCode = isleernothing((currentRow(6)))
.ProductTypeCode = isleernothing((currentRow(7)))
If lngRecordCount = 2 Then If lngRecordCount = 2 Then
MDMEinarb.invoicedate = CDate(.YearMonthDay) MDMEinarb.invoicedate = CDate(ids_detail.YearMonthDay)
End If End If
'Dim transVol_old = .TransactionVolume
'Dim transVol_new = isleernothing((currentRow(8)))
'If transVol_old IsNot Nothing AndAlso IsNumeric(transVol_old) AndAlso transVol_new IsNot Nothing AndAlso IsNumeric(transVol_new) Then End If
' Dim AmininclVat_old = CDbl(.AmminclVAT)
' Dim AmininclVat_new = CDbl(isleernothing((currentRow(9)).Replace(".", ",")))
' Dim TotalNetAmount_old = CDbl(.TotalNetAmount)
' Dim TotalNetAmount_new = CDbl(isleernothing((currentRow(10)).Replace(".", ",")))
' Dim VATAmount_old = CDbl(.VATAmount)
' Dim VATAmount_new = CDbl(isleernothing((currentRow(11)).Replace(".", ",")))
' If (CDec(transVol_old) <> CDec(transVol_new)) AndAlso Math.Abs(CDbl(transVol_old)) = Math.Abs(CDbl(transVol_new.replace(".", ","))) Then 'case1: gleiche Transaktionshohe -> nicht abziehen, sondern nur Preis anpassen!
' If AmininclVat_old <> AmininclVat_new Then
' .TransactionVolume = transVol_old + transVol_new
' .AmminclVAT = AmininclVat_old + AmininclVat_new
' .TotalNetAmount = TotalNetAmount_old + TotalNetAmount_new
' .VATAmount = VATAmount_old + VATAmount_new
' End If
' ElseIf Math.Abs(CDbl(transVol_old)) > Math.Abs(CDbl(transVol_new.replace(".", ","))) AndAlso (CDec(transVol_old) <> CDec(transVol_new)) Then 'case2: alte Transaktionshohe höher als neue, abziehen!
' If AmininclVat_old <> AmininclVat_new Then
' .TransactionVolume = transVol_old + transVol_new
' .AmminclVAT = AmininclVat_old + AmininclVat_new
' .TotalNetAmount = TotalNetAmount_old + TotalNetAmount_new
' .VATAmount = VATAmount_old + VATAmount_new
' 'If .TransactionVolume < 0 Then .TransactionVolume = .TransactionVolume * -1
' End If
' ElseIf Math.Abs(CDbl(transVol_old)) < Math.Abs(CDbl(transVol_new.replace(".", ","))) AndAlso (CDec(transVol_old) <> CDec(transVol_new)) Then 'case3: alte Transaktionshohe niedriger als neue, dazuzählen (weil die "Stornierung" vor der eig. Transk. importiert werden kann)!
' If AmininclVat_old <> AmininclVat_new Then
' .TransactionVolume = transVol_old + transVol_new
' .AmminclVAT = AmininclVat_old + AmininclVat_new
' .TotalNetAmount = TotalNetAmount_old + TotalNetAmount_new
' .VATAmount = VATAmount_old + VATAmount_new
' 'If .TransactionVolume < 0 Then .TransactionVolume = .TransactionVolume * -1
' End If
' End If
'Else
.TransactionVolume = isleernothing((currentRow(8)))
.AmminclVAT = isleernothing((currentRow(9)))
.TotalNetAmount = isleernothing((currentRow(10)))
.VATAmount = isleernothing((currentRow(11)))
.avpriceexclVAT = IIf(avprive <> "" AndAlso IsNumeric(avprive), avprive, 0)
' End If
'.VRNumber = isleernothing((currentRow(13)))
'.OBONumber = isleernothing((currentRow(14)))
Console.WriteLine("IDS: " & isleernothing((currentRow(1))) & " - " & lngRecordCount & " - " & isleernothing((currentRow(10))))
If isOBO Then
If .SAVE_OBO() Then counTrans += 1
Else
If .SAVE_VR() Then counTrans += 1
End If
'.SAVE()
End With
Catch ex As Exception Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
@@ -496,20 +466,29 @@ Public Class cIDS
End If End If
Loop Loop
cnt = CInt(lngRecordCount) If Not isTransactionDetail Then
MDMEinarb.ds_total += cnt - 1 MDMEinarb.supplier = "IDS"
MDMEinarb.ds_count += counTrans Else
MDMEinarb.import_date = Now() MDMEinarb.supplier = "IDS_Details"
MDMEinarb.importfilename = fi.Name
If MDMEinarb.ds_total = MDMEinarb.ds_count Then
MDMEinarb.completed = True
MDMEinarb.completed_date = Now()
End If End If
MDMEinarb.SAVE() cnt = CInt(lngRecordCount)
objFileRead.Close() MDMEinarb.ds_total += cnt - 1
Return True MDMEinarb.ds_count += counTrans
MDMEinarb.import_date = Now()
MDMEinarb.importfilename = fi.Name
If MDMEinarb.ds_total = MDMEinarb.ds_count Then
MDMEinarb.completed = True
MDMEinarb.completed_date = Now()
End If
MDMEinarb.SAVE()
objFileRead.Close()
Return True
@@ -1319,6 +1298,160 @@ Public Class cIDSDieselpreisRW
End Class End Class
Public Class cIDSDetails
Property YearMonthDay As Object = Nothing
Property CustomerCode As Object = Nothing
Property CardNumber As Object = Nothing
Property Paymentsummarynumber As Object = Nothing
Property OutletCountryCode As Object = Nothing
Property OutletCode As Object = Nothing
Property ProductTypeCode As Object = Nothing
Property TransactionVolume As Object = Nothing
Property AmminclVAT As Object = Nothing
Property TotalNetAmount As Object = Nothing
Property VATAmount As Object = Nothing
Property avpriceexclVAT As Object = Nothing
Property Transactiondate As Object = Nothing
Property Transactiontime As Object = Nothing
Public hasEntry = False
Dim SQL As New SQL
Sub New()
End Sub
Sub New(YearMonthDay, CustomerCode, cardNumber, OutletCountryCode, OutletCode, ProductTypeCode, Transactiontime, Transactiondate, TransactionVolume, TotalNetAmount)
Me.YearMonthDay = YearMonthDay
Me.CardNumber = cardNumber
Me.CustomerCode = CustomerCode
Me.OutletCountryCode = OutletCountryCode
Me.OutletCode = OutletCode
Me.ProductTypeCode = ProductTypeCode
Me.Transactiontime = Transactiontime
Me.TransactionVolume = TransactionVolume
Me.TotalNetAmount = TotalNetAmount
Me.Transactiondate = Transactiondate
LOAD()
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("YearMonthDay", YearMonthDay))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("CustomerCode", CustomerCode))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("OutletCountryCode", OutletCountryCode))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("OutletCode", OutletCode))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("ProductTypeCode", ProductTypeCode))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("TransactionVolume", TransactionVolume))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("AmminclVAT", AmminclVAT))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("TotalNetAmount", TotalNetAmount))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("VATAmount", VATAmount))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("avpriceexclVAT", avpriceexclVAT))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("CardNumber", CardNumber))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Transactiondate", Transactiondate))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Transactiontime", Transactiontime))
Return list
End Function
Public Sub LOAD()
Try
hasEntry = False
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
Using cmd As New SqlCommand("SELECT * FROM tblIDSTransactionsNew_Details WHERE YearMonthDay=@YearMonthDay AND cardNumber=@cardNumber AND CustomerCode=@CustomerCode AND OutletCountryCode=@OutletCountryCode AND OutletCode=@OutletCode AND ProductTypeCode=@ProductTypeCode AND Transactiontime=@Transactiontime AND TransactionVolume=@TransactionVolume AND Transactiondate=@Transactiondate ", conn)
cmd.Parameters.AddWithValue("@YearMonthDay", YearMonthDay)
cmd.Parameters.AddWithValue("@CustomerCode", CustomerCode)
cmd.Parameters.AddWithValue("@OutletCountryCode", OutletCountryCode)
cmd.Parameters.AddWithValue("@OutletCode", OutletCode)
cmd.Parameters.AddWithValue("@ProductTypeCode", ProductTypeCode)
cmd.Parameters.AddWithValue("@cardNumber", CardNumber)
cmd.Parameters.AddWithValue("@Transactiontime", Transactiontime)
cmd.Parameters.AddWithValue("@TransactionVolume", TransactionVolume)
cmd.Parameters.AddWithValue("@TotalNetAmount", TotalNetAmount)
cmd.Parameters.AddWithValue("@Transactiondate", Transactiondate)
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 SAVE() As Boolean
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblIDSTransactionsNew_Details WHERE YearMonthDay=@YearMonthDay AND cardNumber=@cardNumber AND CustomerCode=@CustomerCode AND OutletCountryCode=@OutletCountryCode AND OutletCode=@OutletCode AND ProductTypeCode=@ProductTypeCode AND Transactiontime=@Transactiontime AND TransactionVolume=@TransactionVolume AND Transactiondate=@Transactiondate) " &
" BEGIN " & getUpdateCmd() & " END " &
" Else " &
" BEGIN " & getInsertCmd() & " END " &
" commit tran "
Return SQL.doSQLVarList(sqlstr, "FMZOLL", , list)
End Function
Public Function getUpdateCmd(Optional PARAM As String = "", Optional VALUE As String = "") 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 [tblIDSTransactionsNew_Details] SET " & str & " WHERE YearMonthDay=@YearMonthDay AND cardNumber=@cardNumber AND CustomerCode=@CustomerCode AND OutletCountryCode=@OutletCountryCode AND OutletCode=@OutletCode AND ProductTypeCode=@ProductTypeCode AND Transactiontime=@Transactiontime AND TransactionVolume=@TransactionVolume AND Transactiondate=@Transactiondate ")
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
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 tblIDSTransactionsNew_Details (" & 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

View File

@@ -1,7 +1,6 @@
 
Imports System.Data.SqlClient Imports System.Data.SqlClient
Imports System.Reflection Imports System.Reflection
Imports jdk.nashorn.internal.ir
Public Class cOfferteList Public Class cOfferteList
Property KundenNr As Object = Nothing Property KundenNr As Object = Nothing