diff --git a/Presence.Desktop/ViewModels/PresenceViewModel.cs b/Presence.Desktop/ViewModels/PresenceViewModel.cs index ce76ecf..dda7000 100644 --- a/Presence.Desktop/ViewModels/PresenceViewModel.cs +++ b/Presence.Desktop/ViewModels/PresenceViewModel.cs @@ -6,6 +6,7 @@ using Presence.Desktop.Models; using Presence.Desktop.ViewModels; using ReactiveUI; using System; +using System.Collections.Generic; using System.Collections.ObjectModel; using System.Globalization; using System.Linq; @@ -41,8 +42,8 @@ namespace Presence.Desktop.ViewModels } } - private DateTime? _selectedDate; - public DateTime? SelectedDate + private List _selectedDate = new List(); + public List SelectedDate { get => _selectedDate; set @@ -83,7 +84,7 @@ namespace Presence.Desktop.ViewModels } } - private void FilterAttendanceRecords() + public void FilterAttendanceRecords() { if (SelectedGroup == null || SelectedDate == null) { @@ -91,25 +92,30 @@ namespace Presence.Desktop.ViewModels return; } - var records = _presenceUseCase.GetPresenceByGroupAndDate( - SelectedGroup.Id, - DateOnly.FromDateTime(SelectedDate.Value)); - AttendanceRecords.Clear(); - foreach (var record in records) + + foreach (var selDate in SelectedDate) { - AttendanceRecords.Add(new PresencePresenter - { - Id = record.Id, - Date = record.Date, - ClassNumber = record.ClassNumber, - IsAttendence = record.IsAttendence, - User = new UserPresenter + var records = _presenceUseCase.GetPresenceByGroupAndDate( + SelectedGroup.Id, + DateOnly.FromDateTime(selDate.Value)); + + foreach (var record in records) { - Id = record.User.Id, - Name= record.User.FIO + AttendanceRecords.Add(new PresencePresenter + { + Id = record.Id, + Date = record.Date, + ClassNumber = record.ClassNumber, + IsAttendence = record.IsAttendence, + User = new UserPresenter + { + Id = record.User.Id, + Name = record.User.FIO + } + }); } - }); + } // Логирование для отладки diff --git a/Presence.Desktop/Views/PresenceView.axaml b/Presence.Desktop/Views/PresenceView.axaml index 5da2718..31a40e6 100644 --- a/Presence.Desktop/Views/PresenceView.axaml +++ b/Presence.Desktop/Views/PresenceView.axaml @@ -19,10 +19,11 @@ - + + - + @@ -34,6 +35,7 @@