Example #1
0
        private void btnAjouterFournisseur_Click(object sender, EventArgs e)
        {
            AjouterFournisseur af = new AjouterFournisseur(0);

            af.Show();
            comboBoxFournisseur.Items.Add(af.textBoxNom.Text);
        }
 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dataGridView1.CurrentRow.Index != -1)
     {
         btnModifier.Enabled  = true;
         btnSupprimer.Enabled = true;
         AjouterFournisseur aj = new AjouterFournisseur(0);
     }
 }
        private void btnModifier_Click(object sender, EventArgs e)
        {
            id_four = Convert.ToInt32(dataGridView1.CurrentRow.Cells[2].Value.ToString());
            AjouterFournisseur af = new AjouterFournisseur(0);

            af.Text                    = "Modifier Fournisseur";
            af.btnAjouter.Text         = "Modifier";
            af.textBoxNom.Text         = dataGridView1.CurrentRow.Cells[3].Value.ToString();
            af.textBoxEmail.Text       = dataGridView1.CurrentRow.Cells[1].Value.ToString();
            af.textBoxTel.Text         = dataGridView1.CurrentRow.Cells[4].Value.ToString();
            af.richTextBoxAdresse.Text = dataGridView1.CurrentRow.Cells[0].Value.ToString();
            af.Show();
        }
        private void btnAfficher_Click(object sender, EventArgs e)
        {
            AjouterFournisseur af = new AjouterFournisseur(0);

            af.Text = "Afficher Fournisseur";
            af.Controls.Remove(af.btnAjouter);
            af.btnAjouter.Dispose();
            af.textBoxNom.Enabled         = false;
            af.textBoxEmail.Enabled       = false;
            af.textBoxTel.Enabled         = false;
            af.richTextBoxAdresse.Enabled = false;
            id_four = Convert.ToInt32(dataGridView1.CurrentRow.Cells[2].Value.ToString());

            af.textBoxNom.Text         = dataGridView1.CurrentRow.Cells[3].Value.ToString();
            af.textBoxEmail.Text       = dataGridView1.CurrentRow.Cells[1].Value.ToString();
            af.textBoxTel.Text         = dataGridView1.CurrentRow.Cells[4].Value.ToString();
            af.richTextBoxAdresse.Text = dataGridView1.CurrentRow.Cells[0].Value.ToString();
            af.Show();
        }
        private void btnAjouter_Click(object sender, EventArgs e)
        {
            AjouterFournisseur af = new AjouterFournisseur(0);

            af.Show();
        }