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) { Marque f = MarqueBLL.One(id); if (e.ColumnIndex == 4) { if (DialogResult.Yes == Messages.Confirmation(Mots.Supprimer.ToLower())) { if (MarqueBLL.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 (MarqueBLL.Delete(current_)) { DeleteRow_(current_); Reset_(); Messages.Succes(); } } } }