Example #1
0
        private void FormListeDepot_Load(object sender, EventArgs e)
        {
            // TODO: cette ligne de code charge les données dans la table 'instadbDataSet.produit'. Vous pouvez la déplacer ou la supprimer selon les besoins.
            //this.produitTableAdapter.Fill(this.instadbDataSet.produit);
            Produit pro = new Produit();

            dataGridView1.DataSource = pro.RecupAllProduit();
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(textBox1.Text) == true)
            {
                MessageBox.Show("Quantite vide");
            }
            else if (String.IsNullOrEmpty(textBox2.Text) == true)
            {
                MessageBox.Show("description vide");
            }
            else if (String.IsNullOrEmpty(textBox3.Text) == true)
            {
                MessageBox.Show("prix vide");
            }
            else if (String.IsNullOrEmpty(textBox4.Text) == true)
            {
                MessageBox.Show("categorie vide");
            }


            else
            {
                Produit pro = new Produit();
                pro.Quantite    = Int32.Parse(textBox1.Text);
                pro.Description = textBox2.Text.ToString();
                pro.Prix        = Int32.Parse(textBox3.Text);
                pro.Categorie   = textBox4.Text.ToString();
                pro.insertproduit(pro);
                MessageBox.Show("Produit ajoute quantite: " + textBox1.Text + " description " + textBox2.Text);



                //DataTable dt = new DataTable();
                //dt = cli.RecupAllClient();
                dataGridView1.DataSource = pro.RecupAllProduit();
                textBox1.Clear();
                textBox2.Clear();
                textBox3.Clear();
                textBox4.Clear();
            }
        }