Пример #1
0
        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();
        }
Пример #2
0
 public void Remove(ClassAssignment classAss)
 {
     m_assList.Remove(classAss);
 }
Пример #3
0
 public void Add(ClassAssignment classAss)
 {
     m_assList.Add(classAss);
 }