using System.Windows;

namespace WpfApp1
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            lblUser.Text = $"{AppSession.Username}\nРоль: {AppSession.Role}";
        }

        private void BtnOrders_Click(object sender, RoutedEventArgs e)
        {
            new OrdersWindow().Show();
        }

        private void BtnDrivers_Click(object sender, RoutedEventArgs e)
        {
            new DriversWindow().Show();
        }

        private void BtnLogout_Click(object sender, RoutedEventArgs e)
        {
            AppSession.UserId = 0;
            AppSession.Username = null;
            AppSession.Role = null;
            new LoginWindow().Show();
            this.Close();
        }
    }
}