private Paragraph GetParagraphOfBeobachtung(Beobachtung b) { foreach (var i in Document.Blocks) { if (i is Paragraph && i.Tag is int && ((int) i.Tag) == b.BeobachtungId) return (Paragraph) i; } return null; }
public void AddCurrentComment(bool clear = true) { // Save current comment foreach (Schueler s in SelectedSchülerList) { Beobachtung b = new Beobachtung() { Datum = BeoDatum, Fach = (SelectedFach == null || SelectedFach.FachId == -1000) ? null : SelectedFach, Text = BeoText, SchuljahrId = Settings.ActiveSchuljahr.Startjahr, Schueler = s }; UnitOfWork.Beobachtungen.Add(b); } UnitOfWork.Save(); UpdateHistory(); if (clear) BeoText = ""; }