Exemplo n.º 1
0
 private void pictureBox10_Click(object sender, EventArgs e)
 {
     if (dataGridView1.Rows.Count == 0)
         MessageBox.Show("Liste vide!", "Erreur", MessageBoxButtons.OK,MessageBoxIcon.Error);
     else
     {
         DialogResult result = MessageBox.Show("Voulez-vous vraiment supprimer cette catégorie?", "Supprimer Catégorie", MessageBoxButtons.YesNo);
         if (result == DialogResult.Yes)
         {
             string id_categorie = dataGridView1.CurrentRow.Cells[0].Value.ToString();
             Categorie C = new Categorie(id_categorie);
             C.supprimerCategorie();
             this.categorieTableAdapter.Fill(this.gestioncommercialeDataSet1.categorie);
         }
     }
 }
Exemplo n.º 2
0
 private void pictureBox6_Click(object sender, EventArgs e)
 {
     if (textBox1.Text != "")
     {
         Categorie F = new Categorie(textBox1.Text);
         F.ajouterCategorie();
         this.categorieTableAdapter.Fill(this.gestioncommercialeDataSet1.categorie);
         textBox1.Text = "";
     }
 }