API-Einstellungen, etc.

This commit is contained in:
2024-08-16 15:56:36 +02:00
parent 1f43b3ba54
commit 437bfea2dc
11 changed files with 6301 additions and 17 deletions

View File

@@ -29,10 +29,10 @@ Public Class frmAPIEinstellungen
If sqlwhere = "" Then
APIBind.initBinding("SELECT [api_active],[api_productive], [api_program],[api_id],[api_url] ,[api_user],[api_password] ,[api_UseToken],[api_token] ,[api_description] FROM " & table & " WHERE api_productive = " & IIf(cbxProduktivsystem.Checked, "1", "0"), table)
APIBind.initBinding("SELECT [api_active],[api_productive], [api_program],[api_id],[api_url] ,[api_user],[api_password] ,[api_UseToken],[api_token] ,[api_description], [api_debugpath] FROM " & table & " WHERE api_productive = " & IIf(cbxProduktivsystem.Checked, "1", "0"), table)
Else
APIBind.initBinding("Select [api_active], [api_productive], [api_program], [api_id], [api_url], [api_user], [api_password], [api_useToken], [api_token], [api_description] FROM " & table & " WHERE api_productive = " & IIf(cbxProduktivsystem.Checked, "1", "0") & sqlwhere, table)
APIBind.initBinding("Select [api_active], [api_productive], [api_program], [api_id], [api_url], [api_user], [api_password], [api_useToken], [api_token], [api_description], [api_debugpath] FROM " & table & " WHERE api_productive = " & IIf(cbxProduktivsystem.Checked, "1", "0") & sqlwhere, table)
End If
@@ -61,20 +61,34 @@ Public Class frmAPIEinstellungen
.Columns("api_Token").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
.Columns("api_description").HeaderText = "Beschreibung"
.Columns("api_description").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
.Columns("api_debugpath").HeaderText = "Debug-File"
.Columns("api_debugpath").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
If .Columns("isRunning") Is Nothing Then
Dim c As New DataGridViewImageColumn
c.Name = "isRunning" : c.HeaderText = "Online"
c.Image = My.Resources.wait : c.ImageLayout = DataGridViewImageCellLayout.Zoom
c.Image = New Bitmap(1, 1)
c.Width = 40 : c.DefaultCellStyle.Padding = New Padding(2) : c.DefaultCellStyle.BackColor = Color.White
c.DefaultCellStyle.Tag = "Online"
.Columns.Add(c)
End If
If .Columns("pathToFile") Is Nothing Then
Dim c As New DataGridViewImageColumn
c.Name = "pathToFile" : c.HeaderText = "Debug-Pfad"
c.Image = New Bitmap(1, 1)
c.Width = 40 : c.DefaultCellStyle.Padding = New Padding(2) : c.DefaultCellStyle.BackColor = Color.White
c.DefaultCellStyle.Tag = "pathToFile"
.Columns.Add(c)
End If
For Each r As DataGridViewRow In .Rows
If r.Cells("api_url").Value Is DBNull.Value Then
r.DefaultCellStyle.ForeColor = Color.Gray
ElseIf CBool(r.Cells("api_active").Value) = False Then
@@ -86,6 +100,13 @@ Public Class frmAPIEinstellungen
Else
DirectCast(r.Cells("isRunning"), DataGridViewImageCell).Value = My.Resources.del
End If
If r.Cells("api_debugpath").Value IsNot DBNull.Value AndAlso r.Cells("api_debugpath").Value IsNot Nothing AndAlso (r.Cells("api_debugpath").Value.ToString.StartsWith("\\") Or r.Cells("api_debugpath").Value.ToString.StartsWith("C:\")) Then
DirectCast(r.Cells("pathToFile"), DataGridViewImageCell).Value = My.Resources.search
End If
Next
End If
@@ -95,7 +116,7 @@ Public Class frmAPIEinstellungen
Catch ex As Exception
MsgBox(ex.Message)
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End Sub
@@ -108,7 +129,7 @@ Public Class frmAPIEinstellungen
e.Row.Cells("api_token").Value = False
Catch ex As Exception
MsgBox(ex.Message)
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End Sub
@@ -205,7 +226,22 @@ Public Class frmAPIEinstellungen
End Sub
Private Sub DataGridView_CellContentDoubleClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView.CellContentDoubleClick
Private Sub DataGridView_CellContentDoubleClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView.CellDoubleClick
Me.Cursor = Cursors.WaitCursor
Dim tmprowindex As Integer = e.RowIndex
If DataGridView.Columns(e.ColumnIndex).Name = "pathToFile" Then
If DataGridView.CurrentRow.Cells("api_debugpath").Value IsNot DBNull.Value AndAlso (DataGridView.CurrentRow.Cells("api_debugpath").Value.ToString.StartsWith("\\") Or DataGridView.CurrentRow.Cells("api_debugpath").Value.ToString.StartsWith("C:\")) Then
Process.Start(DataGridView.CurrentRow.Cells("api_debugpath").Value)
End If
Else
End If
Me.Cursor = Cursors.Default
End Sub
Private Sub PictureBox5_Click(sender As Object, e As EventArgs) Handles PictureBox5.Click
Dim webAddress As String = "https://wiki.verag.ag/de/software/Offene_Punkte#aviso-schnittstellen-zu-fremdsystemen"
Process.Start(webAddress)
End Sub
End Class