Esempio n. 1
0
 private void cmdModify_Click(object sender, EventArgs e)
 {
     if (dblswQuestions.SelectedItems.Count > 0)
     {
         Question  question = (Question)dblswQuestions.SelectedItems[0].Tag;
         fQuestion form     = new fQuestion(question);
         form.ShowDialog();
         if (form.ValidatedData)
         {
             form.Question.SaveAsync();
             Populate();
         }
     }
     else
     {
         MessageBox.Show("Nessuna domanda selezionata", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 2
0
 private void cmdInsert_Click(object sender, EventArgs e)
 {
     if (ValidatedData = ValidateData())
     {
         Topic.Description = txtTopicDescription.Text;
         Topic.SaveAsync();
         fQuestion form = new fQuestion(Topic.ID);
         form.ShowDialog();
         if (form.ValidatedData)
         {
             form.Question.SaveAsync();
             Populate();
         }
     }
     else
     {
         MessageBox.Show("Dati non validi per questo argomento", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }