ProjetThe/ProjetTheAlone/View/Accueil.xaml.cs

90 lines
2.7 KiB
C#

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.Shapes;
namespace ProjetTheAlone.View
{
/// <summary>
/// Logique d'interaction pour Accueil.xaml
/// </summary>
public partial class Accueil : Window
{
DashBoard W_DashBoard;
FicEncodage W_FicEncodage;
FicGestionAlert W_GestionAlert;
public Accueil()
{
InitializeComponent();
//// Settings1.Default.schCon = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename='C:\Users\Hugues\Haute Ecole de la ville de Liège\Adrien VAN DAMME - ProjetTheAlone\ProjetTheAlone\ProjetThe.mdf';Integrated Security = True";
//W_DashBoard = new DashBoard();
//W_FicEncodage = new FicEncodage();
//W_GestionAlert = new FicGestionAlert();
}
private static bool openaffichage = false;
private static bool openencodage = false;
public static bool Openaffichage { get => openaffichage; set => openaffichage = value; }
public static bool Openencodage { get => openencodage; set => openencodage = value; }
private void BtnAffichage_Click(object sender, RoutedEventArgs e)
{
if (!Openaffichage)
{
Openaffichage = true;
DashBoard w = new DashBoard();
w.Show();
}
else
{
MessageBox.Show("Fenêtre d'affichage déjà ouverte.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
}
}
private void BtnEncodage_Click(object sender, RoutedEventArgs e)
{
if (!Openencodage)
{
Openencodage = true;
FicEncodage w = new FicEncodage();
w.Show();
}
else
{
MessageBox.Show("Fenêtre d'encodage déjà ouverte.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
}
}
private void BtnQuitter_Click(object sender, RoutedEventArgs e)
{
Close();
}
private void Window_MouseDown(object sender, MouseButtonEventArgs e)
{
if (e.ChangedButton == MouseButton.Left)
this.DragMove();
}
private void BtnGestionAlert_Click(object sender, RoutedEventArgs e)
{
FicGestionAlert w = new FicGestionAlert();
w.Show();
}
}
}