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.
66 lines
1.6 KiB
66 lines
1.6 KiB
using Business;
|
|
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 WpfApp1
|
|
{
|
|
/// <summary>
|
|
/// Logique d'interaction pour ChangerMotDePasse.xaml
|
|
/// </summary>
|
|
public partial class ChangerMotDePasse : Window
|
|
{
|
|
public ChangerMotDePasse()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public ManagerUsers MgrUser => (Application.Current as App).LeManagerUsers;
|
|
|
|
private void valider_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
if (verifierConf())
|
|
{
|
|
if (verifierAncienMdp())
|
|
{
|
|
MgrUser.SelectedUser.ChangerMotDePasse(nvMdp.Password);
|
|
Close();
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show("Le mot de passe actuel saisi est incorrect");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show("Les mots de passe de correspondent pas");
|
|
}
|
|
}
|
|
|
|
private bool verifierConf()
|
|
{
|
|
return nvMdp.Password == confMdp.Password;
|
|
}
|
|
|
|
private bool verifierAncienMdp()
|
|
{
|
|
return ancienMdp.Password == MgrUser.SelectedUser.MotDePasse;
|
|
}
|
|
|
|
private void exit_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
Close();
|
|
}
|
|
}
|
|
}
|