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 dgv_liste__SelectionChanged(object sender, EventArgs e) { try { if (dgv_liste_.Rows.Count > 0) { if (dgv_liste_.CurrentRow.Cells["_id_"].Value != null) { Int32 id = (Int32)dgv_liste_.CurrentRow.Cells["_id_"].Value; if (id > 0) { Marque f = MarqueBLL.One(id); Populate_(f); } } } } catch (Exception ex) { Messages.Exception(ex); } }