private void addActivityButton_Click(object sender, EventArgs e) { Topic t = (Topic)topicDataListView.SelectedObject; ActivityForm form = new ActivityForm(aM, t); DialogResult result = form.ShowDialog(); if (result == DialogResult.OK) { Activity temp = aM.getLastActivity(); activityBindingSource.Add(temp); } }
private void editActivityButton_Click(object sender, EventArgs e) { if (activityDataListView.SelectedIndex != -1) { Topic t = (Topic)topicDataListView.SelectedObject; Activity a = (Activity)activityDataListView.SelectedObject; ActivityForm form = new ActivityForm(aM, a, t); DialogResult result = form.ShowDialog(); if (result == DialogResult.OK) { activityBindingSource.Remove(a); Activity temp = aM.getLastActivity(); activityBindingSource.Add(temp); } } }