public InfoFamille(string Code) { InitializeComponent(); currentFamille = new TB_Famille(); currentFamille.FindByKey(Code); SetChamp(currentFamille); save = false; }
private void Supprimer_Click(object sender, EventArgs e) { if (MessageBox.Show("Vous ete sure de vouloire Supprimer cette Famille ?", "Attention", MessageBoxButtons.YesNo) == DialogResult.Yes) { int index = c1TrueDBGrid1.Row; string Code = c1TrueDBGrid1.Columns["Code"].CellText(index); if (Code == null) { MessageBox.Show("Code Vide"); return; } TB_Famille Ar = new TB_Famille(); Ar.FindByKey(Code); Ar.DeleteData(); ((DataTable)c1TrueDBGrid1.DataSource).Rows.Find(Code).Delete(); } }