GraphQL: show total lines inserted and mask special chars for insert
This commit is contained in:
parent
eff07ac410
commit
5b829e8ef1
@ -6,6 +6,7 @@ Imports DigitalData.Modules.Config
|
|||||||
Imports Newtonsoft.Json
|
Imports Newtonsoft.Json
|
||||||
Imports Newtonsoft.Json.Linq
|
Imports Newtonsoft.Json.Linq
|
||||||
Imports System.Net
|
Imports System.Net
|
||||||
|
Imports System.Text.RegularExpressions
|
||||||
|
|
||||||
Public Class frmMain
|
Public Class frmMain
|
||||||
Private _LogConfig As LogConfig
|
Private _LogConfig As LogConfig
|
||||||
@ -139,6 +140,8 @@ Public Class frmMain
|
|||||||
|
|
||||||
txtResult.Text = String.Empty
|
txtResult.Text = String.Empty
|
||||||
|
|
||||||
|
Dim oTotalTotal As Integer = 0
|
||||||
|
|
||||||
For Each oDatapool In _Datapools
|
For Each oDatapool In _Datapools
|
||||||
Dim oQuery As String = GRAPHQL_QUERY_SAP_DATA.Trim.Replace("__DATA_POOL__", oDatapool)
|
Dim oQuery As String = GRAPHQL_QUERY_SAP_DATA.Trim.Replace("__DATA_POOL__", oDatapool)
|
||||||
Dim oDataResponse = _Interface.GetData(oQuery, "SAPDaten")
|
Dim oDataResponse = _Interface.GetData(oQuery, "SAPDaten")
|
||||||
@ -161,7 +164,9 @@ Public Class frmMain
|
|||||||
ProgressBar1.Value = oCounter
|
ProgressBar1.Value = oCounter
|
||||||
|
|
||||||
For Each oItem As SAPDataItem In oData.sapdaten
|
For Each oItem As SAPDataItem In oData.sapdaten
|
||||||
Dim oSQL = $"INSERT INTO TBCUST_SYNC_API_SAPDATEN (BESCHREIBUNG, BUCHUNGSKREIS, KOSTENSTELLE, GUELTIG_BIS) VALUES ('{oItem.beschreibung}', '{oItem.buchungskreis}', '{oItem.kostenstelle}', '{oItem.gueltig_bis}')"
|
Dim oBeschreibung = Regex.Replace(oItem.beschreibung, "'", "''", RegexOptions.IgnoreCase)
|
||||||
|
|
||||||
|
Dim oSQL = $"INSERT INTO TBCUST_SYNC_API_SAPDATEN (BESCHREIBUNG, BUCHUNGSKREIS, KOSTENSTELLE, GUELTIG_BIS) VALUES ('{oBeschreibung}', '{oItem.buchungskreis}', '{oItem.kostenstelle}', '{oItem.gueltig_bis}')"
|
||||||
Dim oSuccess = _MSSQL.ExecuteNonQuery(oSQL)
|
Dim oSuccess = _MSSQL.ExecuteNonQuery(oSQL)
|
||||||
|
|
||||||
If oSuccess Then
|
If oSuccess Then
|
||||||
@ -177,7 +182,11 @@ Public Class frmMain
|
|||||||
txtResult.Text &= JsonConvert.SerializeObject(oObj, Formatting.Indented) & vbNewLine
|
txtResult.Text &= JsonConvert.SerializeObject(oObj, Formatting.Indented) & vbNewLine
|
||||||
|
|
||||||
Application.DoEvents()
|
Application.DoEvents()
|
||||||
|
|
||||||
|
oTotalTotal += oTotal
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
MsgBox($"Query finished! Lines inserted: [{oTotalTotal}]", MsgBoxStyle.Information, Text)
|
||||||
ElseIf cmbQuery.Text = "Custom" Then
|
ElseIf cmbQuery.Text = "Custom" Then
|
||||||
If txtOperation.Text = String.Empty Then
|
If txtOperation.Text = String.Empty Then
|
||||||
MsgBox("Please select an operation!", MsgBoxStyle.Exclamation, Text)
|
MsgBox("Please select an operation!", MsgBoxStyle.Exclamation, Text)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user