projektAutoHandlung/WpfApp4/LoginWindow.xaml.cs
2025-08-31 23:33:31 +02:00

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();
}
}
}
}