private void Connect(object sender, EventArgs e) { DBConnect Connect = new DBConnect(); DataSet DataAccount = Connect.CheckLogin(tb_login.Text, tb_mdp.Text); //Si le Count renvoie 0, on affiche une erreur if (DataAccount.Tables[0].Rows.Count == 0) { MessageBox.Show("Login ou mot de passe incorrect."); } //Sinon on parcours else { //On verifie son rĂ´le if (DataAccount.Tables[0].Rows[0].ItemArray[1].ToString() == "False") { //On initialise l'ID du client var ListeID = new ClientDAO(); ListeID.RetrieveCustomerId(tb_login.Text); Hide(); var LoggedCustomer = new Logged_Customer(); LoggedCustomer.ShowDialog(); Close(); } //Si Admin else { Hide(); var LoggedAdmin = new Logged_Admin(); LoggedAdmin.ShowDialog(); Close(); } } }
private void BackForm(object sender, EventArgs e) { Hide(); var LoggedCustomer = new Logged_Customer(); LoggedCustomer.ShowDialog(); Close(); }