public AjoutWindow(AcceuilWindow acceuil, User user)
        {
            this.acceuil = acceuil;
            InitializeComponent();
            double screenWidth  = System.Windows.SystemParameters.PrimaryScreenWidth;
            double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight;
            double windowWidth  = this.Width;
            double windowHeight = this.Height;

            this.Left = (screenWidth / 2) - (windowWidth / 2);
            this.Top  = (screenHeight / 2) - (windowHeight / 2);
            this.user = user;
        }
        public ListeDesContacts(AcceuilWindow acceuil, User user)
        {
            this.acceuil = acceuil;
            InitializeComponent();

            double screenWidth  = System.Windows.SystemParameters.PrimaryScreenWidth;
            double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight;
            double windowWidth  = this.Width;
            double windowHeight = this.Height;

            this.Left  = (screenWidth / 2) - (windowWidth / 2);
            this.Top   = (screenHeight / 2) - (windowHeight / 2);
            this.user  = user;
            BLL.update = SelectAllContact;
            SelectAllContact();

            if (!user.Admin)
            {
                buttonUpdate.IsEnabled = false;
                buttonDelete.IsEnabled = false;
            }
        }
Example #3
0
        private void SeConnecter(object sender, RoutedEventArgs e)
        {
            User user = new User()
            {
                UserName = textBoxLogin.Text,
                Password = textBoxMdp.Password
            };

            //logins valides :
            //                      1) toto - 123456 Non Admin
            //                      2) tata - abcd Admin

            if (BLL.LogIn(user).Id != 0)
            {
                AcceuilWindow accueil = new AcceuilWindow(user);
                accueil.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show("erreur de login");
            }
        }