public produit_cardUC(Produit p, FormDetailleFournisseur formParent, int nbProds = 1) { this.isDeatilleFournisseur = true; this.currentProd = p; this.formParent2 = formParent; initCompo(p, nbProds); }
public FormProdDescri(Produit p, FormDetailleFournisseur formParent2) { this.isDetailleFourn = true; this.formParrent2 = formParent2; this.currentProd = p; initCompo(p); }
public Form_Ajouter_Produit_Adjust(FormDetailleFournisseur formParent, int idFournisseur) { this.isAjouterProd = true; this.idFournisseurAajouter = idFournisseur; this.formParent2 = formParent; InitializeComponent(); this.Text = "Ajouter Produit"; this.Titre.Text = "Ajouter Produit"; }
public Form_Ajouter_Produit_Adjust(Produit p, FormDetailleFournisseur formParent) { this.isAjouterProd = false; this.isDetailFournisseur = true; this.prod2Edit = p; this.formParent2 = formParent; initCompo(p); this.Text = "Modfier Produit"; this.Titre.Text = "Modfier Produit"; }
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { var db = new dbContext(); if (e.RowIndex != -1) { if (e.ColumnIndex == 6)//delete fournisseur row { var result = MessageBox.Show("la suppression est en cascade .Tous les produits relative a ce fourniseur vont etre supprimer y compris tous les records.Vous voulez Continuez ? ", "Attention", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (result == DialogResult.Yes) { try { if (e.RowIndex < 0) { return; //avoid header click event exception } Fournisseur fournisseur = db.Fournisseurs.ToArray <Fournisseur>()[e.RowIndex]; Form1.SetMessageLog($"Suppression de {fournisseur.nomFournisseur} {fournisseur.prenomFournisseur} de la liste des fournisseurs"); db.Fournisseurs.Remove(fournisseur); db.SaveChanges(); refrechDataGrid(db.Fournisseurs.ToList()); DialogResult res = MessageBox.Show("Fournisseur supprimé!", "Supprimé", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception exc) { MessageBox.Show("Error! " + exc.Message); } } else { return; } } if (e.ColumnIndex == 5)//edit fournisseur row { if (e.RowIndex < 0) { return; } Fournisseur fournisseur = db.Fournisseurs.ToArray <Fournisseur>()[e.RowIndex]; AjouterFournisseurForm f = new AjouterFournisseurForm(fournisseur, this); f.Show(); } if (e.ColumnIndex == 7)//Detaille des produits { int idFournisseur = (int)dataGridView1.Rows[e.RowIndex].Cells[0].Value; FormDetailleFournisseur a = new FormDetailleFournisseur(idFournisseur); a.Show(); } } }
public Form_Ajouter_Produit_Fournisseur(FormDetailleFournisseur formParent, int idFournisseur) { this.idFournisseurAajouter = idFournisseur; this.formParent2 = formParent; InitializeComponent(); }