From 78be4fa481f0c157da783f5b9637cd5d5eb44217 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Thu, 1 Dec 2022 18:09:17 +0100 Subject: [PATCH 1/4] fix pagina acquisizioni con eventi --- MP.INVE/Components/CodeScan.razor | 9 +-- MP.INVE/Components/CodeScan.razor.cs | 24 +++++--- MP.INVE/Components/ProcSuggestion.razor | 68 ++++++++-------------- MP.INVE/Components/ProcSuggestion.razor.cs | 14 +++-- MP.INVE/MP.INVE.csproj | 2 +- MP.INVE/Pages/Acquisizione.razor | 20 ++++++- MP.INVE/Pages/Acquisizione.razor.cs | 8 ++- MP.INVE/Resources/ChangeLog.html | 2 +- MP.INVE/Resources/VersNum.txt | 2 +- MP.INVE/Resources/manifest.xml | 2 +- 10 files changed, 80 insertions(+), 71 deletions(-) diff --git a/MP.INVE/Components/CodeScan.razor b/MP.INVE/Components/CodeScan.razor index 8bb24799..5a1cc5a4 100644 --- a/MP.INVE/Components/CodeScan.razor +++ b/MP.INVE/Components/CodeScan.razor @@ -1,10 +1,3 @@ 
- +
- -@if (rawScan != null) -{ -
- -
-} \ No newline at end of file diff --git a/MP.INVE/Components/CodeScan.razor.cs b/MP.INVE/Components/CodeScan.razor.cs index 4c8b1654..3fbc5fd9 100644 --- a/MP.INVE/Components/CodeScan.razor.cs +++ b/MP.INVE/Components/CodeScan.razor.cs @@ -15,13 +15,15 @@ using MP.INVE; using MP.INVE.Shared; using MP.INVE.Components; using MP.INVE.Data; +using StackExchange.Redis; namespace MP.INVE.Components { public partial class CodeScan { // FIXME TODO creare evento x riportare scansione - + [Parameter] + public EventCallback lastRawScan { get; set; } /// /// Imposta il focus su input scansione /// @@ -33,15 +35,17 @@ namespace MP.INVE.Components private ElementReference target; - protected string lastScan { get; set; } = ""; + //protected string lastScan { get; set; } = ""; public SelectScanParams currParams = new SelectScanParams(); - protected string rawScan - { - get => currParams.UDC; - set => currParams.UDC = value; - } + //protected string rawScan + //{ + // get => currParams.UDC; + // set => currParams.UDC = value; + //} + + protected string LastScan = ""; protected override async Task OnAfterRenderAsync(bool firstRender) { @@ -50,6 +54,12 @@ namespace MP.INVE.Components await target.FocusAsync(); } } + + private async Task saveSel(string lastScan) + { + LastScan = lastScan; + await lastRawScan.InvokeAsync(lastScan); + } } } \ No newline at end of file diff --git a/MP.INVE/Components/ProcSuggestion.razor b/MP.INVE/Components/ProcSuggestion.razor index 1c3820f8..f622bef2 100644 --- a/MP.INVE/Components/ProcSuggestion.razor +++ b/MP.INVE/Components/ProcSuggestion.razor @@ -10,52 +10,30 @@ @if (udc != null) { -
- @* -
- - @udc.UDC - - - @tipo - -
*@ -
-
    -
  • - Lotto: -
    - - @tipo -
    -
  • -
  • - Articolo: -
    - - -
    -
  • -
  • - Quantità: -
    - - -
    -
  • -
-
- -
-
- -
- + } else { diff --git a/MP.INVE/Components/ProcSuggestion.razor.cs b/MP.INVE/Components/ProcSuggestion.razor.cs index 8125c9ea..2d519eb2 100644 --- a/MP.INVE/Components/ProcSuggestion.razor.cs +++ b/MP.INVE/Components/ProcSuggestion.razor.cs @@ -24,13 +24,20 @@ namespace MP.INVE.Components [Inject] private MiDataService MIService { get; set; } = null!; +#if false [Parameter] - public SelectScanParams currParams { get; set; } = null!; + public SelectScanParams currParams { get; set; } = null!; +#endif + [Parameter] + public string lastScan { get; set; } = null!; + +#if false protected string rawScan { get => currParams.UDC; set => currParams.UDC = value; - } + } +#endif private string tipo { get; set; } = ""; public List? searchrecords; @@ -38,10 +45,9 @@ namespace MP.INVE.Components protected override async Task OnParametersSetAsync() { - //await FilterChanged.InvokeAsync(actFilter); await Task.Delay(1); searchrecords = MIService.ElencoUDC(); - udc = searchrecords.Where(x => x.UDC == rawScan).FirstOrDefault(); + udc = searchrecords.Where(x => x.UDC == lastScan).FirstOrDefault(); if (udc != null) { diff --git a/MP.INVE/MP.INVE.csproj b/MP.INVE/MP.INVE.csproj index 2988c20a..1f91448a 100644 --- a/MP.INVE/MP.INVE.csproj +++ b/MP.INVE/MP.INVE.csproj @@ -5,7 +5,7 @@ enable enable MP.INVE - 6.16.2211.2916 + 6.16.2212.118 diff --git a/MP.INVE/Pages/Acquisizione.razor b/MP.INVE/Pages/Acquisizione.razor index 7d5ced7c..4ea01fe8 100644 --- a/MP.INVE/Pages/Acquisizione.razor +++ b/MP.INVE/Pages/Acquisizione.razor @@ -6,5 +6,23 @@

Acquisizione

- +
+
+
+ @*if (rawScan != null) + { + }*@ +
+ +
+
+ +
+
+ +
\ No newline at end of file diff --git a/MP.INVE/Pages/Acquisizione.razor.cs b/MP.INVE/Pages/Acquisizione.razor.cs index b797884c..c50cce10 100644 --- a/MP.INVE/Pages/Acquisizione.razor.cs +++ b/MP.INVE/Pages/Acquisizione.razor.cs @@ -33,12 +33,16 @@ namespace MP.INVE.Pages private SelectScanParams currParams = new SelectScanParams(); private bool logged { get;set; } = false; - + protected string rawScan { get; set; } = null!; protected string idOPeratore { get; set; } = null!; protected string authKey { get; set; } = null!; protected override async Task OnInitializedAsync() { } - protected DateTime? lastScan { get; set; } = null; + protected void saveScan(string newScan) + { + rawScan = newScan; + } + //protected DateTime? lastScan { get; set; } = null; } } \ No newline at end of file diff --git a/MP.INVE/Resources/ChangeLog.html b/MP.INVE/Resources/ChangeLog.html index 33a30497..a6788146 100644 --- a/MP.INVE/Resources/ChangeLog.html +++ b/MP.INVE/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOINVE -

Versione: 6.16.2211.2916

+

Versione: 6.16.2212.118


Note di rilascio:
  • diff --git a/MP.INVE/Resources/VersNum.txt b/MP.INVE/Resources/VersNum.txt index 20db0176..6517f4d1 100644 --- a/MP.INVE/Resources/VersNum.txt +++ b/MP.INVE/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2211.2916 +6.16.2212.118 diff --git a/MP.INVE/Resources/manifest.xml b/MP.INVE/Resources/manifest.xml index a6165706..f4d674a8 100644 --- a/MP.INVE/Resources/manifest.xml +++ b/MP.INVE/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2211.2916 + 6.16.2212.118 https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/MP.INVE.zip https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/ChangeLog.html false From c4a4aad47d792efb4efb2eb5fd1fe925964a0232 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Fri, 2 Dec 2022 10:31:25 +0100 Subject: [PATCH 2/4] fix evento x acquisizione --- MP.INVE/Components/CodeScan.razor | 2 +- MP.INVE/Components/CodeScan.razor.cs | 21 +++++++++++++++------ MP.INVE/MP.INVE.csproj | 2 +- MP.INVE/Resources/ChangeLog.html | 2 +- MP.INVE/Resources/VersNum.txt | 2 +- MP.INVE/Resources/manifest.xml | 2 +- 6 files changed, 20 insertions(+), 11 deletions(-) diff --git a/MP.INVE/Components/CodeScan.razor b/MP.INVE/Components/CodeScan.razor index 5a1cc5a4..d60a1402 100644 --- a/MP.INVE/Components/CodeScan.razor +++ b/MP.INVE/Components/CodeScan.razor @@ -1,3 +1,3 @@ 
    - +
    diff --git a/MP.INVE/Components/CodeScan.razor.cs b/MP.INVE/Components/CodeScan.razor.cs index 3fbc5fd9..d0719ee2 100644 --- a/MP.INVE/Components/CodeScan.razor.cs +++ b/MP.INVE/Components/CodeScan.razor.cs @@ -28,8 +28,8 @@ namespace MP.INVE.Components /// Imposta il focus su input scansione /// protected void setFocus() - { - // all'apertura del componente --> focus su txtbox scan (e anche dopo input) + { + // all'apertura del componente --> focus su txtbox scan (e anche dopo input) } @@ -44,8 +44,17 @@ namespace MP.INVE.Components // get => currParams.UDC; // set => currParams.UDC = value; //} + protected string _lastScan = ""; + protected string LastScan + { + get => _lastScan; + set + { + _lastScan = value; + saveSel(LastScan); + } + } - protected string LastScan = ""; protected override async Task OnAfterRenderAsync(bool firstRender) { @@ -55,10 +64,10 @@ namespace MP.INVE.Components } } - private async Task saveSel(string lastScan) + private void saveSel(string scanToSend) { - LastScan = lastScan; - await lastRawScan.InvokeAsync(lastScan); + //LastScan = scanToSend; + Task.FromResult(lastRawScan.InvokeAsync(scanToSend)); } } diff --git a/MP.INVE/MP.INVE.csproj b/MP.INVE/MP.INVE.csproj index 1f91448a..838900e8 100644 --- a/MP.INVE/MP.INVE.csproj +++ b/MP.INVE/MP.INVE.csproj @@ -5,7 +5,7 @@ enable enable MP.INVE - 6.16.2212.118 + 6.16.2212.210 diff --git a/MP.INVE/Resources/ChangeLog.html b/MP.INVE/Resources/ChangeLog.html index a6788146..d4002107 100644 --- a/MP.INVE/Resources/ChangeLog.html +++ b/MP.INVE/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOINVE -

    Versione: 6.16.2212.118

    +

    Versione: 6.16.2212.210


    Note di rilascio:
    • diff --git a/MP.INVE/Resources/VersNum.txt b/MP.INVE/Resources/VersNum.txt index 6517f4d1..ffaff1cc 100644 --- a/MP.INVE/Resources/VersNum.txt +++ b/MP.INVE/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2212.118 +6.16.2212.210 diff --git a/MP.INVE/Resources/manifest.xml b/MP.INVE/Resources/manifest.xml index f4d674a8..4ee18ea1 100644 --- a/MP.INVE/Resources/manifest.xml +++ b/MP.INVE/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2212.118 + 6.16.2212.210 https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/MP.INVE.zip https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/ChangeLog.html false From a672517b05da80e25a1d88a1d2191385b5f3ece3 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Fri, 2 Dec 2022 12:23:52 +0100 Subject: [PATCH 3/4] bozza gestione expiration time --- MP.Data/DTO/OperatoreDTO.cs | 1 + MP.INVE/Components/CmpTop.razor.cs | 2 +- MP.INVE/Pages/Jumper.razor.cs | 3 +- MP.INVE/Pages/OperatoreLogin.razor | 76 +++++++++++++++------------ MP.INVE/Pages/OperatoreLogin.razor.cs | 6 ++- 5 files changed, 51 insertions(+), 37 deletions(-) diff --git a/MP.Data/DTO/OperatoreDTO.cs b/MP.Data/DTO/OperatoreDTO.cs index eb421c5b..da56411d 100644 --- a/MP.Data/DTO/OperatoreDTO.cs +++ b/MP.Data/DTO/OperatoreDTO.cs @@ -12,5 +12,6 @@ namespace MP.Data.DTO public string Cognome { get; set; } = ""; public string Nome { get; set; } = ""; public string hashAuthKey { get; set; } = ""; + public DateTime dtExp { get; set; } } } diff --git a/MP.INVE/Components/CmpTop.razor.cs b/MP.INVE/Components/CmpTop.razor.cs index 262b05f0..647a3a61 100644 --- a/MP.INVE/Components/CmpTop.razor.cs +++ b/MP.INVE/Components/CmpTop.razor.cs @@ -46,7 +46,7 @@ namespace MP.INVE.Components answ = await localStorage.GetItemAsync("MatrOpr"); if (!NavManager.Uri.Contains("Jumper?")) { - if (answ != null) + if (answ != null && !(answ.dtExp < DateTime.Now)) { userName = $"{answ.Cognome} {answ.Nome} ({answ.MatrOpr})"; if (NavManager.Uri.Contains("OperatoreLogin")) diff --git a/MP.INVE/Pages/Jumper.razor.cs b/MP.INVE/Pages/Jumper.razor.cs index e5ec42ee..7969d480 100644 --- a/MP.INVE/Pages/Jumper.razor.cs +++ b/MP.INVE/Pages/Jumper.razor.cs @@ -62,7 +62,8 @@ namespace MP.INVE.Pages MatrOpr = currOpr.MatrOpr, Nome = currOpr.Nome, Cognome = currOpr.Cognome, - hashAuthKey = hash + hashAuthKey = hash, + dtExp = DateTime.Now.AddMinutes(1) }; await localStorage.SetItemAsync("MatrOpr", currOpr); diff --git a/MP.INVE/Pages/OperatoreLogin.razor b/MP.INVE/Pages/OperatoreLogin.razor index 9d0e9867..15e1aa06 100644 --- a/MP.INVE/Pages/OperatoreLogin.razor +++ b/MP.INVE/Pages/OperatoreLogin.razor @@ -5,50 +5,58 @@
      -
      -
      -

      login Operatore

      -
      -
      -
      -
      -
      - -
      + @if (isLoading) + { + + } + else + { -
      - + @if (elencoOperatori != null) { - + @foreach (var item in elencoOperatori) + { + + } } - } - + +
      +
      -
      -
      -
      -
      -
      - - +
      +
      +
      + + +
      +
      -
      -
      -
      -
      -
      - -
      -
      +
      +
      +
      + +
      +
      +
      -
      + }
      diff --git a/MP.INVE/Pages/OperatoreLogin.razor.cs b/MP.INVE/Pages/OperatoreLogin.razor.cs index bdc5f655..9af22264 100644 --- a/MP.INVE/Pages/OperatoreLogin.razor.cs +++ b/MP.INVE/Pages/OperatoreLogin.razor.cs @@ -48,14 +48,17 @@ namespace MP.INVE.Pages private string _authKey { get; set; } = ""; private bool logged { get; set; } = false; + private bool isLoading { get; set; } = false; private List? elencoOperatori; protected override async Task OnInitializedAsync() { + isLoading = true; //await FilterChanged.InvokeAsync(actFilter); await Task.Delay(1); elencoOperatori = MIDataservice.ElencoOperatori(); + isLoading = false; } private void login() @@ -74,7 +77,8 @@ namespace MP.INVE.Pages MatrOpr = currOpr.MatrOpr, Nome = currOpr.Nome, Cognome = currOpr.Cognome, - hashAuthKey = hash + hashAuthKey = hash, + dtExp = DateTime.Now.AddMinutes(1) }; localStorage.SetItemAsync("MatrOpr", sessionOpr); NavManager.NavigateTo("InveSession", true); From 06ab1433f2d061402ed36ee502b18e8b0eb4c7d9 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Fri, 2 Dec 2022 13:07:22 +0100 Subject: [PATCH 4/4] avanzamento inve acquisizione + metodo get configurazione --- MP.Data/Controllers/MpInveController.cs | 28 ++++++++++++++++++++++ MP.INVE/Components/CmpTop.razor.cs | 4 +++- MP.INVE/Components/ProcSuggestion.razor | 5 ++-- MP.INVE/Components/ProcSuggestion.razor.cs | 13 ---------- MP.INVE/MP.INVE.csproj | 2 +- MP.INVE/Pages/Acquisizione.razor | 9 ++++--- MP.INVE/Resources/ChangeLog.html | 2 +- MP.INVE/Resources/VersNum.txt | 2 +- MP.INVE/Resources/manifest.xml | 2 +- 9 files changed, 43 insertions(+), 24 deletions(-) diff --git a/MP.Data/Controllers/MpInveController.cs b/MP.Data/Controllers/MpInveController.cs index 922bf910..59591e41 100644 --- a/MP.Data/Controllers/MpInveController.cs +++ b/MP.Data/Controllers/MpInveController.cs @@ -28,6 +28,34 @@ namespace MP.Data.Controllers _configuration = null; } + + #region gestione config + + /// + /// Elenco da tabella Config + /// + /// + public List ConfigGetAll() + { + List dbResult = new List(); + using (var dbCtx = new MoonProContext(_configuration)) + { + dbResult = dbCtx + .DbSetConfig + .AsNoTracking() + .OrderBy(x => x.Chiave) + .ToList(); + } + return dbResult; + } + #endregion gestione config + + + + + + + /// /// Elenco Scansioni dato Id sessione inventario /// diff --git a/MP.INVE/Components/CmpTop.razor.cs b/MP.INVE/Components/CmpTop.razor.cs index 647a3a61..3eb00344 100644 --- a/MP.INVE/Components/CmpTop.razor.cs +++ b/MP.INVE/Components/CmpTop.razor.cs @@ -40,13 +40,15 @@ namespace MP.INVE.Components #region Protected Methods + //&& !(answ.dtExp < DateTime.Now) + protected async Task getId() { OperatoreDTO answ = new OperatoreDTO(); answ = await localStorage.GetItemAsync("MatrOpr"); if (!NavManager.Uri.Contains("Jumper?")) { - if (answ != null && !(answ.dtExp < DateTime.Now)) + if (answ != null) { userName = $"{answ.Cognome} {answ.Nome} ({answ.MatrOpr})"; if (NavManager.Uri.Contains("OperatoreLogin")) diff --git a/MP.INVE/Components/ProcSuggestion.razor b/MP.INVE/Components/ProcSuggestion.razor index f622bef2..2c48c865 100644 --- a/MP.INVE/Components/ProcSuggestion.razor +++ b/MP.INVE/Components/ProcSuggestion.razor @@ -10,7 +10,6 @@ @if (udc != null) { -
      • Lotto: @@ -22,14 +21,14 @@
      • Articolo:
        - +
      • Quantità:
        - +
      • diff --git a/MP.INVE/Components/ProcSuggestion.razor.cs b/MP.INVE/Components/ProcSuggestion.razor.cs index 2d519eb2..4085063f 100644 --- a/MP.INVE/Components/ProcSuggestion.razor.cs +++ b/MP.INVE/Components/ProcSuggestion.razor.cs @@ -23,21 +23,8 @@ namespace MP.INVE.Components { [Inject] private MiDataService MIService { get; set; } = null!; - -#if false - [Parameter] - public SelectScanParams currParams { get; set; } = null!; -#endif [Parameter] public string lastScan { get; set; } = null!; - -#if false - protected string rawScan - { - get => currParams.UDC; - set => currParams.UDC = value; - } -#endif private string tipo { get; set; } = ""; public List? searchrecords; diff --git a/MP.INVE/MP.INVE.csproj b/MP.INVE/MP.INVE.csproj index 838900e8..158704a5 100644 --- a/MP.INVE/MP.INVE.csproj +++ b/MP.INVE/MP.INVE.csproj @@ -5,7 +5,7 @@ enable enable MP.INVE - 6.16.2212.210 + 6.16.2212.212 diff --git a/MP.INVE/Pages/Acquisizione.razor b/MP.INVE/Pages/Acquisizione.razor index 4ea01fe8..d93521cf 100644 --- a/MP.INVE/Pages/Acquisizione.razor +++ b/MP.INVE/Pages/Acquisizione.razor @@ -16,9 +16,12 @@
        -
        - -
        + @if (rawScan != null) + { +
        + +
        + }