From 44da4932aa5243cba3683f7272be3f00a69fc7b6 Mon Sep 17 00:00:00 2001 From: Leon Hoppe Date: Wed, 5 Mar 2025 19:32:18 +0100 Subject: [PATCH] Started adding capture page logic --- src/WorkTime.Mobile/App.xaml.cs | 5 +- src/WorkTime.Mobile/AppShell.xaml | 25 +++-- src/WorkTime.Mobile/Extensions.cs | 17 +++ src/WorkTime.Mobile/MainPage.xaml | 36 ------- src/WorkTime.Mobile/MainPage.xaml.cs | 20 ---- src/WorkTime.Mobile/MauiProgram.cs | 27 +++-- .../Repositories/ClientEntryRepository.cs | 10 ++ .../Repositories/ServerEntryRepository.cs | 26 ++--- src/WorkTime.Mobile/Services/AuthService.cs | 11 +- src/WorkTime.Mobile/Services/EntryService.cs | 66 ++++++++++++ src/WorkTime.Mobile/Services/HttpService.cs | 101 ++++++++++++++++++ .../ViewModels/CaptureViewModel.cs | 77 +++++++++++++ .../Views/Components/DateSelector.xaml | 25 +++++ .../Views/Components/DateSelector.xaml.cs | 47 ++++++++ .../Views/Pages/CapturePage.xaml | 39 +++++++ .../Views/Pages/CapturePage.xaml.cs | 15 +++ src/WorkTime.Mobile/WorkTime.Mobile.csproj | 8 +- 17 files changed, 458 insertions(+), 97 deletions(-) create mode 100644 src/WorkTime.Mobile/Extensions.cs delete mode 100644 src/WorkTime.Mobile/MainPage.xaml delete mode 100644 src/WorkTime.Mobile/MainPage.xaml.cs create mode 100644 src/WorkTime.Mobile/Services/EntryService.cs create mode 100644 src/WorkTime.Mobile/Services/HttpService.cs create mode 100644 src/WorkTime.Mobile/ViewModels/CaptureViewModel.cs create mode 100644 src/WorkTime.Mobile/Views/Components/DateSelector.xaml create mode 100644 src/WorkTime.Mobile/Views/Components/DateSelector.xaml.cs create mode 100644 src/WorkTime.Mobile/Views/Pages/CapturePage.xaml create mode 100644 src/WorkTime.Mobile/Views/Pages/CapturePage.xaml.cs diff --git a/src/WorkTime.Mobile/App.xaml.cs b/src/WorkTime.Mobile/App.xaml.cs index b079cca..6d3d7c1 100644 --- a/src/WorkTime.Mobile/App.xaml.cs +++ b/src/WorkTime.Mobile/App.xaml.cs @@ -1,8 +1,11 @@ -namespace WorkTime.Mobile; +using MauiIcons.Core; + +namespace WorkTime.Mobile; public partial class App : Application { public App() { InitializeComponent(); + _ = new MauiIcon(); } protected override Window CreateWindow(IActivationState? activationState) { diff --git a/src/WorkTime.Mobile/AppShell.xaml b/src/WorkTime.Mobile/AppShell.xaml index 19d4bd6..8d397c6 100644 --- a/src/WorkTime.Mobile/AppShell.xaml +++ b/src/WorkTime.Mobile/AppShell.xaml @@ -3,13 +3,24 @@ x:Class="WorkTime.Mobile.AppShell" xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" - xmlns:local="clr-namespace:WorkTime.Mobile" - Shell.FlyoutBehavior="Flyout" - Title="WorkTime.Mobile"> + xmlns:pages="clr-namespace:WorkTime.Mobile.Views.Pages" + xmlns:icons="http://www.aathifmahir.com/dotnet/2022/maui/icons" + FlyoutBehavior="Disabled" + Title="Zeiterfassung"> - + + + + + + + + + + + diff --git a/src/WorkTime.Mobile/Extensions.cs b/src/WorkTime.Mobile/Extensions.cs new file mode 100644 index 0000000..a4d8b54 --- /dev/null +++ b/src/WorkTime.Mobile/Extensions.cs @@ -0,0 +1,17 @@ +using WorkTime.Shared.Models; + +namespace WorkTime.Mobile; + +public static class Extensions { + + public static string GetActionName(this TimeEntryType type) { + return type switch { + TimeEntryType.Login => "Einstempeln", + TimeEntryType.Logout => "Ausstempeln", + TimeEntryType.LoginDrive => "Dienstreise starten", + TimeEntryType.LogoutDrive => "Dienstreise beenden", + _ => string.Empty + }; + } + +} \ No newline at end of file diff --git a/src/WorkTime.Mobile/MainPage.xaml b/src/WorkTime.Mobile/MainPage.xaml deleted file mode 100644 index c017f15..0000000 --- a/src/WorkTime.Mobile/MainPage.xaml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - -