diff --git a/GWMS.UI/GWMS.UI.csproj b/GWMS.UI/GWMS.UI.csproj index a368d47..48108a1 100644 --- a/GWMS.UI/GWMS.UI.csproj +++ b/GWMS.UI/GWMS.UI.csproj @@ -2,7 +2,7 @@ net5.0 - 1.0.2111.2515 + 1.0.2111.2516 95c9f021-52d1-4390-a670-5810b7b777b0 true true @@ -38,7 +38,7 @@ - + @@ -54,6 +54,7 @@ + diff --git a/GWMS.UI/Pages/CodeProcess.razor b/GWMS.UI/Pages/CodeProcess.razor new file mode 100644 index 0000000..fc5f647 --- /dev/null +++ b/GWMS.UI/Pages/CodeProcess.razor @@ -0,0 +1,17 @@ +@page "/CodeProcess" +@page "/CodeProcess/{CurrCode}" + +@using GWMS.UI.Data + +@inject MessageService AMServ + +

CodeProcess

+ +@CurrCode + +@code { + + [Parameter] + public string CurrCode { get; set; } = ""; + +} diff --git a/GWMS.UI/Pages/GasStation.razor b/GWMS.UI/Pages/GasStation.razor index 39710ea..35dc4c5 100644 --- a/GWMS.UI/Pages/GasStation.razor +++ b/GWMS.UI/Pages/GasStation.razor @@ -2,7 +2,8 @@ @using Blazorise.Components @using GWMS.UI.Components -@using BlazorBarcodeScanner.ZXing.JS +@*@using BlazorBarcodeScanner.ZXing.JS*@ +@using ZXingBlazor.Components
@@ -66,14 +67,24 @@ { @if (string.IsNullOrEmpty(OrderCode)) { - + @**@ + + /* ((e) => { BarCode = e; ShowScanBarcode = !ShowScanBarcode; }) */ + + } else { diff --git a/GWMS.UI/Pages/GasStation.razor.cs b/GWMS.UI/Pages/GasStation.razor.cs index 481483c..c94dd61 100644 --- a/GWMS.UI/Pages/GasStation.razor.cs +++ b/GWMS.UI/Pages/GasStation.razor.cs @@ -186,57 +186,87 @@ namespace GWMS.UI.Pages if (adesso.Subtract(vetoScan).TotalMinutes > 0) { vetoScan = adesso.AddSeconds(4); - if (doProcess(ordCode)) + //NavManager.NavigateTo($"CodeProcess/{ordCode}"); + OrderCode = ordCode; + var result = ProcessBarcode(ordCode); + } + } + } + + //[Parameter] + //public EventCallback ScanDone { get; set; } + + protected void ScanDoneHandler(string value) + { + DateTime adesso = DateTime.Now; + // non nullo + if (!string.IsNullOrEmpty(value)) + { + // non veto... + if (adesso.Subtract(vetoScan).TotalMinutes > 0) + { + vetoScan = adesso.AddSeconds(4); + //NavManager.NavigateTo($"CodeProcess/{value}"); + OrderCode = value; + var result = ProcessBarcode(value); + } + } + } + + private bool ShowScanBarcode { get; set; } = false; + + public string? BarCode { get; set; } + + private async Task ProcessBarcode(string Barcode) + { + if (doProcess(Barcode)) + { + await InvokeAsync(() => + { + OrderCode = Barcode; + }); + var ordine = await DataService.OrderGetByCode(Barcode); + if (ordine != null) + { + if (ordine.DtExecEnd > ordine.DtOrder) { await InvokeAsync(() => { - OrderCode = ordCode; + errorDescription = "Errore: ordine già completato"; }); - var ordine = await DataService.OrderGetByCode(ordCode); - if (ordine != null) + await Task.Run(() => { - if (ordine.DtExecEnd > ordine.DtOrder) - { - await InvokeAsync(() => - { - errorDescription = "Errore: ordine già completato"; - }); - await Task.Run(() => - { - Thread.Sleep(3000); - forceReset(); - }); - } - else if (ordine.PlantId != SelPlantId) - { - await InvokeAsync(() => - { - errorDescription = "Errore: ordine destinato ad altro impianto"; - }); + Thread.Sleep(3000); + forceReset(); + }); + } + else if (ordine.PlantId != SelPlantId) + { + await InvokeAsync(() => + { + errorDescription = "Errore: ordine destinato ad altro impianto"; + }); - await Task.Run(() => - { - Thread.Sleep(3000); - forceReset(); - }); - } - else - { - // salvo... - MessageService.SelPlantId = $"{SelPlantId}"; - MessageService.SelOrderCode = args.BarcodeText; - // rimando a pagina load.... - NavManager.NavigateTo($"GasStationLoad"); - } - } - else + await Task.Run(() => { - errorDescription = "Errore: ordine non trovato"; - } + Thread.Sleep(3000); + forceReset(); + }); + } + else + { + // salvo... + MessageService.SelPlantId = $"{SelPlantId}"; + MessageService.SelOrderCode = Barcode; + // rimando a pagina load.... + NavManager.NavigateTo($"GasStationLoad"); } } + else + { + errorDescription = "Errore: ordine non trovato"; + } } - // verifico ordine e stazione siano coerenti... } private async Task ReloadAllData() diff --git a/GWMS.UI/Pages/_Host.cshtml b/GWMS.UI/Pages/_Host.cshtml index 95a653d..97b305b 100644 --- a/GWMS.UI/Pages/_Host.cshtml +++ b/GWMS.UI/Pages/_Host.cshtml @@ -59,8 +59,11 @@ - - + @* + *@ + + + diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index 41b3343..a4c6665 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ GWMS - Gas Warehouse Management System -

Versione: 1.0.2111.2515

+

Versione: 1.0.2111.2516


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index 4f19d33..101f1ff 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -1.0.2111.2515 +1.0.2111.2516 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index f9a114e..8201523 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.0.2111.2515 + 1.0.2111.2516 http://nexus.steamware.net/repository/SWS/GWMS/stable/0/GWMS.UI.zip http://nexus.steamware.net/repository/SWS/GWMS/stable/0/ChangeLog.html false