private void dgv_liste_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { if (dgv_liste.CurrentRow.Cells["id_"].Value != null) { Int32 id = Convert.ToInt32(dgv_liste.CurrentRow.Cells["id_"].Value); if (id > 0) { DocStock f = DocStockBLL.One(id); if (e.ColumnIndex == 5) { if (DialogResult.Yes == Messages.Confirmation(Mots.Supprimer.ToLower())) { if (DocStockBLL.Delete(f)) { DeleteRow(f); Reset(); Messages.Succes(); } } } else { Populate(f); } } } } catch (Exception ex) { Messages.Exception(ex); } }
private void btn_delete_Click(object sender, EventArgs e) { if (current != null ? current.Id > 0 : false) { if (DialogResult.Yes == Messages.Confirmation(Mots.Supprimer.ToLower())) { if (DocStockBLL.Delete(current)) { DeleteRow(current); Reset(); Messages.Succes(); } } } }