예제 #1
0
        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);
            }
        }
예제 #2
0
 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);
         }
     }
 }