@page "/" @using MudBlazor @inject ISnackbar Snackbar Dashboard | OnProf
Hallo, Marc! März 2026
Hier ist deine Übersicht für die aktuelle Woche.
Heute gebucht
6,5 h
Wochenfortschritt 32 / 40h Aktuelles Projekt 00000001 - Gleitzeit Projekt wechseln Urlaub / Überstunden
12 Urlaub
+14,5 Gleitzeit
KW 12
@foreach (var day in _weekDays) {
@day.Name @day.Date.ToShortDateString()
Summe: @(_items.Where(i => i.Status == day.Name).Sum(i => i.Hours))h
}
Projekt-Stapel
@context.Project @if (context.Status != "Backlog") { }
@context.Task
Buchungsverlauf
@context.Item.Date.ToString("dd.MM.yyyy")
@context.Item.Project
@context.Item.Hours h
@code { private MudDropContainer _dropContainer; private string _searchString = ""; private string _backlogSearchString = ""; private List _weekDays = new(); private List _items = new(); // Datenstrukturen public class DropItem { public string Project { get; set; } = string.Empty; public string Task { get; set; } = string.Empty; public double Hours { get; set; } public string Color { get; set; } = "#7e6fff"; public string Status { get; set; } = "Backlog"; } public record DayInfo(string Name, DateTime Date, bool IsToday); public record BookingPlaceholder(DateTime Date, string Project, string Task, double Hours); // Dummy Daten für das DataGrid private List _dummyBookings = new() { new(DateTime.Now, "00000001 - Gleitzeit", "Projektarbeit", 0.0), new(DateTime.Now.AddDays(-1), "00000001 - Gleitzeit", "Meeting", 0.0), new(DateTime.Now.AddDays(-2), "00000010 - Allg. Besprechung", "Jour Fixe", 0.0), }; protected override void OnInitialized() { // Wochentage generieren (Mo-Fr) var startOfWeek = DateTime.Now.AddDays(-(int)DateTime.Now.DayOfWeek + (int)DayOfWeek.Monday); for (int i = 0; i < 5; i++) { var date = startOfWeek.AddDays(i); _weekDays.Add(new DayInfo(date.ToString("dddd"), date, date.Date == DateTime.Today)); } // Stapel an Vorlagen im Backlog _items.Add(new DropItem { Project = "00001", Task = "Gleitzeit", Hours = 0, Color = "#7e6fff", Status = "Backlog" }); _items.Add(new DropItem { Project = "00010", Task = "Meeting", Hours = 0, Color = "#3dcb6c", Status = "Backlog" }); _items.Add(new DropItem { Project = "00500", Task = "Entwicklung", Hours = 0, Color = "#ffb545", Status = "Backlog" }); } private void OnBacklogSearchChanged(string newValue) { _backlogSearchString = newValue; _dropContainer.Refresh(); } private void ItemUpdated(MudItemDropInfo dropInfo) { if (dropInfo.DropzoneIdentifier != "Backlog" && dropInfo.Item.Status == "Backlog") { // Erstelle eine echte Kopie vom Template und füge sie sofort hinzu var newItem = new DropItem { Project = dropInfo.Item.Project, Task = dropInfo.Item.Task, Hours = dropInfo.Item.Hours, Color = dropInfo.Item.Color, Status = dropInfo.DropzoneIdentifier }; _items.Add(newItem); Snackbar.Add($"{newItem.Task} zum {dropInfo.DropzoneIdentifier} hinzugefügt", Severity.Success); } else { // Einfaches Verschieben zwischen den Tagen dropInfo.Item.Status = dropInfo.DropzoneIdentifier; } _dropContainer.Refresh(); } private void DeleteItem(DropItem item) { if (item.Status != "Backlog") { _items.Remove(item); Snackbar.Add($"{item.Task} gelöscht", Severity.Warning); _dropContainer.Refresh(); } } private Func _quickFilter => x => { if (string.IsNullOrWhiteSpace(_searchString)) return true; return x.Project.Contains(_searchString, StringComparison.OrdinalIgnoreCase) || x.Task.Contains(_searchString, StringComparison.OrdinalIgnoreCase); }; private void OpenBookingDialog() { Snackbar.Add("Dialog für manuelle Buchung wird implementiert...", Severity.Info); } }