You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
138 lines
3.8 KiB
138 lines
3.8 KiB
using Business;
|
|
using Modèle;
|
|
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 WpfApp1
|
|
{
|
|
/// <summary>
|
|
/// Logique d'interaction pour userControlAcceuil.xaml
|
|
/// </summary>
|
|
public partial class userControlAcceuil : UserControl
|
|
{
|
|
public ManagerUsers MgrUser => (Application.Current as App).LeManagerUsers;
|
|
|
|
public userControlAcceuil()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public string Carte
|
|
{
|
|
set
|
|
{
|
|
laCarte.Source = new BitmapImage(new Uri(value, UriKind.Relative));
|
|
}
|
|
}
|
|
|
|
|
|
private Nullable<Zone> _zone;
|
|
public Nullable<Zone> zone
|
|
{
|
|
get { return _zone; }
|
|
set
|
|
{
|
|
_zone = value;
|
|
choixCarte(_zone);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void add_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
if (MgrUser.SelectedUser == null)
|
|
{
|
|
MessageBox.Show("Vous avez besoin d'être connecté pour accéder à cette fonctionnalité");
|
|
var seConnecter = new SeConnecter();
|
|
seConnecter.ShowDialog();
|
|
}
|
|
else if (MgrUser.SelectedUser is Utilisateur)
|
|
{
|
|
var addSharkWindow = new AddAShark();
|
|
addSharkWindow.ShowDialog();
|
|
}
|
|
else if (MgrUser.SelectedUser is Expert)
|
|
{
|
|
var validerSumbit = new ValiderSubmit();
|
|
validerSumbit.ShowDialog();
|
|
}
|
|
|
|
|
|
}
|
|
|
|
private void Inscription_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
if (MgrUser.SelectedUser == null)
|
|
{
|
|
var inscrireWindow = new CreerCompte();
|
|
inscrireWindow.ShowDialog();
|
|
}
|
|
else
|
|
{
|
|
var infoUser = new InfoUtilisateur{ pers = MgrUser.SelectedUser };
|
|
infoUser.ShowDialog();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Arctique_MouseDown(object sender, MouseButtonEventArgs e)
|
|
{
|
|
((MainWindow)System.Windows.Application.Current.MainWindow).ChangeRegionAvecMap(Zone.ARCTIQUE);
|
|
}
|
|
private void Atlantique_MouseDown(object sender, MouseButtonEventArgs e)
|
|
{
|
|
((MainWindow)System.Windows.Application.Current.MainWindow).ChangeRegionAvecMap(Zone.ATLANTIQUE);
|
|
}
|
|
private void Indien_MouseDown(object sender, MouseButtonEventArgs e)
|
|
{
|
|
((MainWindow)System.Windows.Application.Current.MainWindow).ChangeRegionAvecMap(Zone.INDIEN);
|
|
}
|
|
private void Pacifique_MouseDown(object sender, MouseButtonEventArgs e)
|
|
{
|
|
((MainWindow)System.Windows.Application.Current.MainWindow).ChangeRegionAvecMap(Zone.PACIFIQUE);
|
|
}
|
|
|
|
private void choixCarte(Nullable<Zone> zone)
|
|
{
|
|
if (zone == null)
|
|
{
|
|
Carte = "Images/cartemaismieuxman.png";
|
|
}
|
|
else if (zone == Zone.ATLANTIQUE)
|
|
{
|
|
Carte = "Images/carteAtlantique.png";
|
|
}
|
|
else if(zone == Zone.ARCTIQUE)
|
|
{
|
|
Carte = "Images/carteArctique.png";
|
|
}
|
|
else if(zone == Zone.INDIEN)
|
|
{
|
|
Carte = "Images/carteIndien.png";
|
|
}
|
|
else if(zone == Zone.PACIFIQUE)
|
|
{
|
|
Carte = "Images/cartePacifique.png";
|
|
}
|
|
}
|
|
}
|
|
}
|