Пример #1
0
 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)
             {
                 NiveauAcces f = NiveauAccesBLL.One(id);
                 if (e.ColumnIndex == 3)
                 {
                     if (DialogResult.Yes == Messages.Confirmation(Mots.Supprimer.ToLower()))
                     {
                         if (NiveauAccesBLL.Delete(f))
                         {
                             DeleteRow(f);
                             Reset();
                             Messages.Succes();
                         }
                     }
                 }
                 else
                 {
                     Populate(f);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Messages.Exception(ex);
     }
 }
Пример #2
0
 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)
                 {
                     NiveauAcces f = NiveauAccesBLL.One(id);
                     Populate(f);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Messages.Exception(ex);
     }
 }