diff --git a/AdminWindow.axaml b/AdminWindow.axaml
index 55422a2..c0680c6 100644
--- a/AdminWindow.axaml
+++ b/AdminWindow.axaml
@@ -16,7 +16,7 @@
-
+
diff --git a/HistoryWindow.axaml b/HistoryWindow.axaml
index e908131..635c12e 100644
--- a/HistoryWindow.axaml
+++ b/HistoryWindow.axaml
@@ -11,6 +11,12 @@
+
+
+
+
+
+
diff --git a/HistoryWindow.axaml.cs b/HistoryWindow.axaml.cs
index 6d908d7..747a65c 100644
--- a/HistoryWindow.axaml.cs
+++ b/HistoryWindow.axaml.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using Avalonia;
@@ -12,12 +13,13 @@ namespace dmeo040225;
public partial class HistoryWindow : Window
{
- public ObservableCollection Users { get; set; } = new();
+ ObservableCollection Users = new ObservableCollection();
+ List dataSourceUsers;
public HistoryWindow()
{
InitializeComponent();
using var context = new DatabaseContext();
- var users = context.Users.Select(user => new UserPresenter
+ dataSourceUsers = context.Users.Select(user => new UserPresenter
{
Id = user.Id,
RoleId = user.RoleId,
@@ -27,8 +29,9 @@ public partial class HistoryWindow : Window
Logorno = user.Logorno,
}).ToList();
- Users = new ObservableCollection(users);
ListBoxHistory.ItemsSource = Users;
+ FilterCombobox.ItemsSource = dataSourceUsers.Select(user => user.Login).ToList();
+ DisplayServices();
TimerService.Instance.TimeUpdated += UpdateTimerText;
TimerService.Instance.TimerExpired += LogoutUser;
@@ -51,6 +54,38 @@ public partial class HistoryWindow : Window
}
}
}
+
+ public void DisplayServices()
+ {
+ var temp = dataSourceUsers;
+ Users.Clear();
+ switch (SortComboBox.SelectedIndex)
+ {
+ case 1: temp = temp.OrderBy(it => it.Lastlogin).ToList(); break;
+ case 0: temp = temp.OrderByDescending(it => it.Lastlogin).ToList(); break;
+ default: break;
+ }
+
+ if (FilterCombobox.SelectionBoxItem != null)
+ {
+ temp = temp.Where(u => u.Login == FilterCombobox.SelectionBoxItem.ToString()).ToList();
+ }
+
+ foreach (var item in temp)
+ {
+ Users.Add(item);
+ }
+ }
+
+ private void SortComboBox_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)
+ {
+ DisplayServices();
+ }
+
+ private void FilterCombobox_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)
+ {
+ DisplayServices();
+ }
private void Back_OnClick(object? sender, RoutedEventArgs e)
{
diff --git a/bin/Debug/net8.0/dmeo040225.dll b/bin/Debug/net8.0/dmeo040225.dll
index 6de3cf1..bbb4d3f 100644
Binary files a/bin/Debug/net8.0/dmeo040225.dll and b/bin/Debug/net8.0/dmeo040225.dll differ
diff --git a/bin/Debug/net8.0/dmeo040225.pdb b/bin/Debug/net8.0/dmeo040225.pdb
index a2eb1b5..25f435d 100644
Binary files a/bin/Debug/net8.0/dmeo040225.pdb and b/bin/Debug/net8.0/dmeo040225.pdb differ
diff --git a/obj/Debug/net8.0/Avalonia/dmeo040225.dll b/obj/Debug/net8.0/Avalonia/dmeo040225.dll
index 6de3cf1..bbb4d3f 100644
Binary files a/obj/Debug/net8.0/Avalonia/dmeo040225.dll and b/obj/Debug/net8.0/Avalonia/dmeo040225.dll differ
diff --git a/obj/Debug/net8.0/Avalonia/dmeo040225.pdb b/obj/Debug/net8.0/Avalonia/dmeo040225.pdb
index a2eb1b5..25f435d 100644
Binary files a/obj/Debug/net8.0/Avalonia/dmeo040225.pdb and b/obj/Debug/net8.0/Avalonia/dmeo040225.pdb differ
diff --git a/obj/Debug/net8.0/Avalonia/resources b/obj/Debug/net8.0/Avalonia/resources
index 1866828..69ff546 100644
Binary files a/obj/Debug/net8.0/Avalonia/resources and b/obj/Debug/net8.0/Avalonia/resources differ
diff --git a/obj/Debug/net8.0/dmeo040225.AssemblyInfo.cs b/obj/Debug/net8.0/dmeo040225.AssemblyInfo.cs
index f78b921..aa192c5 100644
--- a/obj/Debug/net8.0/dmeo040225.AssemblyInfo.cs
+++ b/obj/Debug/net8.0/dmeo040225.AssemblyInfo.cs
@@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("dmeo040225")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
-[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+7df29eaed73ff8157467edb785b5cec0c2f2baac")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+24fcb4b4bdec7f65156773fbaab0680cea833382")]
[assembly: System.Reflection.AssemblyProductAttribute("dmeo040225")]
[assembly: System.Reflection.AssemblyTitleAttribute("dmeo040225")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/obj/Debug/net8.0/dmeo040225.AssemblyInfoInputs.cache b/obj/Debug/net8.0/dmeo040225.AssemblyInfoInputs.cache
index 9ceb25d..515878c 100644
--- a/obj/Debug/net8.0/dmeo040225.AssemblyInfoInputs.cache
+++ b/obj/Debug/net8.0/dmeo040225.AssemblyInfoInputs.cache
@@ -1 +1 @@
-8148ae1978269f085dafca0635f8af2746f8bdf7cc4fe5ae6804146ebc19fd26
+619dff8a150155e86bea2906fa1ba070e670274bf639e016b092abdd96b0f3a8
diff --git a/obj/Debug/net8.0/dmeo040225.dll b/obj/Debug/net8.0/dmeo040225.dll
index 6fec024..1d09361 100644
Binary files a/obj/Debug/net8.0/dmeo040225.dll and b/obj/Debug/net8.0/dmeo040225.dll differ
diff --git a/obj/Debug/net8.0/dmeo040225.pdb b/obj/Debug/net8.0/dmeo040225.pdb
index 5a59d9b..6830592 100644
Binary files a/obj/Debug/net8.0/dmeo040225.pdb and b/obj/Debug/net8.0/dmeo040225.pdb differ
diff --git a/obj/Debug/net8.0/ref/dmeo040225.dll b/obj/Debug/net8.0/ref/dmeo040225.dll
index 9b6405e..18b2883 100644
Binary files a/obj/Debug/net8.0/ref/dmeo040225.dll and b/obj/Debug/net8.0/ref/dmeo040225.dll differ
diff --git a/obj/Debug/net8.0/refint/Avalonia/dmeo040225.dll b/obj/Debug/net8.0/refint/Avalonia/dmeo040225.dll
index 9b6405e..18b2883 100644
Binary files a/obj/Debug/net8.0/refint/Avalonia/dmeo040225.dll and b/obj/Debug/net8.0/refint/Avalonia/dmeo040225.dll differ
diff --git a/obj/Debug/net8.0/refint/dmeo040225.dll b/obj/Debug/net8.0/refint/dmeo040225.dll
index bb5e099..47e4d64 100644
Binary files a/obj/Debug/net8.0/refint/dmeo040225.dll and b/obj/Debug/net8.0/refint/dmeo040225.dll differ