diff --git a/.idea/.idea.ChronoFlow/.idea/avalonia.xml b/.idea/.idea.ChronoFlow/.idea/avalonia.xml
new file mode 100644
index 0000000..b025fdf
--- /dev/null
+++ b/.idea/.idea.ChronoFlow/.idea/avalonia.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ChronoFlow.Controller/ZeiterfassungsController.cs b/ChronoFlow.Controller/ZeiterfassungsController.cs
new file mode 100644
index 0000000..c7de1ec
--- /dev/null
+++ b/ChronoFlow.Controller/ZeiterfassungsController.cs
@@ -0,0 +1,20 @@
+using System.Collections.Generic;
+using ChronoFlow.Model;
+
+namespace ChronoFlow.Controller
+{
+ public class ZeiterfassungsController
+ {
+ private readonly List _eintraege = new();
+
+ public void SpeichereEintrag(Zeiteintrag eintrag)
+ {
+ _eintraege.Add(eintrag);
+ }
+
+ public List LadeAlleEintraege()
+ {
+ return new List(_eintraege);
+ }
+ }
+}
diff --git a/ChronoFlow.Model/Zeiteintrag.cs b/ChronoFlow.Model/Zeiteintrag.cs
new file mode 100644
index 0000000..891b441
--- /dev/null
+++ b/ChronoFlow.Model/Zeiteintrag.cs
@@ -0,0 +1,26 @@
+using System;
+
+namespace ChronoFlow.Model
+{
+ public class Zeiteintrag
+ {
+ public string Mitarbeiter { get; set; }
+ public DateTime Startzeit { get; set; }
+ public DateTime Endzeit { get; set; }
+ public string? Projekt { get; set; }
+ public string? Kommentar { get; set; }
+
+ public TimeSpan Dauer => Endzeit - Startzeit;
+
+ //Felder für Mitarbeiter-Rückmeldung
+ public bool Erledigt { get; set; }
+ public string? MitarbeiterKommentar { get; set; }
+
+
+ public override string ToString()
+ {
+ return $"{Mitarbeiter} - {Startzeit:HH:mm} - {Endzeit:HH:mm} | {Projekt}";
+ }
+
+ }
+}
diff --git a/ChronoFlow.View/Assets/chrono_icon_1.ico b/ChronoFlow.View/Assets/chrono_icon_1.ico
new file mode 100644
index 0000000..02f3c9e
Binary files /dev/null and b/ChronoFlow.View/Assets/chrono_icon_1.ico differ
diff --git a/ChronoFlow.View/Assets/chrono_icon_2.ico b/ChronoFlow.View/Assets/chrono_icon_2.ico
new file mode 100644
index 0000000..d49d139
Binary files /dev/null and b/ChronoFlow.View/Assets/chrono_icon_2.ico differ
diff --git a/ChronoFlow.View/Assets/chrono_icon_3.ico b/ChronoFlow.View/Assets/chrono_icon_3.ico
new file mode 100644
index 0000000..4ae5a63
Binary files /dev/null and b/ChronoFlow.View/Assets/chrono_icon_3.ico differ
diff --git a/ChronoFlow.View/Assets/chrono_icon_4.ico b/ChronoFlow.View/Assets/chrono_icon_4.ico
new file mode 100644
index 0000000..6d8576d
Binary files /dev/null and b/ChronoFlow.View/Assets/chrono_icon_4.ico differ
diff --git a/ChronoFlow.View/ZeiterfassungView.axaml b/ChronoFlow.View/ZeiterfassungView.axaml
new file mode 100644
index 0000000..e8b7158
--- /dev/null
+++ b/ChronoFlow.View/ZeiterfassungView.axaml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ChronoFlow.View/ZeiterfassungView.axaml.cs b/ChronoFlow.View/ZeiterfassungView.axaml.cs
new file mode 100644
index 0000000..91e0431
--- /dev/null
+++ b/ChronoFlow.View/ZeiterfassungView.axaml.cs
@@ -0,0 +1,117 @@
+using System;
+using System.Collections.ObjectModel;
+using Avalonia.Controls;
+using Avalonia.Interactivity;
+using Avalonia.Media;
+using ChronoFlow.Controller;
+using ChronoFlow.Model;
+
+
+namespace ChronoFlow.View
+{
+ public partial class ZeiterfassungView : UserControl
+ {
+ private readonly ZeiterfassungsController _controller;
+
+ private ObservableCollection _anzeigeEinträge = new();
+
+
+ private readonly User _user;
+ public ZeiterfassungView(User user)
+ {
+ InitializeComponent();
+ _controller = new ZeiterfassungsController();
+ _user = user;
+
+ //ListBox an Collection binden
+ Eintragsliste.ItemsSource = _anzeigeEinträge;
+
+ //Eingabe-Felder für Nicht-Admins ausblenden
+ if (_user.Role != "Admin")
+ {
+ EingabePanel.IsVisible = false;
+ }
+
+ }
+
+ private void SpeichernButton_Click(object? sender, RoutedEventArgs e)
+ {
+ try
+ {
+ string mitarbeiter = MitarbeiterBox.Text ?? string.Empty;
+ DateTime datum = DatumPicker.SelectedDate?.Date ?? DateTime.Today;
+ string startText = StartzeitBox.Text ?? "";
+ string endText = EndzeitBox.Text ?? "";
+
+ if (!TimeSpan.TryParse(startText, out TimeSpan startZeit))
+ {
+ FeedbackText.Text = "Ungültige Startzeit!";
+ FeedbackText.Foreground = Brushes.Red;
+ FeedbackText.IsVisible = true;
+ return;
+ }
+
+ if (!TimeSpan.TryParse(endText, out TimeSpan endZeit))
+ {
+ FeedbackText.Text = "Ungültige Endzeit!";
+ FeedbackText.Foreground = Brushes.Red;
+ FeedbackText.IsVisible = true;
+ return;
+ }
+
+ var eintrag = new Zeiteintrag
+ {
+ Mitarbeiter = mitarbeiter,
+ Startzeit = datum.Date + startZeit,
+ Endzeit = datum.Date + endZeit,
+ Projekt = ProjektBox.Text,
+ Kommentar = KommentarBox.Text
+ };
+
+ _controller.SpeichereEintrag(eintrag);
+ _anzeigeEinträge.Add(eintrag);
+ FeedbackText.Text = "Eintrag gespeichert.";
+ FeedbackText.Foreground = Brushes.Green;
+ FeedbackText.IsVisible = true;
+ }
+ catch (Exception ex)
+ {
+ FeedbackText.Text = $"Fehler: {ex.Message}";
+ FeedbackText.Foreground = Brushes.Red;
+ FeedbackText.IsVisible = true;
+ }
+ }
+
+ private void MarkiereErledigt_Click(object? sender, RoutedEventArgs e)
+ {
+ if (sender is Button button && button.DataContext is Zeiteintrag eintrag)
+ {
+ eintrag.Erledigt = true;
+ RefreshListe();
+ }
+ }
+
+ private void MarkiereNichtErledigt_Click(object? sender, RoutedEventArgs e)
+ {
+ if (sender is Button button && button.DataContext is Zeiteintrag eintrag)
+ {
+ eintrag.Erledigt = false;
+ RefreshListe();
+ }
+ }
+
+ private void Kommentar_LostFocus(object? sender, RoutedEventArgs e)
+ {
+ if (sender is TextBox tb && tb.DataContext is Zeiteintrag eintrag)
+ {
+ eintrag.MitarbeiterKommentar = tb.Text;
+ }
+ }
+
+ private void RefreshListe()
+ {
+ Eintragsliste.ItemsSource = null;
+ Eintragsliste.ItemsSource = _anzeigeEinträge;
+ }
+ }
+}