private void Students_AfterCollectionChange(object sender, ReportingCollectionEventArgs e) { if (e.Action == ReportingCollectionAction.Add) { index++; } }
private void Subjects_BeforeCollectionChange(object sender, ReportingCollectionEventArgs e) { Subject subject = e.Item as Subject; if (Subjects.Any(s => s.Name == subject.Name)) { e.Cancel = true; } }
private void Students_BeforeCollectionChange(object sender, ReportingCollectionEventArgs e) { Student student = e.Item as Student; if (Students.ContainsValue(student)) { e.Cancel = false; } }
private void Classes_BeforeCollectionChange(object sender, ReportingCollectionEventArgs e) { Class @class = e.Item as Class; if (ClassExist(@class.Name)) { e.Cancel = true; } }