Dokumentationseinträge mit Typwahl (Gespräch, Vorkommnis, Förderplan, Fehlzeit, Elternanruf, Elternbrief), vertrauliche Einträge nur nach Bestätigung sichtbar, weiche Löschung mit Nachvollziehbarkeit. Fehlzeiten als Auswertung des bestehenden Anwesenheits-Trackings statt zweiter Erfassung, mit Schwellenwert-Warnung im Schülerdetail und Dashboard. Förderplan-Wiedervorlage als Dashboard-Karte. Datenschutz: Löschfristen mit manueller Bereinigung und DSGVO-Art.-15-Datenauskunft als Export. Auf Nutzer-Feedback hin ergänzt: Elternanruf mit begleitendem Gesprächsprotokoll-Dialog (Punkte abhaken, Eindrücke festhalten), Elternbrief mit Versand-/Rückmeldungs-Tracking, Datei-Anhänge über LiteDBs Dateispeicher, frei vergebbare Labels zur Nachverfolgung mit Dringlichkeits-Farbcodierung, sowie eine sichtbare Farblegende für das bestehende Notenentwicklungs-Diagramm. Dabei einen Absturz behoben: leere Textfelder lieferten über das Binding null statt "", was beim Speichern eine NullReferenceException auslöste. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
59 lines
1.8 KiB
C#
59 lines
1.8 KiB
C#
using Avalonia.Controls;
|
|
using Avalonia.Interactivity;
|
|
using Avalonia.Platform.Storage;
|
|
using LehrerApp.Desktop.ViewModels.Students;
|
|
|
|
namespace LehrerApp.Desktop.Views.Students;
|
|
|
|
public partial class DocumentationDialog : Window
|
|
{
|
|
public DocumentationDialog() => InitializeComponent();
|
|
|
|
private void OnSave(object? sender, RoutedEventArgs e)
|
|
{
|
|
if (DataContext is DocumentationDialogViewModel vm)
|
|
{
|
|
vm.SaveCommand.Execute(null);
|
|
if (vm.Result is not null) Close(true);
|
|
}
|
|
}
|
|
|
|
private void OnCancel(object? sender, RoutedEventArgs e)
|
|
{
|
|
if (DataContext is DocumentationDialogViewModel vm) vm.DiscardUnsavedAttachments();
|
|
Close(false);
|
|
}
|
|
|
|
private async void OnAddAttachment(object? sender, RoutedEventArgs e)
|
|
{
|
|
if (DataContext is not DocumentationDialogViewModel vm) return;
|
|
|
|
var files = await StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
|
|
{
|
|
Title = "Anhang auswählen", AllowMultiple = false,
|
|
});
|
|
if (files.Count == 0) return;
|
|
|
|
await using var stream = await files[0].OpenReadAsync();
|
|
vm.AddAttachment(files[0].Name, stream);
|
|
}
|
|
|
|
private async void OnOpenAttachment(object? sender, RoutedEventArgs e)
|
|
{
|
|
if (DataContext is not DocumentationDialogViewModel vm) return;
|
|
if (sender is not Button { Tag: AttachmentItem item }) return;
|
|
|
|
using var source = vm.OpenAttachment(item);
|
|
if (source is null) return;
|
|
|
|
var file = await StorageProvider.SaveFilePickerAsync(new FilePickerSaveOptions
|
|
{
|
|
Title = "Anhang speichern unter", SuggestedFileName = item.FileName,
|
|
});
|
|
if (file is null) return;
|
|
|
|
await using var target = await file.OpenWriteAsync();
|
|
await source.CopyToAsync(target);
|
|
}
|
|
}
|