diff --git a/MP.Land/Components/CmpGroupFilt.razor b/MP.Land/Components/CmpGroupFilt.razor new file mode 100644 index 00000000..d23cc8af --- /dev/null +++ b/MP.Land/Components/CmpGroupFilt.razor @@ -0,0 +1,20 @@ + +
+
+ Gruppi +
+
+ +
+
+ + diff --git a/MP.Land/Components/CmpGroupFilt.razor.cs b/MP.Land/Components/CmpGroupFilt.razor.cs new file mode 100644 index 00000000..800f3548 --- /dev/null +++ b/MP.Land/Components/CmpGroupFilt.razor.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Components; +using System.Net.Http; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Components.Authorization; +using Microsoft.AspNetCore.Components.Forms; +using Microsoft.AspNetCore.Components.Routing; +using Microsoft.AspNetCore.Components.Web; +using Microsoft.AspNetCore.Components.Web.Virtualization; +using Microsoft.JSInterop; +using MP.Land; +using MP.Land.Shared; +using MP.AppAuth.Models; +using MP.Land.Data; + +namespace MP.Land.Components +{ + public partial class CmpGroupFilt + { + + [Inject] + protected MessageService AppMService { get; set; } + + [Inject] + protected AppAuthService DataService { get; set; } + + private List ListGroups; + private string groupName + { + get + { + return AppMService.CodGruppo; + } + set + { + AppMService.CodGruppo = value; + } + } + + protected override async Task OnInitializedAsync() + { + await ReloadData(); + } + + private async Task ReloadData() + { + // carico i gruppi + ListGroups = await DataService.AnagGruppiFilt("REPARTO"); + } + } +} \ No newline at end of file diff --git a/MP.Land/Data/AppAuthService.cs b/MP.Land/Data/AppAuthService.cs index 55ac68a1..a5f335c3 100644 --- a/MP.Land/Data/AppAuthService.cs +++ b/MP.Land/Data/AppAuthService.cs @@ -129,6 +129,41 @@ namespace MP.Land.Data #region Public Methods + public async Task> AnagGruppiAll() + { + List dbResult = new List(); + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + dbResult = dbController.AnagGruppiGetAll(); + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Trace($"Effettuata lettura da DB per AnagGruppiAll: {ts.TotalMilliseconds} ms"); + return await Task.FromResult(dbResult); + } + + public async Task> AnagGruppiFilt(string codTipo) + { + List dbResult = new List(); + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + dbResult = dbController.AnagGruppiFilt(codTipo); + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Trace($"Effettuata lettura da DB per AnagGruppiFilt: {ts.TotalMilliseconds} ms"); + return await Task.FromResult(dbResult); + } + public async Task> AnagOperByGroupList(string codGruppo, string searchVal) + { + List dbResult = new List(); + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + dbResult = dbController.AnagOpByGruppoGetAll(codGruppo, searchVal); + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Trace($"Effettuata lettura da DB per AnagOperByGroupList: {ts.TotalMilliseconds} ms"); + return await Task.FromResult(dbResult); + } + public async Task> AnagOperList(string searchVal) { List dbResult = new List(); diff --git a/MP.Land/Data/MessageService.cs b/MP.Land/Data/MessageService.cs index 4f03d7ae..77ad39cc 100644 --- a/MP.Land/Data/MessageService.cs +++ b/MP.Land/Data/MessageService.cs @@ -106,6 +106,21 @@ namespace MP.Land.Data } } + protected string _groupName { get; set; } = ""; + public string CodGruppo + { + get => _groupName; + set + { + if (_groupName != value) + { + _groupName = value; + ReportFilter(); + } + } + } + + #endregion Public Properties #region Private Methods