private void btnConnexion_Click(object sender, EventArgs e) { IList <Personne> personnes = personneRepository.GetAll(); bool validLogin = false; foreach (Personne p in personnes) { if (p.Login == Login && p.Mdp == Password) { validLogin = true; } } if (validLogin) { this.DialogResult = DialogResult.OK; this.Close(); } else { MessageBox.Show("Mauvais identifiant / mot de passe !", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//Vérification du formulaire private void btnValider_Click(object sender, EventArgs e) { List <Personne> pers = _personnerepo.GetAll(); btnValider.UseWaitCursor = true; if (rbAdminConnex.Checked == true && !tbPseudo.Visible) { VerificationsIdType(pers, "Admin"); } if (rbAdminCrea.Checked == true && tbPseudo.Visible) { VerificationsProfilExistant(pers, "Admin"); } if (rbUserConnex.Checked == true && !tbPseudo.Visible) { VerificationsIdType(pers, "User"); } if (rbUserCrea.Checked == true && tbPseudo.Visible) { VerificationsProfilExistant(pers, "User"); } InitialiseChamps(); }
public IEnumerable <Personne> DonneTous() { return(_personneRepository.GetAll()); }