Пример #1
0
        private void AddEditStudentNotes(Student student)
        {
            StudentNoteData studentNoteData = new StudentNoteData(dbc);

            foreach (StudentNote sn in student.StudentNotes)
            {
                if (sn.StudentNoteId == 0)
                {
                    studentNoteData.Add(sn, student.PersonId);
                }
                else
                {
                    studentNoteData.Update(sn);
                }
            }

            foreach (object obj in student.RemovedObjects)
            {
                if (obj is StudentNote)
                {
                    studentNoteData.Remove(((StudentNote)obj).StudentNoteId);
                }
            }
        }
        public StudentNotesAddEdit(Student student, DBCommand dbc) : base(student, dbc)
        {
            StudentNoteData studentNoteData = new StudentNoteData(dbc);

            foreach (StudentNote sn in student.StudentNotes)
            {
                if (sn.StudentNoteId == 0)
                {
                    studentNoteData.Add(sn, student.PersonId);
                }
                else
                {
                    studentNoteData.Update(sn);
                }
            }

            foreach (object obj in student.RemovedObjects)
            {
                if (obj is StudentNote)
                {
                    studentNoteData.Remove(((StudentNote)obj).StudentNoteId);
                }
            }
        }