コード例 #1
0
 /// <summary>
 /// Deletes the current item from the binding source's internal list. If this is not a new record then delete it from the database as well.
 /// </summary>
 private void DeleteRecord()
 {
     if (!NewRecord)
     {
         // delete record from database
         if (MessageBox.Show("Are you sure you want to delete this record?", "Confirm Delete", MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             DBAction.DeleteSurveyCheckRecord(CurrentRecord.ID);
         }
         else
         {
             return;
         }
     }
     // delete item from list
     bs.RemoveCurrent();
 }