div. Änderungen
This commit is contained in:
@@ -2,16 +2,9 @@
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.IO
|
||||
Imports System.Net
|
||||
Imports System.Numerics
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices.ComTypes
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports System.Threading
|
||||
Imports System.Web.UI
|
||||
Imports com.sun.org.apache.xalan.internal.xsltc
|
||||
Imports com.sun.source.tree
|
||||
Imports Microsoft.VisualBasic.ApplicationServices
|
||||
Imports Org.BouncyCastle.Ocsp
|
||||
|
||||
|
||||
Public Class cCreditSafeAPI
|
||||
@@ -497,14 +490,14 @@ Public Class cCreditSafeAPI
|
||||
|
||||
If failureDesc <> "" Then
|
||||
If showError Then MsgBox(failureDesc)
|
||||
Return "Error"
|
||||
Return "Error" & vbNewLine & failureDesc & vbNewLine & myUrl
|
||||
End If
|
||||
|
||||
Dim json As New Chilkat.JsonObject
|
||||
Dim success As Boolean = json.Load(jsonRespString)
|
||||
If (success <> True) Then
|
||||
Debug.WriteLine(json.LastErrorText)
|
||||
Return "Verbindungsfehler"
|
||||
Return "Verbindungsfehler" & vbNewLine & json.LastErrorText
|
||||
End If
|
||||
|
||||
If dtEvents.Columns.Count = 0 Then
|
||||
@@ -575,7 +568,7 @@ Public Class cCreditSafeAPI
|
||||
|
||||
dtEvents.Rows.Add(R)
|
||||
|
||||
Dim cEvent As New cCreditsafeEvent(CLng(R("eventId")))
|
||||
Dim cEvent As New cCreditsafeEvent(CLng(R("eventId")), company.kdNr)
|
||||
|
||||
cEvent.eventId = R("eventId")
|
||||
cEvent.companyId = R("companyId")
|
||||
@@ -1409,9 +1402,16 @@ Public Class cCreditSafeAPI
|
||||
Me.eventId = eventId
|
||||
LOAD()
|
||||
End Sub
|
||||
|
||||
Sub New(eventId, kundenNr) 'zwei unterschiedliche KundenNr können dieselbe eventID besitzen (weil bei uns alles tlw. doppelt angelegt ist!!!!!)
|
||||
Me.eventId = eventId
|
||||
kundenNr = kundenNr
|
||||
LOADKDNR()
|
||||
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("eventId", eventId,, True))
|
||||
'list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("eventId", eventId,, True))
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("eventId", eventId))
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("companyId", companyId))
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("portfolioId", portfolioId))
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("ruleName", ruleName))
|
||||
@@ -1443,7 +1443,7 @@ Public Class cCreditSafeAPI
|
||||
Public Function SAVE() As Boolean
|
||||
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
||||
|
||||
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblCreditsafeEvents WHERE eventId=@eventId) " &
|
||||
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblCreditsafeEvents WHERE eventId=@eventId AND kundenNr=@kundenNr) " &
|
||||
" BEGIN " & getUpdateCmd() & " END " &
|
||||
" Else " &
|
||||
" BEGIN " & getInsertCmd() & " END " &
|
||||
@@ -1480,6 +1480,35 @@ Public Class cCreditSafeAPI
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public Sub LOADKDNR()
|
||||
Try
|
||||
hasEntry = False
|
||||
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
|
||||
Using cmd As New SqlCommand("SELECT * FROM tblCreditsafeEvents WHERE eventId=@eventId AND kundenNr=@kundenNr ", conn)
|
||||
cmd.Parameters.AddWithValue("@eventId", eventId)
|
||||
cmd.Parameters.AddWithValue("@kundenNr", kundenNr)
|
||||
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 getUpdateCmd() As String
|
||||
@@ -1493,7 +1522,7 @@ Public Class cCreditSafeAPI
|
||||
End If
|
||||
Next
|
||||
str = str.Substring(0, str.Length - 1) 'wg. ','
|
||||
Return (" UPDATE tblCreditsafeEvents SET " & str & " WHERE eventId=@eventId ")
|
||||
Return (" UPDATE tblCreditsafeEvents SET " & str & " WHERE eventId=@eventId AND kundenNr=@kundenNr")
|
||||
|
||||
Catch ex As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
|
||||
Reference in New Issue
Block a user