33 lines
881 B
C#
33 lines
881 B
C#
using System.Windows;
|
|
|
|
namespace FahrzeugVerwaltung
|
|
{
|
|
public partial class LoginWindow : Window
|
|
{
|
|
public LoginWindow()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
// Prüft Zugangsdaten und öffnet Hauptfenster
|
|
private void BtnLogin_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
string benutzer = txtBenutzer.Text.Trim();
|
|
string passwort = txtPasswort.Password;
|
|
|
|
if (benutzer == "admin" && passwort == "admin")
|
|
{
|
|
MainWindow haupt = new MainWindow();
|
|
haupt.Show();
|
|
Close();
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show("Falsche Zugangsdaten", "Fehler", MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
txtPasswort.Clear();
|
|
txtBenutzer.Focus();
|
|
}
|
|
}
|
|
}
|
|
}
|