public Boolean Connecter(String login, String password) { try { Index i = new Index(); Boolean test = false; Admin a = ad.Verif(login); AMETAP.View.Script.Cryptage c = new View.Script.Cryptage(); if ((a.login.Equals(login)) && (c.Descrypt(a.password).Equals(password)) && (a.estAdmin.Equals("V"))) { test = true; i.Show(); } else { if ((a.login.Equals(login)) && (c.Descrypt(a.password).Equals(password)) && (a.estAdmin.Equals("F"))) { test = true; i.txtRecherhce.Enabled = false; i.metroTile8.Enabled = false; i.dataUtilisateur.Enabled = false; i.metroTile9.Enabled = false; i.dataBudget.Enabled = false; i.chart1.Enabled = false; i.Show(); } } return(test); } catch (Exception ex) { MessageBox.Show("Vérifier votre login ou votre mot de passe", ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } }