Projektdateien hinzufügen.
This commit is contained in:
91
UID/frmLogin.vb
Normal file
91
UID/frmLogin.vb
Normal file
@@ -0,0 +1,91 @@
|
||||
Public Class frmLogin
|
||||
Public ConnStrInfo As String
|
||||
Public ConnStr As String
|
||||
' Public USRNAME As String
|
||||
' Public USRBER As Integer
|
||||
|
||||
Private UID As New cOptionenDAL
|
||||
Private SDL As New SDL.cOptionenDAL
|
||||
|
||||
|
||||
Private Version As String = My.Resources.Version
|
||||
Public sAppPath As String = Application.StartupPath
|
||||
|
||||
Public TESTSYSTEM As Boolean = False
|
||||
|
||||
|
||||
Private Sub btnLogin_Click(sender As Object, e As EventArgs) Handles btnLogin.Click
|
||||
If SDL.checkLogin(txtUser.Text, txtPwd.Text, "DISPO") Then
|
||||
VERAG_PROG_ALLGEMEIN.cAllgemein.PROGNAME = "DISPO"
|
||||
VERAG_PROG_ALLGEMEIN.cAllgemein.PROGVERSION = My.Resources.Version
|
||||
VERAG_PROG_ALLGEMEIN.cAllgemein.SESSION.LOGIN()
|
||||
|
||||
|
||||
AddHandler frmMain.FormClosed, Sub()
|
||||
VERAG_PROG_ALLGEMEIN.cAllgemein.SESSION.LOGOUT()
|
||||
Me.Close()
|
||||
End Sub
|
||||
'frmMain.Show()
|
||||
frmMainV2.Show()
|
||||
Me.Hide()
|
||||
Else
|
||||
lblAlertTxt.Visible = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub frmLogin_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If sAppPath Like "*\bin\Debug" Then
|
||||
txtUser.Text = "sebastian"
|
||||
txtPwd.Text = "verag#3"
|
||||
End If
|
||||
If TESTSYSTEM Then lblTestsystem.Visible = True
|
||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = TESTSYSTEM
|
||||
'Dim tmp As String
|
||||
lblVersion.Text = lblVersion.Text & " " & My.Resources.Version
|
||||
Me.Show()
|
||||
txtUser.Focus()
|
||||
lblAlertTxt.Visible = False
|
||||
'auf UPDATES prüfen:
|
||||
If CInt(UID.getAktuelleVersion().Replace(".", "")) > CInt(Version.Replace(".", "")) Then
|
||||
Me.Enabled = False
|
||||
If vbYes = MsgBox("Es ist eine neue Programm-Version verfügbar. Das Programm muss aktualisiert werden, bevor Sie es weiter verwenden können. " & vbNewLine & vbNewLine & "Update jetzt durchführen?", CType(vbQuestion + vbYesNo, MsgBoxStyle), "Update verfügbar") Then
|
||||
UpdateDISPO()
|
||||
Else
|
||||
Application.Exit()
|
||||
End If
|
||||
Else
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub txtPwd_KeyDown(sender As Object, e As KeyEventArgs) Handles txtPwd.KeyDown, txtUser.KeyDown
|
||||
If (e.KeyCode = Keys.Return) Then
|
||||
btnLogin.PerformClick() : e.SuppressKeyPress = True
|
||||
ElseIf (e.KeyCode = Keys.Escape) Then
|
||||
Me.Close()
|
||||
End If
|
||||
End Sub
|
||||
Public Sub UpdateDISPO()
|
||||
If Not System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory & "DISPOUpdater.exe") Then
|
||||
MsgBox("ERROR_UPDATE: Update konnte nicht fortgesetzt werden." & vbNewLine & vbNewLine & "Update-Datei existiert nicht.", vbCritical)
|
||||
Application.Exit()
|
||||
Else
|
||||
Process.Start("DISPOUpdater.exe")
|
||||
Application.Exit()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub PictureBox2_Click(sender As Object, e As EventArgs) Handles PictureBox2.Click
|
||||
Me.Close()
|
||||
End Sub
|
||||
Private Sub lblVersion_Click(sender As Object, e As MouseEventArgs) Handles lblVersion.MouseClick, lblVersion.Click
|
||||
ctxUpdate.Show(lblVersion, e.Location)
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles UpdateToolStripMenuItem.Click
|
||||
UpdateDISPO()
|
||||
End Sub
|
||||
|
||||
Private Sub txtUser_TextChanged(sender As Object, e As EventArgs) Handles txtUser.TextChanged
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user