Timas, Asfinag-Schnittstelle

This commit is contained in:
2023-10-09 13:51:02 +02:00
parent da98cbfc22
commit 15f61cbbea
9 changed files with 1299 additions and 1133 deletions

View File

@@ -5,6 +5,7 @@ Imports System.IO
Imports System.Net
Imports System.Net.Http
Imports System.Net.WebRequestMethods
Imports System.Security.Cryptography
Imports System.Security.Policy
Imports System.Text
Imports System.Text.RegularExpressions
@@ -20,6 +21,7 @@ Imports VERAG_PROG_ALLGEMEIN
Public Class frmMitarbTimas
Private avisoEmp As VERAG_PROG_ALLGEMEIN.cMitarbeiter
Public mid As Integer = -1
Public isUpdate As Boolean = False
Dim emp As cTimasEmployee
@@ -38,11 +40,8 @@ Public Class frmMitarbTimas
Private Sub frmMitarbDetails_Load(sender As Object, e As EventArgs) Handles MyBase.Load
txtPwd.Visible = False
cbxEinsteigsDat.Checked = False
cbxGebDat.Checked = False
txtGebDat.Format = DateTimePickerFormat.Custom
txtGebDat.CustomFormat = "dd.MM.yyyy"
datGekuendigtAm.Format = DateTimePickerFormat.Custom
@@ -58,9 +57,10 @@ Public Class frmMitarbTimas
End If
End Sub
Private Sub initMitarbeiter(Optional _isUpdate As Boolean = True)
Private Sub initMitarbeiter(mid As Integer, Optional _isUpdate As Boolean = False)
timas = New cTimasAPI
emp = timas.getEmployee(mid)
avisoEmp = New VERAG_PROG_ALLGEMEIN.cMitarbeiter(emp.externid)
timas.getAllGroups(dtTimas)
@@ -71,7 +71,7 @@ Public Class frmMitarbTimas
txtUsername.Text = emp.login
txtVname.Text = emp.firstname
txtNname.Text = emp.lastname
txtPwd.Text = emp.password
'txtPwd.Text = emp.password
If emp.gender = "male" Then rbtnGeschlechtM.Checked = True
If emp.gender = "female" Then rbtnGeschlechtW.Checked = True
@@ -137,7 +137,7 @@ Public Class frmMitarbTimas
Private Sub getMitarbeiter()
emp.login = txtUsername.Text
emp.password = txtPwd.Text
'emp.password = txtPwd.Text
If rbtnGeschlechtM.Checked Then emp.gender = "male"
If rbtnGeschlechtW.Checked Then emp.gender = "female"
emp.firstname = txtVname.Text
@@ -161,7 +161,6 @@ Public Class frmMitarbTimas
'mitarbeiter.mit_TESTonly = cbxTestaccount.Checked
If checkMandatoryFields() Then
timas.updateEmployee(emp, dgvData)
End If
@@ -169,10 +168,6 @@ Public Class frmMitarbTimas
End Sub
Private Sub Label8_Click_1(sender As Object, e As EventArgs)
txtPwd.Visible = True
Label8.Visible = False
End Sub
Private Sub btnSave_Click(sender As Object, e As EventArgs)
If txtVname.Text = "" And txtNname.Text = "" Then MsgBox("Bitte geben Sie einen Namen ein!") : Exit Sub
@@ -208,13 +203,31 @@ Public Class frmMitarbTimas
End Sub
Private Sub lkl_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles lkl.LinkClicked
If vbYes = MsgBox("Möchten Sie das Kennwort wirklich zurücksetzen? " & vbNewLine & "Der Benutzer wird beim nächsten Login zur Eingabe aufgefordert.", vbYesNoCancel) Then
' txtPwd.Text = "0000"
getMitarbeiter()
emp.password = "null"
If checkMandatoryFields() Then
timas.updateEmployee(emp, Nothing)
If vbYes = MsgBox("Möchten Sie das Kennwort neu setzen?", vbYesNoCancel) Then
If vbYes = MsgBox("Möchten Sie den Kennwort aus AVISO/SQL übernehmen?", vbYesNoCancel) Then
If avisoEmp IsNot Nothing AndAlso avisoEmp.mit_pwd <> "" Then
emp.password = avisoEmp.mit_pwd
If checkMandatoryFields() Then
timas.updateEmployee(emp, Nothing)
Exit Sub
End If
Else
MsgBox("Mitarbeiter-PW konnte konnten nicht aus AVISO geladen werden!")
End If
End If
Dim input = InputBox("Neues Passwort:", "Passwort anlegen")
If input <> "" Then
getMitarbeiter()
emp.password = input
If checkMandatoryFields() Then
timas.updateEmployee(emp, Nothing)
End If
Else
MsgBox("Passwort wurde nicht neu vergeben!")
End If
End If
End Sub
@@ -312,7 +325,20 @@ Public Class frmMitarbTimas
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If vbYes = MsgBox("Möchten Sie Daten aus AVISO/SQL übernehmen?", vbYesNo) Then
If avisoEmp IsNot Nothing AndAlso avisoEmp.mit_username <> "" Then
txtUsername.Text = avisoEmp.mit_username
If txtInfo.Text = "" Then
txtInfo.Text = avisoEmp.mit_firma & " - " & avisoEmp.mit_abteilung
End If
cbxAccount.Checked = True
getMitarbeiter()
Else
MsgBox("Mitarbeiterdaten konnten nicht aus AVISO geladen werden!")
End If
End If
End Sub
End Class