Update x ricerca utenti

This commit is contained in:
Samuele Locatelli
2021-08-26 18:02:01 +02:00
parent ffb4c9872d
commit dc8ce10b51
5 changed files with 39 additions and 5 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<Version>1.0.2108.2617</Version>
<Version>1.0.2108.2618</Version>
<UserSecretsId>95c9f021-52d1-4390-a670-5810b7b777b0</UserSecretsId>
</PropertyGroup>
+35 -1
View File
@@ -103,6 +103,9 @@ namespace GWMS.UI.Pages
private bool isLoading { get; set; } = false;
[Inject]
private MessageService MessageService { get; set; }
private int numRecord
{
get => _numRecord;
@@ -151,6 +154,18 @@ namespace GWMS.UI.Pages
#endregion Protected Properties
#region Public Properties
public string searchVal
{
get
{
return MessageService.SearchVal;
}
}
#endregion Public Properties
#region Private Methods
private void AddNewUser()
@@ -427,6 +442,7 @@ namespace GWMS.UI.Pages
AppMService.ShowSearch = true;
AppMService.PageName = "Gestione Utenti";
AppMService.PageIcon = "fas fa-users pr-2";
AppMService.EA_SearchUpdated += OnSeachUpdated;
// lettura dati
await GetUsers();
await CheckSuperAdmin();
@@ -443,6 +459,7 @@ namespace GWMS.UI.Pages
public void Dispose()
{
AppMService.EA_SearchUpdated -= OnSeachUpdated;
}
/// <summary>
@@ -455,7 +472,15 @@ namespace GWMS.UI.Pages
// Collection to hold users
UsersList = new List<UserData>();
// get users from _UserManager
RawList = _UserManager.Users.ToList();
var allData = _UserManager.Users.ToList();
if (!string.IsNullOrEmpty(searchVal))
{
RawList = allData.Where(x => x.NormalizedEmail.Contains(searchVal.ToUpper()) || x.NormalizedUserName.Contains(searchVal.ToUpper())).ToList();
}
else
{
RawList = allData;
}
var user = RawList.Skip(numRecord * (currPage - 1)).Take(numRecord).Select(x => new IdentityUser
{
Id = x.Id,
@@ -481,6 +506,15 @@ namespace GWMS.UI.Pages
}
}
public async void OnSeachUpdated()
{
await GetUsers();
await InvokeAsync(() =>
{
StateHasChanged();
});
}
public string ShowClaims(List<System.Security.Claims.Claim> ClaimList)
{
string answ = string.Join(",", ClaimList);
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>GWMS - Gas Warehouse Management System</i>
<h4>Versione: 1.0.2108.2617</h4>
<h4>Versione: 1.0.2108.2618</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
1.0.2108.2617
1.0.2108.2618
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.0.2108.2617</version>
<version>1.0.2108.2618</version>
<url>http://nexus.steamware.net/repository/SWS/GWMS/stable/0/GWMS.UI.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/GWMS/stable/0/ChangeLog.html</changelog>
<mandatory>false</mandatory>