コード例 #1
0
 private void supprimerToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (contactBindingSource.Current == null)
     {
         return;
     }
     if (MessageBox.Show("Voulez vous vraiment supprimer ce contact ?", "Message", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         ContactServices.Delete(contactBindingSource.Current as Contact);
         contactBindingSource.RemoveCurrent();
     }
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: dirtycreep/Ado.net
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (contactBindingSource.Current == null)
     {
         return;
     }
     if (MessageBox.Show("Are you sure delete", "Message", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         ContactServices.Delete(contactBindingSource.Current as Contact);
         contactBindingSource.RemoveCurrent();
     }
 }