private void buttonOk_Click(object sender, EventArgs e) { if (newAssignment) { ClassAssignment newAssign = new ClassAssignment(textBoxAssignTitle.Text, comboBoxAssignType.Text, textBoxAssignDescription.Text, richTextBoxAssignNotes.Text, assignmentClass.ClassTitle, dateTimePickerAssignDue.Value, checkBoxAssignCompleted.Checked); assignmentClass.ClassTreeAssignments.Add(newAssign); } else { foreach (ClassAssignment cAss in assignmentClass.ClassTreeAssignments) { if (cAss.assignmentTitle == originalAssignmentTitle) { assignmentClass.ClassTreeAssignments.Remove(cAss); cAss.assignmentTitle = textBoxAssignTitle.Text; cAss.assignmentType = comboBoxAssignType.Text; cAss.assignmentDescription = textBoxAssignDescription.Text; cAss.assignmentNote = richTextBoxAssignNotes.Text; cAss.assignmentDue = dateTimePickerAssignDue.Value; cAss.assignmentClass = assignmentClass.ClassTitle; cAss.assignmentComplete = checkBoxAssignCompleted.Checked; assignmentClass.ClassTreeAssignments.Add(cAss); } } } this.Close(); }
public void Remove(ClassAssignment classAss) { m_assList.Remove(classAss); }
public void Add(ClassAssignment classAss) { m_assList.Add(classAss); }