Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            var username = textBox1.Text;
            var password = helperClass.encrypt(textBox2.Text);

            int existe = db.Authentifications.Where(c => c.login == username && c.password == password).Count();

            if (string.IsNullOrEmpty(textBox2.Text))
            {
                MessageBox.Show("Enrez votre Mot de passe", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                if (existe != 0)
                {
                    Authentifier.currentUser = db.Authentifications.Where(c => c.login == username && c.password == password).First();
                    Acceuil Ac = new Acceuil();
                    Ac.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Login ou mot de passe incorrect", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            db.SaveChanges();
        }
Exemple #2
0
        private void connexion_Click(object sender, RoutedEventArgs e)
        {
            BDD.LISA_DIGITALEntities db = new BDD.LISA_DIGITALEntities();

            if ((db.UTILISATEUR.FirstOrDefault(x => x.Identifier == identifiant.Text && x.Password == MotDePass.Password) != null))
            {
                Acceuil accueil = new Acceuil();
                accueil.Show();
                this.Close();
            }
            else if ((db.ENTITE.FirstOrDefault(x => x.Identifier == identifiant.Text && x.Password == MotDePass.Password && x.IsTechnician == true) != null))
            {
                List <ENTITE> Ent = db.ENTITE.Where(x => x.Identifier == identifiant.Text).Where(x => x.Password == MotDePass.Password).ToList();
                long          a   = 0;
                foreach (ENTITE Ents in Ent)
                {
                    a = Ents.Id;
                }
                Acceuil accueil = new Acceuil(a);
                accueil.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show("Identifiant ou mot de passe incorrect");
            }
        }
        public void changerFenetre(int FenetreAvant, int FenetreApres)
        {
            switch (FenetreAvant)
            {
            case 0:
                acceuil.Hide();
                break;

            case 1:
                memes.Hide();
                break;

            case 2:
                messages.Hide();
                break;

            case 3:
                crypto.Hide();
                break;

            case 4:
                meteo.Hide();
                break;

            case 5:
                poke.Hide();
                break;
            }

            switch (FenetreApres)
            {
            case 0:
                acceuil.Show();
                break;

            case 1:
                memes.Show();
                break;

            case 2:
                messages.Show();
                break;

            case 3:
                crypto.Show();
                break;

            case 4:
                meteo.Show();
                break;

            case 5:
                poke.Show();
                break;
            }
        }
 public void initialiserFenetres(Acceuil Aceuil)
 {
     this.acceuil = Aceuil;
     acceuil.Show();
     crypto.Hide();
     memes.Hide();
     messages.Hide();
     meteo.Hide();
     poke.Hide();
 }
Exemple #5
0
        private void connexion_Click(object sender, RoutedEventArgs e)
        {
            LISA_DIGITALEntities db = new LISA_DIGITALEntities();

            if ((db.UTILISATEUR.FirstOrDefault(x => x.Identifier == identifiant.Text) != null) && (db.UTILISATEUR.FirstOrDefault(x => x.Password == MotDePass.Password) != null))
            {
                Acceuil accueil = new Acceuil();


                accueil.Show();
                this.Close();
            }
        }