private void btDelete_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Really delete?", "Confirm delete", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         try
         {
             target.DeleteByID(form.ID);
             MessageBox.Show("Delete success!");
             this.Close();
         }
         catch (Exception ex)
         {
             MessageBox.Show("Not that easy : " + ex.Message);
         }
     }
 }
Пример #2
0
        private void btQDelete_Click(object sender, EventArgs e)
        {
            try
            {
                foreach (EnglishSentences eng in actual)
                {
                    if (eng != null)
                    {
                        target.DeleteByID(eng.ID);
                    }
                }
            }catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            MessageBox.Show("Delete success!");
        }