Exemplo n.º 1
0
 /**
  * Method to delete a question in listview in tab Questions when the button "delete" is clicked
  */
 private void buttonDelete_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("You will delete a question. Are you sure you want to continue ?", "DELETE A QUESTION", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
     {
         try
         {
             //Call method in DAO Question to delete question with pass in argument the content of question
             //the content of question is selected in listViewQuestion_MouseClick
             DAOQuestion.DeleteQuestion(textBoxUsername.Text);
             DisplayAllQuestions();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
 }