private void Connecter_Click(object sender, EventArgs e) { pEFalse2.Visible = false; if (textEditLogin.Text == "") { pEFalse1.Visible = true; } else { var repositoryUser = new RepositoryUtilisateur(); var authentification = repositoryUser.FindAll().Any(p => p.Pseudo == textEditLogin.Text); if (authentification) { pEFalse1.Visible = false; if (textEditPassword.Text != "") { var authentification2 = repositoryUser.FindAll() .Where(p => p.Pseudo == textEditLogin.Text && p.Mdp == textEditPassword.Text).ToList(); if (authentification2.IsEmpty()) { pEFalse2.Visible = true; } else { Hide(); new FrmMain(authentification2.First().Administrateur, authentification2.First().Type).Show(); } } else { pEFalse2.Visible = true; } } else { pEFalse1.Visible = true; } } }
private void Connecter_Click(object sender, EventArgs e) { pEFalse2.Visible = false; if (textEditLogin.Text == "") { pEFalse1.Visible = true; } else { var repositoryUser = new RepositoryUtilisateur(); var authentification = repositoryUser.FindAll().Any(p => p.Pseudo == textEditLogin.Text); if (authentification) { pEFalse1.Visible = false; if (textEditPassword.Text != "") { var authentification2 =repositoryUser.FindAll() .Where(p => p.Pseudo == textEditLogin.Text && p.Mdp == textEditPassword.Text).ToList(); if (authentification2.IsEmpty()) { pEFalse2.Visible = true; } else { Hide(); new FrmMain(authentification2.First().Administrateur, authentification2.First().Type).Show(); } } else { pEFalse2.Visible = true; } } else { pEFalse1.Visible = true; } } }
private void RefreshDataSource() { var repositoryUtilisateur = new RepositoryUtilisateur(); gridControlUtilisateur.DataSource = repositoryUtilisateur.FindAll(); }