47 lines
1.3 KiB
Plaintext
47 lines
1.3 KiB
Plaintext
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Navigation;
|
|
using System.Windows.Shapes;
|
|
|
|
namespace SafeBagDE70.Admin
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for AdminLoginUC.xaml
|
|
/// </summary>
|
|
public partial class AdminLoginUC : UserControl
|
|
{
|
|
public AdminLoginUC()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void LoginButton_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
string username = UsernameTextBox.Text;
|
|
string password = PasswordBox.Password;
|
|
|
|
// Simple authentication logic
|
|
if (username == "admin" && password == "password") // Replace with actual logic
|
|
{
|
|
// Load Settings UserControl
|
|
var mainWindow = (MainWindow)Window.GetWindow(this);
|
|
//mainWindow.LoadUserControl(new SettingsUserControl());
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show("Invalid username or password.", "Login Failed", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
}
|
|
}
|
|
}
|
|
}
|