API Einstellungen, Überstundenauszahlung, Sammelrechnungsdruck, etc
This commit is contained in:
@@ -443,6 +443,12 @@
|
||||
<Compile Include="frmAPI.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmAPIEinstellungen.Designer.vb">
|
||||
<DependentUpon>frmAPIEinstellungen.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="frmAPIEinstellungen.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmERS.Designer.vb">
|
||||
<DependentUpon>frmERS.vb</DependentUpon>
|
||||
</Compile>
|
||||
@@ -727,6 +733,9 @@
|
||||
<EmbeddedResource Include="frmAPI.resx">
|
||||
<DependentUpon>frmAPI.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmAPIEinstellungen.resx">
|
||||
<DependentUpon>frmAPIEinstellungen.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmERS.resx">
|
||||
<DependentUpon>frmERS.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
||||
@@ -908,7 +908,7 @@ Public Class frmMitarbDetails
|
||||
|
||||
ZOLLDATENBEARB = True
|
||||
ElseIf tbcntr.SelectedIndex = 3 Then
|
||||
timas = New VERAG_PROG_ALLGEMEIN.cTimasAPI()
|
||||
timas = New VERAG_PROG_ALLGEMEIN.cTimasAPI("timas")
|
||||
|
||||
If IsNothing(mitarbeiter.mit_timasId) Then
|
||||
cbxTimasAngelegt.Checked = False
|
||||
@@ -921,6 +921,7 @@ Public Class frmMitarbDetails
|
||||
|
||||
btnMAanlegen.Visible = Not cbxTimasAngelegt.Checked
|
||||
txtLohnNr.Enabled = Not cbxTimasAngelegt.Checked
|
||||
txtClientNr.Enabled = Not cbxTimasAngelegt.Checked
|
||||
dgvData.Visible = Not cbxTimasAngelegt.Checked
|
||||
TabControl1.Visible = Not cbxTimasAngelegt.Checked
|
||||
rtfInfoTimas.Visible = cbxTimasAngelegt.Checked
|
||||
@@ -964,7 +965,7 @@ Public Class frmMitarbDetails
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim cs = New cCreditSafeAPI
|
||||
Dim cs = New cCreditSafeAPI("creditsafe")
|
||||
Dim statuscode = cs.authenticate(txtCSUser.Text, txtCSPW.Text)
|
||||
Select Case statuscode
|
||||
|
||||
@@ -1210,6 +1211,7 @@ Public Class frmMitarbDetails
|
||||
|
||||
btnMAanlegen.Visible = Not cbxTimasAngelegt.Checked
|
||||
txtLohnNr.Enabled = Not cbxTimasAngelegt.Checked
|
||||
txtClientNr.Enabled = Not cbxTimasAngelegt.Checked
|
||||
dgvData.Visible = Not cbxTimasAngelegt.Checked
|
||||
rtfInfoTimas.Visible = cbxTimasAngelegt.Checked
|
||||
btngetInfo.Visible = cbxTimasAngelegt.Checked
|
||||
@@ -1252,7 +1254,7 @@ Public Class frmMitarbDetails
|
||||
|
||||
If txtLohnNr.Text = "" Then
|
||||
|
||||
If Not vbYes = MsgBox("Möchten Sie den Mitarbeiter ohne Lohnnummer anlegen?" & vbNewLine & "Ohne Lohnnummer kann kein Ableich ins Lohnsystem erfolgen!", vbYesNoCancel) Then
|
||||
If Not vbYes = MsgBox("Möchten Sie den Mitarbeiter ohne Lohnnummer anlegen?" & vbNewLine & "Ohne Lohnnummer kann kein Abgleich ins Lohnsystem erfolgen!", vbYesNoCancel) Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
@@ -1301,10 +1303,6 @@ Public Class frmMitarbDetails
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub PictureBox9_Click_1(sender As Object, e As EventArgs)
|
||||
Dim webAddress As String = "https://zeit.verag.ag/"
|
||||
Process.Start(webAddress)
|
||||
End Sub
|
||||
|
||||
Private Sub TabControl1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TabControl1.SelectedIndexChanged
|
||||
If dgvData Is Nothing And dgvData.Rows.Count < 1 Then Exit Sub
|
||||
|
||||
@@ -41,7 +41,7 @@ Public Class frmMitarbTimas
|
||||
|
||||
End Sub
|
||||
Private Sub initMitarbeiter(mid As Integer, Optional _isUpdate As Boolean = False)
|
||||
timas = New cTimasAPI
|
||||
timas = New cTimasAPI("timas")
|
||||
emp = timas.getEmployee(mid)
|
||||
avisoEmp = New VERAG_PROG_ALLGEMEIN.cMitarbeiter(emp.externid)
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ Public Class usrCntlMitarbeiter
|
||||
dgvTimasNew.DataSource = dt
|
||||
|
||||
Else
|
||||
Dim timas As New cTimasAPI()
|
||||
Dim timas As New cTimasAPI("timas")
|
||||
timas.getEmployeeList(dt)
|
||||
dgvTimasNew.DataSource = dt
|
||||
|
||||
@@ -715,7 +715,6 @@ Public Class usrCntlMitarbeiter
|
||||
Private Sub uploadToWiki()
|
||||
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
Dim token = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcGkiOjEsImdycCI6MSwiaWF0IjoxNjg3OTMzNDU3LCJleHAiOjE3MTk0OTEwNTcsImF1ZCI6InVybjp3aWtpLmpzIiwiaXNzIjoidXJuOndpa2kuanMifQ.ul2loFYVHdco2Ia2LcS4nme4PdgcuU6QKrunucECebX5LhcsSyuEg-lKiP2X3JXW57Ym4oCBjamDd5-5uqbQd9hOQ5CDO6yqK2r8TPNxivK29oAl2wfcHaKOe7QNti0yRlMpomJjc_5qaegeeLjN5w-lYbbqtSz_6y8GkPPr0P3l4coIk5IzngGazj8XLYGGN6y5qT4s8IR0sNhfz0hJAlIeVTeFKl8KFZMpFKvBnOjkL0GYOYjrHzPLSUAhe8hCGVcA7rWsweVjjvOclFDDFwZ0SwOY0TZqvz-LOsZ3V7ucQaT3flAjuHiEhODGJguQRBs67U8lVO2cxbJJyR3FUA"
|
||||
Dim dgv As New DataGridView
|
||||
|
||||
If TabControl1.SelectedIndex = 0 Then
|
||||
@@ -748,11 +747,25 @@ Public Class usrCntlMitarbeiter
|
||||
|
||||
End If
|
||||
|
||||
Dim SQL As New SQL
|
||||
Dim API As New DataTable
|
||||
Dim apiSettingsloaded As Boolean = False
|
||||
Dim API_STRING
|
||||
|
||||
API = SQL.loadDgvBySql("SELECT top(1) * FROM tblAPIEinstellungen WHERE api_program='WIKI' and api_productive ='" & IIf(VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM, "0", "1") & "'", "ADMIN")
|
||||
If API.Rows.Count = 0 Then
|
||||
MsgBox("keine gültigen API-Einstellungen für WIKI gefunden!")
|
||||
Else
|
||||
apiSettingsloaded = True
|
||||
API_STRING = API.Rows(0).Item("api_url")
|
||||
End If
|
||||
|
||||
If apiSettingsloaded = False Then Exit Sub
|
||||
|
||||
For Each row As DataGridViewRow In dgv.Rows
|
||||
If row.Cells("mit_foto_DocId").Value > 0 Then
|
||||
Dim file = VERAG_PROG_ALLGEMEIN.cDATENSERVER.GET_PDFPath_BY_DocID(row.Cells("mit_foto_DocId").Value)
|
||||
Dim succeess = uploadPictureToWIKI(token, 4, file) 'Folder 4 -> Mitarbeiterfotos
|
||||
Dim succeess = uploadPictureToWIKI(API, 4, file) 'Folder 4 -> Mitarbeiterfotos
|
||||
End If
|
||||
|
||||
Next
|
||||
@@ -768,12 +781,13 @@ Public Class usrCntlMitarbeiter
|
||||
|
||||
|
||||
|
||||
Private Function uploadPictureToWIKI(authenticationToken As String, folderIDx As Integer, image As String) As String
|
||||
Private Function uploadPictureToWIKI(API As DataTable, folderIDx As Integer, image As String) As String
|
||||
Try
|
||||
|
||||
VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat()
|
||||
|
||||
Dim API_STRING = "https://wiki.verag.ag"
|
||||
Dim API_String = API.Rows(0).Item("api_url")
|
||||
|
||||
Dim rest As New Chilkat.Rest
|
||||
Dim success As Boolean
|
||||
Dim failureDesc As String
|
||||
@@ -782,7 +796,7 @@ Public Class usrCntlMitarbeiter
|
||||
Dim bTls As Boolean = True
|
||||
Dim port As Integer = 443
|
||||
Dim bAutoReconnect As Boolean = True
|
||||
success = rest.Connect(API_STRING, port, bTls, bAutoReconnect)
|
||||
success = rest.Connect(API_String, port, bTls, bAutoReconnect)
|
||||
If (success <> True) Then
|
||||
Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason)
|
||||
Debug.WriteLine(rest.LastErrorText)
|
||||
@@ -792,7 +806,7 @@ Public Class usrCntlMitarbeiter
|
||||
|
||||
API_STRING &= "/u"
|
||||
|
||||
rest.AddHeader("Authorization", "Bearer " & authenticationToken)
|
||||
rest.AddHeader("Authorization", "Bearer " & API.Rows(0).Item("api_token"))
|
||||
rest.AddHeader("Content-Type", "multipart/form-data")
|
||||
|
||||
Dim filename = New IO.FileInfo(image).Name
|
||||
|
||||
116
UID/frmAPIEinstellungen.Designer.vb
generated
Normal file
116
UID/frmAPIEinstellungen.Designer.vb
generated
Normal file
@@ -0,0 +1,116 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class frmAPIEinstellungen
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
Finally
|
||||
MyBase.Dispose(disposing)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Wird vom Windows Form-Designer benötigt.
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
|
||||
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
|
||||
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.Label2 = New System.Windows.Forms.Label()
|
||||
Me.txtSuche = New System.Windows.Forms.TextBox()
|
||||
Me.btnOK = New System.Windows.Forms.Button()
|
||||
Me.DataGridView = New System.Windows.Forms.DataGridView()
|
||||
Me.Label1 = New System.Windows.Forms.Label()
|
||||
Me.Label3 = New System.Windows.Forms.Label()
|
||||
CType(Me.DataGridView, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'Label2
|
||||
'
|
||||
Me.Label2.AutoSize = True
|
||||
Me.Label2.Location = New System.Drawing.Point(9, 7)
|
||||
Me.Label2.Name = "Label2"
|
||||
Me.Label2.Size = New System.Drawing.Size(41, 13)
|
||||
Me.Label2.TabIndex = 21
|
||||
Me.Label2.Text = "Suche:"
|
||||
'
|
||||
'txtSuche
|
||||
'
|
||||
Me.txtSuche.Location = New System.Drawing.Point(12, 23)
|
||||
Me.txtSuche.Name = "txtSuche"
|
||||
Me.txtSuche.Size = New System.Drawing.Size(176, 20)
|
||||
Me.txtSuche.TabIndex = 22
|
||||
'
|
||||
'btnOK
|
||||
'
|
||||
Me.btnOK.Location = New System.Drawing.Point(863, 454)
|
||||
Me.btnOK.Name = "btnOK"
|
||||
Me.btnOK.Size = New System.Drawing.Size(109, 23)
|
||||
Me.btnOK.TabIndex = 20
|
||||
Me.btnOK.Text = "Speichern"
|
||||
Me.btnOK.UseVisualStyleBackColor = True
|
||||
Me.btnOK.Visible = False
|
||||
'
|
||||
'DataGridView
|
||||
'
|
||||
Me.DataGridView.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
|
||||
Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.DataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
|
||||
Me.DataGridView.Location = New System.Drawing.Point(12, 49)
|
||||
Me.DataGridView.MultiSelect = False
|
||||
Me.DataGridView.Name = "DataGridView"
|
||||
Me.DataGridView.Size = New System.Drawing.Size(1134, 399)
|
||||
Me.DataGridView.TabIndex = 19
|
||||
'
|
||||
'Label1
|
||||
'
|
||||
Me.Label1.AutoSize = True
|
||||
Me.Label1.Location = New System.Drawing.Point(661, 7)
|
||||
Me.Label1.Name = "Label1"
|
||||
Me.Label1.Size = New System.Drawing.Size(485, 13)
|
||||
Me.Label1.TabIndex = 23
|
||||
Me.Label1.Text = "Produktiv: werden nur in Produktivumgebung durchgeführt, nicht in der Developer-U" &
|
||||
"mgebung (TEST)"
|
||||
'
|
||||
'Label3
|
||||
'
|
||||
Me.Label3.AutoSize = True
|
||||
Me.Label3.Location = New System.Drawing.Point(661, 26)
|
||||
Me.Label3.Name = "Label3"
|
||||
Me.Label3.Size = New System.Drawing.Size(265, 13)
|
||||
Me.Label3.TabIndex = 24
|
||||
Me.Label3.Text = "Token:Für Authentifizierung werden Token verwendet!"
|
||||
'
|
||||
'frmAPIEinstellungen
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(1158, 485)
|
||||
Me.Controls.Add(Me.Label3)
|
||||
Me.Controls.Add(Me.Label1)
|
||||
Me.Controls.Add(Me.Label2)
|
||||
Me.Controls.Add(Me.txtSuche)
|
||||
Me.Controls.Add(Me.btnOK)
|
||||
Me.Controls.Add(Me.DataGridView)
|
||||
Me.Name = "frmAPIEinstellungen"
|
||||
Me.Text = "API Verwaltung"
|
||||
CType(Me.DataGridView, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
End Sub
|
||||
|
||||
Friend WithEvents Label2 As Label
|
||||
Friend WithEvents txtSuche As TextBox
|
||||
Friend WithEvents btnOK As Button
|
||||
Friend WithEvents DataGridView As DataGridView
|
||||
Friend WithEvents Label1 As Label
|
||||
Friend WithEvents Label3 As Label
|
||||
End Class
|
||||
120
UID/frmAPIEinstellungen.resx
Normal file
120
UID/frmAPIEinstellungen.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
132
UID/frmAPIEinstellungen.vb
Normal file
132
UID/frmAPIEinstellungen.vb
Normal file
@@ -0,0 +1,132 @@
|
||||
Imports VERAG_PROG_ALLGEMEIN
|
||||
|
||||
Public Class frmAPIEinstellungen
|
||||
|
||||
Dim APIBind As cEasyBinding
|
||||
Public table
|
||||
Public BIND_DB
|
||||
Private EditRow As Integer = -1
|
||||
Sub New(table, BIND_DB)
|
||||
Me.table = table
|
||||
Me.BIND_DB = BIND_DB
|
||||
InitializeComponent()
|
||||
End Sub
|
||||
|
||||
Private Sub frmAPIEinstellungen_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
|
||||
loadDGV()
|
||||
btnOK.Visible = True
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub loadDGV(Optional sqlwhere As String = "")
|
||||
|
||||
Try
|
||||
APIBind = New cEasyBinding(BIND_DB)
|
||||
|
||||
|
||||
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, 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 " & sqlwhere, table)
|
||||
|
||||
End If
|
||||
|
||||
DataGridView.DataSource = APIBind.bindingdataTable
|
||||
|
||||
With DataGridView
|
||||
|
||||
If .Columns.Count > 0 Then
|
||||
|
||||
.Columns("api_id").Visible = False
|
||||
.Columns("api_active").HeaderText = "Aktiv"
|
||||
.Columns("api_active").Width = 50
|
||||
.Columns("api_productive").HeaderText = "Produktiv"
|
||||
.Columns("api_productive").Width = 70
|
||||
.Columns("api_program").HeaderText = "Programm"
|
||||
.Columns("api_program").Width = 80
|
||||
.Columns("api_url").HeaderText = "URL"
|
||||
.Columns("api_url").Width = 150
|
||||
.Columns("api_user").HeaderText = "User"
|
||||
.Columns("api_user").Width = 100
|
||||
.Columns("api_password").HeaderText = "PW"
|
||||
.Columns("api_password").Width = 100
|
||||
.Columns("api_useToken").HeaderText = "Token"
|
||||
.Columns("api_useToken").Width = 40
|
||||
.Columns("api_Token").HeaderText = "Token-Key"
|
||||
.Columns("api_Token").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
|
||||
.Columns("api_description").HeaderText = "Beschreibung"
|
||||
.Columns("api_description").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
|
||||
|
||||
End If
|
||||
|
||||
End With
|
||||
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub TextBox1_PreviewKeyDown(sender As Object, e As PreviewKeyDownEventArgs) Handles txtSuche.PreviewKeyDown
|
||||
|
||||
Dim sqladdon As String = ""
|
||||
|
||||
If e.KeyCode = Keys.Enter Then
|
||||
If txtSuche.Text <> "" Then
|
||||
sqladdon &= " [api_program] like '%" & txtSuche.Text & "%' or [api_url] like '%" & txtSuche.Text & "%'"
|
||||
End If
|
||||
loadDGV(sqladdon)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub DataGridView_DefaultValuesNeeded(sender As Object, e As DataGridViewRowEventArgs) Handles DataGridView.DefaultValuesNeeded
|
||||
Try
|
||||
|
||||
e.Row.Cells("api_active").Value = True
|
||||
e.Row.Cells("api_productive").Value = False
|
||||
e.Row.Cells("api_token").Value = False
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub btnOK_Click(sender As Object, e As EventArgs) Handles btnOK.Click
|
||||
|
||||
If DataGridView.Columns.Count = 0 Or DataGridView.SelectedRows.Count = 0 Then 'alles gelöscht oder markierte Zeile gelöscht
|
||||
APIBind.updateBinding()
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If DataGridView.CurrentRow.Cells("api_url").ToString <> "" AndAlso DataGridView.CurrentRow.Cells("api_user").ToString <> "" AndAlso DataGridView.CurrentRow.Cells("api_password").ToString <> "" AndAlso EditRow >= 0 Then
|
||||
APIBind.updateBinding()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub DataGridView_EditingControlShowing(sender As Object, e As DataGridViewEditingControlShowingEventArgs) Handles DataGridView.EditingControlShowing
|
||||
EditRow = DataGridView.CurrentRow.Index
|
||||
End Sub
|
||||
|
||||
Private Sub DataGridView_SelectionChanged(sender As Object, e As EventArgs) Handles DataGridView.SelectionChanged
|
||||
If EditRow >= 0 Then
|
||||
Dim new_row As Integer = EditRow
|
||||
EditRow = -1
|
||||
DataGridView.CurrentCell = DataGridView.Rows(new_row).Cells(
|
||||
DataGridView.CurrentCell.ColumnIndex)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -270,7 +270,8 @@ Public Class usrCntlAPI
|
||||
End Sub
|
||||
|
||||
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
||||
|
||||
Dim f = New frmAPIEinstellungen("tblAPIEinstellungen", "ADMIN")
|
||||
f.Show()
|
||||
End Sub
|
||||
|
||||
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
|
||||
|
||||
Reference in New Issue
Block a user