@@ -211,15 +221,10 @@
}
public record DayInfo(string Name, DateTime Date, bool IsToday);
- public record BookingPlaceholder(DateTime Date, string Project, string Task, double Hours);
+ public record BookingPlaceholder(DateTime Date, string Project, string Task, double Hours, string ContactPerson);
- // 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),
- };
+ // Dummy Daten für das DataGrid (Monatsansicht)
+ private List _dummyBookings = new();
protected override void OnInitialized()
{
@@ -235,7 +240,50 @@
_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" });
-
+
+ // Generiere Beispieldaten für den gesamten aktuellen Monat
+ GenerateMonthlyDummyData();
+ }
+
+ private void GenerateMonthlyDummyData()
+ {
+ var year = DateTime.Now.Year;
+ var month = DateTime.Now.Month;
+ var daysInMonth = DateTime.DaysInMonth(year, month);
+ var random = new Random(42); // Fester Seed für konstante Dummy-Daten
+
+ string[] projects = { "00001 - Gleitzeit", "00010 - Allg. Besprechung", "00500 - Webentwicklung", "01234 - Fehlerbehebung", "09876 - Konzeptphase" };
+ string[] tasks = { "Projektarbeit", "Meeting", "Jour Fixe", "Bugfixing", "Code Review", "Dokumentation" };
+ string[] contacts = { "Max Mustermann", "Anna Schmidt", "John Doe", "Maria Mayer", "Peter Parker" };
+
+ for (int day = 1; day <= daysInMonth; day++)
+ {
+ var currentDate = new DateTime(year, month, day);
+ // Keine Buchungen am Wochenende als Standard-Dummy
+ if (currentDate.DayOfWeek == DayOfWeek.Saturday || currentDate.DayOfWeek == DayOfWeek.Sunday)
+ continue;
+
+ // 1 bis 3 Einträge pro Tag
+ int entriesCount = random.Next(1, 4);
+
+ for (int i = 0; i < entriesCount; i++)
+ {
+ var hours = Math.Round(random.NextDouble() * 4 + 1, 1); // 1.0 bis 5.0 Stunden
+ // Runden auf halbe Stunden
+ hours = Math.Round(hours * 2, MidpointRounding.AwayFromZero) / 2;
+
+ _dummyBookings.Add(new BookingPlaceholder(
+ currentDate,
+ projects[random.Next(projects.Length)],
+ tasks[random.Next(tasks.Length)],
+ hours,
+ contacts[random.Next(contacts.Length)]
+ ));
+ }
+ }
+
+ // Sortiere absteigend nach Datum
+ _dummyBookings = _dummyBookings.OrderByDescending(b => b.Date).ToList();
}
private void OnBacklogSearchChanged(string newValue)