コード例 #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 btn_delete_Click(object sender, EventArgs e)
 {
     if (current != null ? current.Id > 0 : false)
     {
         if (DialogResult.Yes == Messages.Confirmation(Mots.Supprimer.ToLower()))
         {
             if (NiveauAccesBLL.Delete(current))
             {
                 DeleteRow(current);
                 Reset();
                 Messages.Succes();
             }
         }
     }
 }