From 2ec8adac6155bd9b8eef5096ac801b48e17ed4e4 Mon Sep 17 00:00:00 2001 From: Baddi86 Date: Tue, 8 Sep 2026 23:59:07 +0200 Subject: [PATCH] Webuntis stunden check --- .../Services/WebUntisIntegrationService.cs | 7 + LehrerApp.Desktop/Views/MainWindow.axaml | 2 + LehrerApp.Desktop/Views/MainWindow.axaml.cs | 5 + .../Views/OpenUntisPeriodsDialog.cs | 125 ++++++++++++++++++ .../WebUntisOpenPeriodsTests.cs | 95 +++++++++++++ LehrerApp.WebUntis/WebUntisClient.cs | 2 +- LehrerApp.WebUntis/WebUntisOpenPeriods.cs | 113 ++++++++++++++++ 7 files changed, 348 insertions(+), 1 deletion(-) create mode 100644 LehrerApp.Desktop/Views/OpenUntisPeriodsDialog.cs create mode 100644 LehrerApp.WebUntis.Tests/WebUntisOpenPeriodsTests.cs create mode 100644 LehrerApp.WebUntis/WebUntisOpenPeriods.cs diff --git a/LehrerApp.Desktop/Services/WebUntisIntegrationService.cs b/LehrerApp.Desktop/Services/WebUntisIntegrationService.cs index 7d0c3e0..1ed0f5f 100644 --- a/LehrerApp.Desktop/Services/WebUntisIntegrationService.cs +++ b/LehrerApp.Desktop/Services/WebUntisIntegrationService.cs @@ -205,6 +205,13 @@ public sealed class WebUntisIntegrationService(HttpClient http, WebUntisSettings }; } + public Task GetOpenPeriodsMetaAsync(int schoolYearId, CancellationToken token = default) => + ExecuteAsync(client => client.GetOpenPeriodsMetaAsync(schoolYearId, token), token); + + public Task> GetOpenPeriodsAsync(int schoolYearId, int? teacherId, + int? classId, DateOnly start, DateOnly end, CancellationToken token = default) => + ExecuteAsync(client => client.GetOpenPeriodsAsync(schoolYearId, teacherId, classId, start, end, token), token); + private async Task ExecuteAsync(Func> operation, CancellationToken token) { try { return await operation(await GetClientAsync(token)); } diff --git a/LehrerApp.Desktop/Views/MainWindow.axaml b/LehrerApp.Desktop/Views/MainWindow.axaml index 76e9213..7a5f8ee 100644 --- a/LehrerApp.Desktop/Views/MainWindow.axaml +++ b/LehrerApp.Desktop/Views/MainWindow.axaml @@ -250,6 +250,8 @@ +