private void button1_Click(object sender, EventArgs e) { var GetType = this.Personne.GetType().ToString(); var type = GetType.Substring(14); if (type.Equals("Admin")) { IGestionAdminDAO IGADAO = new GestionAdminDAO(); IGADAO.Changer_Mdp(this.Personne, textBox1.Text); } if (type.Equals("Technicien")) { IGestionTechnicienDAO IGTDAO = new GestionTechnicienDAO(); IGTDAO.Changer_Mdp(this.Personne, textBox1.Text); } }
private void button1_Click(object sender, EventArgs e) { var Login = textBox1.Text; var Password = textBox2.Text; Personne P = null; IGestionTechnicienDAO IGTDAO = new GestionTechnicienDAO(); IGestionAdminDAO IGADAO = new GestionAdminDAO(); if (comboBox1.Text.Equals("Technicien")) { P = IGTDAO.RechercherTechnicien(Login, Password); if (P == null) { MessageBox.Show("erreur "); } else { Accueil_Technicien A = new Accueil_Technicien(P); A.Show(); } } else { P = IGADAO.RechercherAdmin(Login, Password); if (P == null) { MessageBox.Show("erreur "); } else { Accueil_Admin A = new Accueil_Admin(P); A.Show(); } } }