merge
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
Imports System.Data.SqlClient
|
||||
Imports DocumentFormat.OpenXml.Bibliography
|
||||
|
||||
Public Class SQL
|
||||
Public Const LeerDatum As Date = #12/30/1899#
|
||||
@@ -21,9 +22,20 @@ Public Class SQL
|
||||
|
||||
Public Shared Function GetADMINConnectionString() As String
|
||||
If VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then
|
||||
Return My.MySettings.Default.ADMINConnectionString_DEV
|
||||
Try
|
||||
Return My.MySettings.Default.ADMINConnectionString_DEV
|
||||
Catch ex As Exception
|
||||
Return "Data Source=SQLGUIDE01.verag.ost.dmn;Initial Catalog=ADMIN;Integrated Security=false;User ID=AppUser;Password=yp/THDd?xM+pZ$;"
|
||||
|
||||
End Try
|
||||
|
||||
Else
|
||||
Return My.MySettings.Default.ADMINConnectionString_DEV
|
||||
Try
|
||||
Return My.MySettings.Default.ADMINConnectionString_DEV
|
||||
Catch ex As Exception
|
||||
Return "Data Source=SQLGUIDE01.verag.ost.dmn;Initial Catalog=ADMIN;Integrated Security=false;User ID=AppUser;Password=yp/THDd?xM+pZ$;"
|
||||
|
||||
End Try
|
||||
End If
|
||||
End Function
|
||||
Public Shared Function GetFMZOLLConnectionString() As String
|
||||
|
||||
@@ -11,10 +11,9 @@ Imports Spire.Pdf
|
||||
Imports Spire.Pdf.HtmlConverter
|
||||
Imports System.Threading
|
||||
Imports System.Net
|
||||
Imports Spire.Pdf.Tables
|
||||
Imports System.Windows.Forms.VisualStyles
|
||||
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports System.Runtime.InteropServices.ComTypes
|
||||
Imports System.Runtime.DesignerServices
|
||||
|
||||
Public Class cDATENSERVER
|
||||
|
||||
@@ -1249,6 +1248,7 @@ Public Class cFormularManager
|
||||
|
||||
Public Shared Sub PrintViaSpirePDF(PDFFile As String(), Optional printerName As String = "")
|
||||
Try
|
||||
Dim printerPaperSizeA4 As Boolean = False
|
||||
If printerName = "" Then
|
||||
Dim sPrinters As ArrayList
|
||||
|
||||
@@ -1263,9 +1263,22 @@ Public Class cFormularManager
|
||||
|
||||
If VERAG_PROG_ALLGEMEIN.cAllgemein.PRINTER_STANDARD <> String.Empty Then
|
||||
|
||||
For i As Integer = 0 To sPrinters.Count - 1
|
||||
If i.ToString.ToLower.Contains(VERAG_PROG_ALLGEMEIN.cAllgemein.PRINTER_STANDARD.ToLower) Then
|
||||
printerName = i
|
||||
For Each printer In sPrinters
|
||||
|
||||
If printer.ToString.ToLower.Contains(VERAG_PROG_ALLGEMEIN.cAllgemein.PRINTER_STANDARD.ToLower) Then
|
||||
printerName = printer
|
||||
For Each installedPrinter In System.Drawing.Printing.PrinterSettings.InstalledPrinters
|
||||
If printerName = installedPrinter.ToString Then
|
||||
Dim currentInstalledPrinter As New System.Drawing.Printing.PrinterSettings
|
||||
currentInstalledPrinter.PrinterName = printerName
|
||||
For Each sizes In currentInstalledPrinter.PaperSizes
|
||||
If sizes.PaperName = "A4" Then printerPaperSizeA4 = True
|
||||
Exit For
|
||||
Next
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
@@ -1273,14 +1286,35 @@ Public Class cFormularManager
|
||||
If printerName = "" Then
|
||||
Dim oPS As New System.Drawing.Printing.PrinterSettings
|
||||
printerName = oPS.PrinterName
|
||||
For Each sizes In oPS.PaperSizes
|
||||
If sizes.PaperName = "A4" Then printerPaperSizeA4 = True
|
||||
Exit For
|
||||
Next
|
||||
Else
|
||||
If Not printerPaperSizeA4 Then
|
||||
Dim currentInstalledPrinter As New System.Drawing.Printing.PrinterSettings
|
||||
currentInstalledPrinter.PrinterName = printerName
|
||||
For Each sizes In currentInstalledPrinter.PaperSizes
|
||||
If sizes.PaperName = "A4" Then printerPaperSizeA4 = True
|
||||
Exit For
|
||||
Next
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
'Dim docs As Spire.Pdf.PdfDocument() = {New Spire.Pdf.PdfDocument("C:\Users\DEVELOPER1\Desktop\Agrotel.pdf")}
|
||||
|
||||
If printerName = "" Then
|
||||
MsgBox("Drucker konnte nicht ermittelt werden!")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not printerPaperSizeA4 Then
|
||||
MsgBox("Der ermittelte Drucker " & printerName & " unterstützt keinen A4 Ausdrucke!" & vbNewLine & "Vorang wird abgebrochen!")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
VERAG_PROG_ALLGEMEIN.cProgramFunctions.spireLoadLicense()
|
||||
For Each pdfPath In PDFFile
|
||||
Dim doc As New Spire.Pdf.PdfDocument(pdfPath)
|
||||
@@ -1290,7 +1324,14 @@ Public Class cFormularManager
|
||||
doc.PageSettings.Orientation = Spire.Pdf.PdfPageOrientation.Landscape
|
||||
doc.PrintSettings.SelectSinglePageLayout(PdfSinglePageScalingMode.FitSize, True)
|
||||
doc.PrintSettings.PrinterName = printerName
|
||||
doc.Print()
|
||||
|
||||
If doc.PrintSettings.IsValid Then
|
||||
doc.Print()
|
||||
Else
|
||||
MsgBox("Druckereinstellungen ungültig!")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
|
||||
'doc.PrintDocument.DefaultPageSettings.Landscape = True
|
||||
@@ -1485,8 +1526,9 @@ Public Class cFormularManager
|
||||
|
||||
If openFileAfterDownload Then
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End Using
|
||||
End Using
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ Public Class cMSEAPI
|
||||
Dim SQL As New SQL
|
||||
Dim apiSettingsloaded As Boolean = False
|
||||
Dim test As Boolean = False
|
||||
Public PDFRECHNUNGENPFAD As String
|
||||
Dim PDFRECHNUNGENPFAD As String = ""
|
||||
|
||||
|
||||
Sub New(program As String)
|
||||
@@ -159,6 +159,103 @@ Public Class cMSEAPI
|
||||
|
||||
End Function
|
||||
|
||||
Public Function getNewestSettlements(jwt As String, dt As DataTable, ByRef batchNr As Integer, ByRef totalPages As Integer, ByRef currentPage As Integer) As String
|
||||
Try
|
||||
Dim returnText As String = ""
|
||||
Dim failureText As String = ""
|
||||
|
||||
Dim success As Boolean
|
||||
|
||||
rest.DebugMode = test
|
||||
|
||||
Dim bTls As Boolean = True
|
||||
Dim port As Integer = 443
|
||||
Dim bAutoReconnect As Boolean = True
|
||||
success = rest.Connect(API_STRING, port, bTls, bAutoReconnect)
|
||||
If (success <> True) Then
|
||||
Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason)
|
||||
Debug.WriteLine(rest.LastErrorText)
|
||||
failureText = rest.LastErrorText
|
||||
Return False
|
||||
End If
|
||||
|
||||
If (success <> True) Then
|
||||
Debug.WriteLine("BAFailReason: " & rest.ConnectFailReason)
|
||||
Debug.WriteLine(rest.LastErrorText)
|
||||
failureText = rest.LastErrorText
|
||||
Return False
|
||||
End If
|
||||
|
||||
rest.ClearAllQueryParams()
|
||||
|
||||
rest.AddHeader("X-API-Key", jwt)
|
||||
|
||||
rest.IdleTimeoutMs = 1000000
|
||||
|
||||
Dim responseJson As String = rest.FullRequestNoBody("GET", "/v1/settlements/new")
|
||||
If (rest.LastMethodSuccess <> True) Then
|
||||
Debug.WriteLine(rest.LastErrorText)
|
||||
rest.IdleTimeoutMs = 30000 'defualt
|
||||
Return rest.LastErrorText
|
||||
End If
|
||||
|
||||
If (rest.ResponseStatusCode <> IIf(rest.DebugMode = True, 201, 200) And rest.ResponseStatusCode <> 404) Then
|
||||
Debug.WriteLine(rest.ResponseHeader)
|
||||
Return rest.LastErrorText
|
||||
End If
|
||||
|
||||
Debug.WriteLine(responseJson)
|
||||
|
||||
'Newest Settlements werden nicht benötigt, erst beim Abrufen der RECHNUNG sollen die dazugehörigen Settlements abgerufen werden, allerdings müssen diese initial 1x per API abgerufen werden (mittels getNewSettlements , ansonsten können Sie nicht gefunden werden)!
|
||||
|
||||
'sollten sie dennoch gespeichert werden, dann fogenden Return-Statement auskommentieren (damit nachfolgender Code ausgeführt werden kann):
|
||||
|
||||
'-------------START---
|
||||
|
||||
Return ""
|
||||
|
||||
'-------------ENDE---
|
||||
|
||||
|
||||
If test Then
|
||||
responseJson = ""
|
||||
End If
|
||||
|
||||
Dim json As New Chilkat.JsonObject
|
||||
success = json.Load(responseJson)
|
||||
If (success <> True) Then
|
||||
Debug.WriteLine(json.LastErrorText)
|
||||
End If
|
||||
|
||||
Debug.WriteLine(json)
|
||||
|
||||
batchNr = json.StringOf("batch_seq_nr")
|
||||
totalPages = json.IntOf("total_pages")
|
||||
currentPage = json.IntOf("page_nr")
|
||||
|
||||
If json.StringOf("message") <> "" AndAlso json.StringOf("message") <> "OK" Then Return json.StringOf("message")
|
||||
|
||||
Dim settlements As New Chilkat.JsonArray
|
||||
settlements = json.ArrayOf("settlements")
|
||||
If (json.LastMethodSuccess = False) Then
|
||||
Debug.WriteLine("settlements member not found.")
|
||||
End If
|
||||
|
||||
|
||||
Dim num As Integer = settlements.Size
|
||||
If num = -1 Then
|
||||
Return "FEHLER im settlementsArray"
|
||||
End If
|
||||
|
||||
If json.StringOf("receiver") = "10738" Then saveSettlements(num, dt, settlements, json.StringOf("receiver"))
|
||||
|
||||
|
||||
Catch ex As WebException
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
End Try
|
||||
|
||||
End Function
|
||||
|
||||
Public Function getCustomers(jwt As String, dt As DataTable) As String
|
||||
Try
|
||||
Dim returnText As String = ""
|
||||
@@ -324,6 +421,8 @@ Public Class cMSEAPI
|
||||
Try
|
||||
Dim returnText As String = ""
|
||||
Dim failureText As String = ""
|
||||
Dim missingcounter As Integer = 0
|
||||
Dim listOfMissingTransactions As New List(Of String)
|
||||
|
||||
Dim success As Boolean
|
||||
|
||||
@@ -387,26 +486,40 @@ Public Class cMSEAPI
|
||||
End If
|
||||
|
||||
Debug.WriteLine(json)
|
||||
Dim saveTransaction As Boolean = True
|
||||
If json.StringOf("message") <> "" AndAlso json.StringOf("message") <> "OK" Then
|
||||
If Not json.StringOf("message").ToString.Contains("No transaction found for") Then
|
||||
Return json.StringOf("message")
|
||||
Else
|
||||
saveTransaction = False
|
||||
transactionID.Columns("found").ReadOnly = False
|
||||
row.Item("found") = False
|
||||
transactionID.Columns("found").ReadOnly = True
|
||||
|
||||
If json.StringOf("message") <> "" AndAlso json.StringOf("message") <> "OK" Then Return json.StringOf("message")
|
||||
|
||||
Dim transactions As New Chilkat.JsonArray
|
||||
transactions = json.ArrayOf("transactions")
|
||||
If (json.LastMethodSuccess = False) Then
|
||||
Debug.WriteLine("transactions member not found.")
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If saveTransaction Then
|
||||
Dim transactions As New Chilkat.JsonArray
|
||||
transactions = json.ArrayOf("transactions")
|
||||
If (json.LastMethodSuccess = False) Then
|
||||
Debug.WriteLine("transactions member not found.")
|
||||
End If
|
||||
|
||||
Dim num As Integer = transactions.Size
|
||||
If num = -1 Then
|
||||
Return "FEHLER Array Transaktions ist leer"
|
||||
|
||||
Dim num As Integer = transactions.Size
|
||||
If num = -1 Then
|
||||
Return "FEHLER Array Transaktions ist leer"
|
||||
End If
|
||||
|
||||
|
||||
'If json.StringOf("receiver") = "10738" Then saveTransactions(num, dt, transactions, json.StringOf("receiver"))
|
||||
saveTransactions(num, dt, transactions, json.StringOf("receiver"), True) ' wenn ID explizit aufgerufen keine Prüfung auf receivcer und purchaseDate
|
||||
End If
|
||||
|
||||
|
||||
'If json.StringOf("receiver") = "10738" Then saveTransactions(num, dt, transactions, json.StringOf("receiver"))
|
||||
saveTransactions(num, dt, transactions, json.StringOf("receiver"), True) ' wenn ID explizit aufgerufen keine Prüfung auf receivcer und purchaseDate
|
||||
|
||||
|
||||
Next row
|
||||
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>VERAG_PROG_ALLGEMEIN.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
@@ -34,6 +35,7 @@
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>VERAG_PROG_ALLGEMEIN.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
@@ -70,7 +72,7 @@
|
||||
<SignAssembly>false</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>ProgAllg.pfx</AssemblyOriginatorKeyFile>
|
||||
<AssemblyOriginatorKeyFile>Sebastian.pfx</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="ChilkatDotNet47, Version=9.5.0.96, Culture=neutral, PublicKeyToken=eb5fc1fc52ef09bd, processorArchitecture=AMD64">
|
||||
@@ -886,6 +888,7 @@
|
||||
<None Include="Schnittstellen\VERAG\OUT_NCTS\VERAG_out_ncts_V2_0_2.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Sebastian.pfx" />
|
||||
<None Include="Service References\DSFinVKService\Arrays.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
@@ -1269,10 +1272,10 @@
|
||||
<Version>13.0.3</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Polly">
|
||||
<Version>7.2.4</Version>
|
||||
<Version>8.4.1</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="RestSharp">
|
||||
<Version>110.2.0</Version>
|
||||
<Version>111.4.1</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user