private void btnProAssocier_Click(object sender, EventArgs e) { Interaction i = new Interaction(Int32.Parse(cbxProAssociation1.Text), Int32.Parse(cbxProAssociation2.Text)); DAOInteractions.setInteraction(i); actualiserProduit(); }
private void dgvInteraction_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { int rowIndex = e.RowIndex; DataGridViewRow row = dgvInteraction.Rows[rowIndex]; DAOInteractions.supprInteraction(Int32.Parse(row.Cells[0].Value.ToString()), Int32.Parse(row.Cells[0].Value.ToString())); }
private void btnProDissocier_Click(object sender, EventArgs e) { int inter1 = 0; int inter2 = 0; foreach (DataGridViewRow row in dgvInteraction.SelectedRows) { inter1 = Int32.Parse(row.Cells[0].Value.ToString()); inter2 = Int32.Parse(row.Cells[1].Value.ToString()); } DAOInteractions.supprInteraction(inter1, inter2); actualiserProduit(); }
private void actualiserProduit() { listMedoc = DAOProduit.listeProduit(); dgvMedicaments.DataSource = null; dgvMedicaments.DataSource = listMedoc; listInteraction = DAOInteractions.listeInteractions(); dgvInteraction.DataSource = null; dgvInteraction.DataSource = listInteraction; cbxProAssociation1.Items.Clear(); cbxProAssociation2.Items.Clear(); foreach (Produit unProduit in listMedoc) { cbxProAssociation1.Items.Add(unProduit.Id_produit); cbxProAssociation2.Items.Add(unProduit.Id_produit); } }