private void button1_Click(object sender, EventArgs e) { var categoryId = this.comboCategory.SelectedIndex + 1; var newProduit = new ProductModel { Code = Int32.Parse(this.txtCode.Text), Nom = this.txtNom.Text, Prix = Double.Parse(this.txtPrix.Text), Quantite = Int32.Parse(this.txtQuantite.Text), Id_Categorie = categoryId, Image = filePath }; if (productsService.AddProduit(newProduit)) { MessageBox.Show("Jeux ajouté avec succès.", "Succès ajout", MessageBoxButtons.OK, MessageBoxIcon.Information); } }