private void cmdInsert_Click(object sender, EventArgs e) { if (ValidatedData = ValidateData()) { Question.Description = txtDescription.Text; Question.SaveAsync(); fAnswer form = new fAnswer(Question.ID); form.ShowDialog(); if (form.ValidatedData) { form.Answer.SaveAsync(); Populate(); } } else { MessageBox.Show("Dati non validi per questo argomento", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void cmdModify_Click(object sender, EventArgs e) { if (dblwAnswers.SelectedItems.Count > 0) { Answer answer = (Answer)dblwAnswers.SelectedItems[0].Tag; fAnswer form = new fAnswer(answer); form.ShowDialog(); if (form.ValidatedData) { form.Answer.SaveAsync(); //form.cmdSave_Click(this, new EventArgs()); Populate(); } } else { MessageBox.Show("Nessuna domanda selezionata", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error); } }