private void cmdInsert_Click(object sender, EventArgs e) { fTopic form = new fTopic(Teacher); form.ShowDialog(); if (form.ValidatedData) { form.Topic.SaveAsync(); PopulateTopics(); } }
private void cmdModify_Click(object sender, EventArgs e) { if (dblwTopics.SelectedItems.Count > 0) { Topic topic = (Topic)dblwTopics.SelectedItems[0].Tag; fTopic form = new fTopic(Teacher, topic); form.ShowDialog(); if (form.ValidatedData) { form.Topic.SaveAsync(); PopulateTopics(); } } else { MessageBox.Show("Nessun argomento selezionato", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error); } }