Beispiel #1
0
        private void LOGIN_Click(object sender, EventArgs e)
        {
            mydb        db = new mydb();
            bool        b;
            Utulisateur newusers = new Utulisateur();
            droitacces  droit    = new droitacces();

            db.Chargerlesinfos(newusers);
            string      nom      = username.Text.ToString();
            string      password = this.password.Text.ToString();
            Utulisateur newuser  = newusers.Session(newusers, nom, password);

            if (newuser == null)
            {
                b = false;
            }
            else
            {
                b = true;
            }
            if (b)
            {
                session session = new session(newuser, this);
                username.Text      = "";
                this.password.Text = "";
                this.Visible       = false;
                session.Visible    = true;
            }

            else
            {
                MessageBox.Show("wrong passwordor username !");
            }
        }