plose, StartOpt.
This commit is contained in:
@@ -6,6 +6,7 @@ Imports System.Security.Cryptography.X509Certificates
|
||||
Imports System.Text
|
||||
Imports System.Threading
|
||||
Imports System.Xml
|
||||
Imports com.sun.xml.internal.rngom.digested
|
||||
Imports MDM_Worker
|
||||
Imports Renci.SshNet
|
||||
Imports VERAG_PROG_ALLGEMEIN
|
||||
@@ -847,7 +848,9 @@ Public Class frmStartOptions
|
||||
Case "CREDITSAFE_UPLOADS"
|
||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
||||
|
||||
UploadCompaniesToCreditsafe()
|
||||
Dim sync As Boolean = True
|
||||
|
||||
UploadCompaniesToCreditsafe(sync)
|
||||
|
||||
closeMe()
|
||||
|
||||
@@ -6278,7 +6281,7 @@ weiter:
|
||||
|
||||
'Existing companies in the portfolio will be skipped, and only new unique entries will be added.
|
||||
|
||||
UploadCompaniesToCreditsafe()
|
||||
UploadCompaniesToCreditsafe(cbxCSsync.Checked)
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -6357,7 +6360,7 @@ weiter:
|
||||
'3. Drill Down to Company-Level Events When Needed: For detailed insights into a specific company, use the company-specific endpoint.
|
||||
'4. Verify Enabled Rules: Ensure that the appropriate event rules are enabled for your portfolios to capture the desired notifications. Refer to the Activate Event Rules section for guidance.
|
||||
|
||||
'aktuell machem wir gleich punkt 3, das verursacht sehr viele APP-Aurfrufe, besser nach der Liste oben!
|
||||
'aktuell machem wir gleich Punkt 3 (damit haben wir alle Informationen), das verursacht allerdings sehr viele API-Aurfrufe, besser nach dem Best Practice oben!
|
||||
|
||||
|
||||
Dim creditsaveOld As String = "
|
||||
@@ -6426,14 +6429,21 @@ weiter:
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub UploadCompaniesToCreditsafe()
|
||||
Private Sub UploadCompaniesToCreditsafe(sync As Boolean)
|
||||
|
||||
Dim cs = New cCreditSafeAPI("creditsafe")
|
||||
Dim addCreditsave As Boolean = False
|
||||
If cs.authenticate() = "200" Then addCreditsave = True
|
||||
|
||||
'The Sync method allows you to replace all existing companies in a portfolio with the contents of an uploaded file.
|
||||
'Unlike the Import method, this endpoint overwrites the entire portfolio, deleting all previously allocated companies.
|
||||
|
||||
Dim where As String = ""
|
||||
|
||||
If Not sync Then where = " and kde_CSPortfolioAdded = 0"
|
||||
|
||||
While addCreditsave
|
||||
Dim creditsave As String = "select kde_CreditSaveNo 'Safe Number', '' as 'Local Org No.',left(kde_CreditSaveId,2) as 'Country Code', '' as Reference, '' as 'Free Text', '' as 'Personal Limit' from tblKundenErweitert where isnull(tblKundenErweitert.kde_CreditSaveId,'') <> '' and kde_CreditSaveId <> 'True' and kde_CreditSaveId <>'False' and isnull(kde_CreditSaveNo,'') <> '' and kde_CSPortfolioAdded = 0 group by kde_CreditSaveNo, kde_CreditSaveId"
|
||||
Dim creditsave As String = "select kde_CreditSaveNo 'Safe Number', '' as 'Local Org No.',left(kde_CreditSaveId,2) as 'Country Code', '' as Reference, '' as 'Free Text', '' as 'Personal Limit' from tblKundenErweitert inner join Adressen on Adressen.AdressenNr = kde_KundenNr where isnull(tblKundenErweitert.kde_CreditSaveId,'') <> '' and kde_CreditSaveId <> 'True' and kde_CreditSaveId <>'False' and isnull(kde_CreditSaveNo,'') <> '' " & where & " and Adressen.Auswahl = 'A' group by kde_CreditSaveNo, kde_CreditSaveId"
|
||||
Dim dtCreditsafe_CSV As DataTable = (New SQL).loadDgvBySql(creditsave, "FMZOLL")
|
||||
|
||||
If dtCreditsafe_CSV.Rows.Count = 0 Then
|
||||
@@ -6442,11 +6452,13 @@ weiter:
|
||||
|
||||
Dim Path As String = VERAG_PROG_ALLGEMEIN.cProgramFunctions.genCSVFromDT(dtCreditsafe_CSV,,, "importcsv")
|
||||
If Path <> "" Then
|
||||
If cs.AddCompaniesCSVToPortfolio(Path).Contains("400") Then 'bei Fehler abbrechen!
|
||||
|
||||
Dim resp = cs.AddCompaniesCSVToPortfolio(Path, sync)
|
||||
If resp IsNot Nothing AndAlso resp.Contains("400") Then 'bei Fehler abbrechen!
|
||||
Exit While
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Dim displayView = New DataView(dtCreditsafe_CSV, "", "Safe Number", DataViewRowState.CurrentRows)
|
||||
@@ -6464,7 +6476,7 @@ weiter:
|
||||
addCreditsave = (New SQL).doSQL("Update tblKundenErweitert set kde_CSPortfolioAdded = 1 where kde_CreditSaveNo in (" & CS_ID & ")", "FMZOLL")
|
||||
End If
|
||||
|
||||
|
||||
If sync Then addCreditsave = False
|
||||
|
||||
End While
|
||||
|
||||
|
||||
Reference in New Issue
Block a user