private void btOK_Click(object sender, EventArgs e) { if (txtLogin.Text.Replace(" ", "") != "" && txtPassword.Text.Replace(" ", "") != "") { PersonneServices s = new PersonneServices(); Personne p = s.GetPersonneByIdPw(txtLogin.Text, txtPassword.Text); if (p == null) { lbError.Visible = true; txtPassword.Text = ""; } else { FenetreAccueil fnAcc = new FenetreAccueil(p); this.Hide(); fnAcc.Show(); } } else { MessageBox.Show("Veuillez remplir tous les champs"); } }
public FenetreAccueil(Personne p) { Personne = p; InitializeComponent(); }