From 91e29d0be1ea933aeb775da669e64a1c8d1eeed0 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 18 May 2021 18:15:35 +0200 Subject: [PATCH] Aggancio filtro x keyrichiesta --- MP.Stats/Components/SelectionFilter.razor | 118 ++---------------- MP.Stats/Components/SelectionFilter.razor.cs | 121 +++++++++++++++++++ 2 files changed, 130 insertions(+), 109 deletions(-) create mode 100644 MP.Stats/Components/SelectionFilter.razor.cs diff --git a/MP.Stats/Components/SelectionFilter.razor b/MP.Stats/Components/SelectionFilter.razor index d88bd68b..8d277f2b 100644 --- a/MP.Stats/Components/SelectionFilter.razor +++ b/MP.Stats/Components/SelectionFilter.razor @@ -1,33 +1,30 @@ -@using MP.Stats.Components -@using MP.Stats.Data - - +
-
+
-
+
-
+
-
+
- - + +
-
+
@@ -35,101 +32,4 @@
- - -@code { - - protected DateTime DateStart - { - get - { - return SelFilter.DateStart; - } - set - { - bool doReport = (!SelFilter.DateStart.Equals(value)); - SelFilter.DateStart = value; - if (doReport) - { - reportChange(); - } - } - } - protected DateTime DateEnd - { - get - { - return SelFilter.DateEnd; - } - set - { - bool doReport = (!SelFilter.DateEnd.Equals(value)); - SelFilter.DateEnd = value; - if (doReport) - { - reportChange(); - } - } - } - - protected string IdxMacchina - { - get - { - return SelFilter.IdxMacchina; - } - set - { - bool doReport = (!SelFilter.IdxMacchina.Equals(value)); - SelFilter.IdxMacchina = value; - if (doReport) - { - reportChange(); - } - } - } - protected int IdxODL - { - get - { - return SelFilter.IdxOdl; - } - set - { - bool doReport = (!SelFilter.IdxOdl.Equals(value)); - SelFilter.IdxOdl = value; - if (doReport) - { - reportChange(); - } - } - } - - protected string CodArticolo - { - get - { - return SelFilter.CodArticolo; - } - set - { - bool doReport = (!SelFilter.CodArticolo.Equals(value)); - SelFilter.CodArticolo = value; - if (doReport) - { - reportChange(); - } - } - } - - [Parameter] - public SelectData SelFilter { get; set; } - - [Parameter] - public EventCallback filterChanged { get; set; } - - private void reportChange() - { - filterChanged.InvokeAsync(SelFilter); - } -} \ No newline at end of file + \ No newline at end of file diff --git a/MP.Stats/Components/SelectionFilter.razor.cs b/MP.Stats/Components/SelectionFilter.razor.cs new file mode 100644 index 00000000..b9b00a3e --- /dev/null +++ b/MP.Stats/Components/SelectionFilter.razor.cs @@ -0,0 +1,121 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Components; +using MP.Stats.Components; +using MP.Stats.Data; + +namespace MP.Stats.Components +{ + public partial class SelectionFilter + { + #region Protected Properties + + protected string CodArticolo + { + get + { + return SelFilter.CodArticolo; + } + set + { + bool doReport = (!SelFilter.CodArticolo.Equals(value)); + SelFilter.CodArticolo = value; + if (doReport) + { + reportChange(); + } + } + } + + protected DateTime DateEnd + { + get + { + return SelFilter.DateEnd; + } + set + { + bool doReport = (!SelFilter.DateEnd.Equals(value)); + SelFilter.DateEnd = value; + if (doReport) + { + reportChange(); + } + } + } + + protected DateTime DateStart + { + get + { + return SelFilter.DateStart; + } + set + { + bool doReport = (!SelFilter.DateStart.Equals(value)); + SelFilter.DateStart = value; + if (doReport) + { + reportChange(); + } + } + } + + protected string IdxMacchina + { + get + { + return SelFilter.IdxMacchina; + } + set + { + bool doReport = (!SelFilter.IdxMacchina.Equals(value)); + SelFilter.IdxMacchina = value; + if (doReport) + { + reportChange(); + } + } + } + + protected string KeyRichiesta + { + get + { + return SelFilter.KeyRichiesta; + } + set + { + bool doReport = (!SelFilter.KeyRichiesta.Equals(value)); + SelFilter.KeyRichiesta = value; + if (doReport) + { + reportChange(); + } + } + } + + #endregion Protected Properties + + #region Public Properties + + [Parameter] + public EventCallback filterChanged { get; set; } + + [Parameter] + public SelectData SelFilter { get; set; } + + #endregion Public Properties + + #region Private Methods + + private void reportChange() + { + filterChanged.InvokeAsync(SelFilter); + } + + #endregion Private Methods + } +} \ No newline at end of file