CreditSafe Check

This commit is contained in:
2023-03-22 12:37:00 +01:00
parent 69599f989d
commit c6b08132a3
7 changed files with 224 additions and 22 deletions

View File

@@ -61,6 +61,14 @@
<assemblyIdentity name="GrapeCity.ActiveReports.Win" publicKeyToken="cc4967777c49a3ff" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-15.2.4.0" newVersion="15.2.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Renci.SshNet" publicKeyToken="1cee9f8bde3db106" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2014.4.6.0" newVersion="2014.4.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.8.2.0" newVersion="1.8.2.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -218,6 +218,9 @@
<Reference Include="MySql.Data">
<HintPath>..\..\..\dll\.net MySQL v4.5.2\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PdfSharp">
<HintPath>..\..\..\dll\PdfSharp.dll</HintPath>
</Reference>
@@ -237,6 +240,7 @@
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http" />
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>

View File

@@ -136,6 +136,22 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Renci.SshNet" publicKeyToken="1cee9f8bde3db106" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2014.4.6.0" newVersion="2014.4.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.8.2.0" newVersion="1.8.2.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>

View File

@@ -60,8 +60,17 @@ Partial Class frmMitarbDetails
Me.Label43 = New System.Windows.Forms.Label()
Me.cboEZOLL_SB = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.cboATLAS_SB = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.TabPage5 = New System.Windows.Forms.TabPage()
Me.lblCheckconnection = New System.Windows.Forms.Label()
Me.Button6 = New System.Windows.Forms.Button()
Me.txtCSPW = New System.Windows.Forms.TextBox()
Me.Label58 = New System.Windows.Forms.Label()
Me.txtCSUser = New System.Windows.Forms.TextBox()
Me.Label59 = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.GroupBox2 = New System.Windows.Forms.GroupBox()
Me.txtAbweichenderAnzeigename = New System.Windows.Forms.TextBox()
Me.Label57 = New System.Windows.Forms.Label()
Me.cboFaktGrp = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.Label56 = New System.Windows.Forms.Label()
Me.cboALIASDomain2 = New VERAG_PROG_ALLGEMEIN.MyComboBox()
@@ -173,8 +182,6 @@ Partial Class frmMitarbDetails
Me.PictureBox6 = New System.Windows.Forms.PictureBox()
Me.cboAdminBer = New System.Windows.Forms.ComboBox()
Me.Label7 = New System.Windows.Forms.Label()
Me.txtAbweichenderAnzeigename = New System.Windows.Forms.TextBox()
Me.Label57 = New System.Windows.Forms.Label()
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.Panel1.SuspendLayout()
Me.TabControl2.SuspendLayout()
@@ -182,6 +189,7 @@ Partial Class frmMitarbDetails
Me.tbcntr.SuspendLayout()
Me.TabPage2.SuspendLayout()
Me.TabPage4.SuspendLayout()
Me.TabPage5.SuspendLayout()
Me.GroupBox2.SuspendLayout()
Me.GroupBox1.SuspendLayout()
CType(Me.picFoto, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -302,6 +310,7 @@ Partial Class frmMitarbDetails
'
Me.tbcntr.Controls.Add(Me.TabPage2)
Me.tbcntr.Controls.Add(Me.TabPage4)
Me.tbcntr.Controls.Add(Me.TabPage5)
Me.tbcntr.Location = New System.Drawing.Point(2, 539)
Me.tbcntr.Name = "tbcntr"
Me.tbcntr.SelectedIndex = 0
@@ -623,6 +632,79 @@ Partial Class frmMitarbDetails
Me.cboATLAS_SB.Size = New System.Drawing.Size(200, 21)
Me.cboATLAS_SB.TabIndex = 107
'
'TabPage5
'
Me.TabPage5.Controls.Add(Me.lblCheckconnection)
Me.TabPage5.Controls.Add(Me.Button6)
Me.TabPage5.Controls.Add(Me.txtCSPW)
Me.TabPage5.Controls.Add(Me.Label58)
Me.TabPage5.Controls.Add(Me.txtCSUser)
Me.TabPage5.Controls.Add(Me.Label59)
Me.TabPage5.Location = New System.Drawing.Point(4, 22)
Me.TabPage5.Name = "TabPage5"
Me.TabPage5.Size = New System.Drawing.Size(442, 174)
Me.TabPage5.TabIndex = 2
Me.TabPage5.Text = "Zuordnung Creditsafe"
Me.TabPage5.UseVisualStyleBackColor = True
'
'lblCheckconnection
'
Me.lblCheckconnection.AutoSize = True
Me.lblCheckconnection.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblCheckconnection.Location = New System.Drawing.Point(131, 104)
Me.lblCheckconnection.Name = "lblCheckconnection"
Me.lblCheckconnection.Size = New System.Drawing.Size(0, 13)
Me.lblCheckconnection.TabIndex = 121
'
'Button6
'
Me.Button6.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.Button6.BackColor = System.Drawing.Color.White
Me.Button6.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button6.Location = New System.Drawing.Point(14, 97)
Me.Button6.Name = "Button6"
Me.Button6.Size = New System.Drawing.Size(88, 26)
Me.Button6.TabIndex = 53
Me.Button6.Text = "prüfen"
Me.Button6.UseVisualStyleBackColor = False
'
'txtCSPW
'
Me.txtCSPW.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtCSPW.Location = New System.Drawing.Point(14, 71)
Me.txtCSPW.Name = "txtCSPW"
Me.txtCSPW.Size = New System.Drawing.Size(200, 20)
Me.txtCSPW.TabIndex = 120
Me.txtCSPW.UseSystemPasswordChar = True
'
'Label58
'
Me.Label58.AutoSize = True
Me.Label58.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label58.Location = New System.Drawing.Point(11, 55)
Me.Label58.Name = "Label58"
Me.Label58.Size = New System.Drawing.Size(50, 13)
Me.Label58.TabIndex = 119
Me.Label58.Text = "Passwort"
'
'txtCSUser
'
Me.txtCSUser.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtCSUser.Location = New System.Drawing.Point(12, 28)
Me.txtCSUser.Name = "txtCSUser"
Me.txtCSUser.Size = New System.Drawing.Size(200, 20)
Me.txtCSUser.TabIndex = 118
'
'Label59
'
Me.Label59.AutoSize = True
Me.Label59.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label59.Location = New System.Drawing.Point(9, 12)
Me.Label59.Name = "Label59"
Me.Label59.Size = New System.Drawing.Size(49, 13)
Me.Label59.TabIndex = 117
Me.Label59.Text = "Benutzer"
'
'Label4
'
Me.Label4.AutoSize = True
@@ -682,6 +764,24 @@ Partial Class frmMitarbDetails
Me.GroupBox2.TabStop = False
Me.GroupBox2.Text = "Firmendaten"
'
'txtAbweichenderAnzeigename
'
Me.txtAbweichenderAnzeigename.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtAbweichenderAnzeigename.Location = New System.Drawing.Point(399, 156)
Me.txtAbweichenderAnzeigename.Name = "txtAbweichenderAnzeigename"
Me.txtAbweichenderAnzeigename.Size = New System.Drawing.Size(148, 20)
Me.txtAbweichenderAnzeigename.TabIndex = 109
'
'Label57
'
Me.Label57.AutoSize = True
Me.Label57.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label57.Location = New System.Drawing.Point(396, 140)
Me.Label57.Name = "Label57"
Me.Label57.Size = New System.Drawing.Size(151, 13)
Me.Label57.TabIndex = 110
Me.Label57.Text = "And. Anzeigename (Aviso,TV):"
'
'cboFaktGrp
'
Me.cboFaktGrp._allowedValuesFreiText = Nothing
@@ -1893,24 +1993,6 @@ Partial Class frmMitarbDetails
Me.Label7.TabIndex = 78
Me.Label7.Text = "Berechtigung:"
'
'txtAbweichenderAnzeigename
'
Me.txtAbweichenderAnzeigename.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtAbweichenderAnzeigename.Location = New System.Drawing.Point(399, 156)
Me.txtAbweichenderAnzeigename.Name = "txtAbweichenderAnzeigename"
Me.txtAbweichenderAnzeigename.Size = New System.Drawing.Size(148, 20)
Me.txtAbweichenderAnzeigename.TabIndex = 109
'
'Label57
'
Me.Label57.AutoSize = True
Me.Label57.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label57.Location = New System.Drawing.Point(396, 140)
Me.Label57.Name = "Label57"
Me.Label57.Size = New System.Drawing.Size(151, 13)
Me.Label57.TabIndex = 110
Me.Label57.Text = "And. Anzeigename (Aviso,TV):"
'
'frmMitarbDetails
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -1936,6 +2018,8 @@ Partial Class frmMitarbDetails
Me.TabPage2.PerformLayout()
Me.TabPage4.ResumeLayout(False)
Me.TabPage4.PerformLayout()
Me.TabPage5.ResumeLayout(False)
Me.TabPage5.PerformLayout()
Me.GroupBox2.ResumeLayout(False)
Me.GroupBox2.PerformLayout()
Me.GroupBox1.ResumeLayout(False)
@@ -2105,4 +2189,11 @@ Partial Class frmMitarbDetails
Friend WithEvents Label56 As Label
Friend WithEvents txtAbweichenderAnzeigename As TextBox
Friend WithEvents Label57 As Label
Friend WithEvents TabPage5 As TabPage
Friend WithEvents lblCheckconnection As Label
Friend WithEvents Button6 As Button
Friend WithEvents txtCSPW As TextBox
Friend WithEvents Label58 As Label
Friend WithEvents txtCSUser As TextBox
Friend WithEvents Label59 As Label
End Class

View File

@@ -121,7 +121,7 @@
<data name="PictureBox6.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wQAADsEBuJFr7QAAAhBJREFUWEftlbFKA1EQRQP5FyG1fyBp/ANT2KYxWNkm+AExtYipLASDlYVpRBSC
vwAADr8BOAVTJAAAAhBJREFUWEftlbFKA1EQRQP5FyG1fyBp/ANT2KYxWNkm+AExtYipLASDlYVpRBSC
RRoDQbBYEItAFLQwksJi9Qy5j8ljG5vdZgdmd959M3fuzEaspAVbKaAUUApYE/CzWJjH9h/cn+M46y4I
eBuN0ptq1XzcaKzQ1GLhD/V6OhsODectnFoI72u1UM85jpWrWvAgYNrphCSIMBXS+LnXMxwHT/r9kP86
GKyd4dJAPtaZXA1pApbzuV1Crolp8pUkFj+2WpaMCM4QkocwzhKnM4LwOOZePRCCmQCp50ICPieTsCru

View File

@@ -1,4 +1,16 @@
Public Class frmMitarbDetails

Imports System.IO
Imports System.Net
Imports System.Net.Http
Imports System.Net.WebRequestMethods
Imports System.Security.Policy
Imports System.Text
Imports System.Windows
Imports Newtonsoft.Json
Public Class frmMitarbDetails
Private UID As New cMitarbeiter
Private berechtigungen As New List(Of cBerechtigungen)
@@ -834,4 +846,74 @@
End If
cboFirmaHaupt.Enabled = (cboFirma.Text = "ALLE")
End Sub
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
Dim myUrl As New Uri("https://connect.creditsafe.com/v1/authenticate")
lblCheckconnection.Text = ""
If txtCSUser.Text = "" Then
lblCheckconnection.Text = "User ist leer!"
Exit Sub
End If
If txtCSPW.Text = "" Then
lblCheckconnection.Text = "Passwort ist leer!"
Exit Sub
End If
Dim csUser As New CreditSafeUser(txtCSUser.Text, txtCSPW.Text)
Dim yourJSONString = JsonConvert.SerializeObject(csUser)
lblCheckconnection.Text = SendRequest(myUrl, yourJSONString, "application/json", "POST")
End Sub
Private Function SendRequest(uri As Uri, jsonString As String, contentType As String, method As String) As String
Dim response As HttpWebResponse
Dim request As WebRequest
Dim jsonDataBytes = Encoding.UTF8.GetBytes(jsonString)
Try
request = WebRequest.Create(uri)
request.ContentLength = jsonDataBytes.Length
request.ContentType = contentType
request.Method = method
Using requestStream = request.GetRequestStream
requestStream.Write(jsonDataBytes, 0, jsonDataBytes.Length)
requestStream.Close()
End Using
response = request.GetResponse
Return response.StatusDescription
Catch ex As WebException
Dim ExResponse = TryCast(ex.Response, HttpWebResponse)
Return ExResponse.StatusDescription
End Try
End Function
End Class
Public Class CreditSafeUser
Public Property username As String
Public Property password As String
Public Sub New(_username As String, _password As String)
username = _username
password = _password
End Sub
End Class

View File

@@ -24,6 +24,7 @@
<package id="Hardcodet.NotifyIcon.Wpf" version="1.0.5" targetFramework="net40-Client" requireReinstallation="True" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="5.0.0" targetFramework="net47" />
<package id="Microsoft.CSharp" version="4.5.0" targetFramework="net47" />
<package id="Newtonsoft.Json" version="13.0.2" targetFramework="net47" />
<package id="System.Buffers" version="4.5.1" targetFramework="net47" />
<package id="System.Memory" version="4.5.4" targetFramework="net47" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net47" />