Projektdateien hinzufügen.
This commit is contained in:
85
Aviso/frmEintragKW.vb
Normal file
85
Aviso/frmEintragKW.vb
Normal file
@@ -0,0 +1,85 @@
|
||||
Imports VERAG_PROG_ALLGEMEIN
|
||||
|
||||
|
||||
Public Class frmEintragKW
|
||||
'Public frmHilf As frmTabelleMitarbeiter
|
||||
|
||||
Dim MitarbeiterDAL As New cMitarbeiterAVISODAL
|
||||
Dim myMitarbeiter As New cMitarbeiter
|
||||
|
||||
Public Sub New()
|
||||
InitializeComponent()
|
||||
Icon = cMeineFunktionenAVISO.GetProgrammIcon
|
||||
End Sub
|
||||
|
||||
Private Sub frmEintragKW_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
|
||||
'Escape händisch abfangen und auf Abbruch-Taste legen
|
||||
If e.KeyCode = Keys.Escape Then
|
||||
btnAbbruch.PerformClick()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub frmEintragKW_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
|
||||
Me.CenterToParent()
|
||||
|
||||
lblMitarbeiter.Text = cGlobal.AktiverMitarbeiter.Mitarbeiter
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub btnAbbruch_Click(sender As System.Object, e As System.EventArgs) Handles btnAbbruch.Click
|
||||
'Irgendwas wurde geändert, deshalb ein Hinweis, ob auch wirklich abgebrochen werden soll
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub txtFeld_GotFocus(sender As Object, e As System.EventArgs) Handles txtKW_neu.GotFocus, txtKW_alt.GotFocus, txtKW_neu2.GotFocus
|
||||
CType(sender, TextBox).SelectAll()
|
||||
End Sub
|
||||
|
||||
|
||||
'Private Sub txtMitarbeiter_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs)
|
||||
' 'Es sind nur Zahleneingaben erlaubt
|
||||
' Dim asc As Integer = Convert.ToInt32(e.KeyChar)
|
||||
' Select Case asc
|
||||
' 'Folgende Tasten sind erlaubt
|
||||
' '8 = Rücktaste (Back)
|
||||
' '13 = Enter
|
||||
' '27 = Esc
|
||||
' '48 To 57 = 0 bis 9
|
||||
' Case 8, 13, 27, 48 To 57
|
||||
' Case Else
|
||||
' e.Handled = True
|
||||
' End Select
|
||||
'End Sub
|
||||
|
||||
Private Sub btnOK_Click(sender As System.Object, e As System.EventArgs) Handles btnOK.Click
|
||||
|
||||
'Logische Prüfungen vor dem Speichern
|
||||
If txtKW_alt.Text.Trim <> cGlobal.AktiverMitarbeiter.KW Then
|
||||
MsgBox("Das alte Kennwort ist falsch!", MsgBoxStyle.Exclamation)
|
||||
txtKW_alt.Focus()
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If txtKW_neu.Text.Trim = "" Then
|
||||
MsgBox("Es muss ein neues Kennwort vergeben werden!", MsgBoxStyle.Exclamation)
|
||||
txtKW_neu.Focus()
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If txtKW_neu.Text.Trim <> txtKW_neu2.Text.Trim Then
|
||||
MsgBox("Das neue Kennwort und die Wiederholung stimmen nicht überein!", MsgBoxStyle.Exclamation)
|
||||
txtKW_neu.Focus()
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'Änderungen werden gespeichert
|
||||
cGlobal.AktiverMitarbeiter.KW = txtKW_neu.Text.Trim
|
||||
MitarbeiterDAL.SpeichernMitarbeiter(cGlobal.AktiverMitarbeiter)
|
||||
|
||||
MsgBox("Das Kennwort wurde geändert und gilt ab der nächsten Anmeldung.", vbInformation)
|
||||
|
||||
'Jetzt wird Fenster geschlossen
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user