private void button1_Click(object sender, EventArgs e) { Utilisateurs U = new Utilisateurs(); U.ShowDialog(); this.Close(); }
private void button2_Click(object sender, EventArgs e) { if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "" || textBox6.Text == "" || textBox7.Text == "" || comboBox1.SelectedIndex == -1 || comboBox2.SelectedIndex == -1) { MessageBox.Show("Veuillez remplir tout les champs avant de Ajouter", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { o.conex(); o.cmd = new SqlCommand("Select * from Identification where Identifiant = '" + textBox3.Text + "'", o.cn); o.dr = o.cmd.ExecuteReader(); if (o.dr.HasRows == true) { MessageBox.Show("Le Identifiant " + textBox3.Text + " Appartient deja a un Utilisateur", "Ajoute echoue", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox3.Focus(); } else { o.dr.Close(); o.cmd = new SqlCommand("Insert into Identification values ('" + textBox3.Text + "','" + textBox7.Text + "','" + textBox1.Text + "', '" + textBox4.Text + "','" + comboBox2.Text + "','" + textBox2.Text + "', '" + comboBox1.Text + "','" + textBox6.Text.ToUpper() + "')", o.cn); o.cmd.ExecuteNonQuery(); MessageBox.Show("Utilisateur bien ajoute", "Ajoute avec succes", MessageBoxButtons.OK, MessageBoxIcon.Information); o.Deconex(); Utilisateurs U = new Utilisateurs(); U.ShowDialog(); this.Close(); } } }
private void button3_Click(object sender, EventArgs e) { if (MessageBox.Show("Voulez-vous vraiment supprimer L'" + comboBox2.Text + " " + textBox1.Text + " " + textBox7.Text + " ?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { o.conex(); o.cmd = new SqlCommand("Delete from Identification where Identifiant = '" + textBox3.Text + "'", o.cn); o.cmd.ExecuteNonQuery(); o.Deconex(); MessageBox.Show("Element bien supprime", "Reussi", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Hide(); Utilisateurs U = new Utilisateurs(); U.ShowDialog(); this.Close(); } }
private void button9_Click(object sender, EventArgs e) { if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "" || textBox6.Text == "" || textBox7.Text == "") { MessageBox.Show("Veuillez remplir tout les champs avant de Enregistrer", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { o.conex(); o.cmd = new SqlCommand("Update Identification set Nom = '" + textBox7.Text + "' , Prenom = '" + textBox1.Text + "' , MotDePasse ='" + textBox4.Text + "' , Privilege = '" + comboBox2.Text + "' , Email ='" + textBox2.Text + "' , QuestionDeSecurite = '" + comboBox1.Text + "' , Reponse = '" + textBox6.Text.ToUpper() + "' where Identifiant ='" + textBox3.Text + "'", o.cn); o.cmd.ExecuteNonQuery(); o.Deconex(); MessageBox.Show("Element bien modifie", "Modification reussi", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Hide(); Utilisateurs U = new Utilisateurs(); U.ShowDialog(); this.Close(); } }
private void utilisateursToolStripMenuItem_Click(object sender, EventArgs e) { Utilisateurs u = new Utilisateurs(); u.ShowDialog(); }