Refresh versione

This commit is contained in:
Samuele Locatelli
2021-11-25 15:29:28 +01:00
parent ac0c14817c
commit 18ab7e08ea
7 changed files with 81 additions and 65 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<Version>1.0.2111.2514</Version>
<Version>1.0.2111.2515</Version>
<UserSecretsId>95c9f021-52d1-4390-a670-5810b7b777b0</UserSecretsId>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
-1
View File
@@ -1,5 +1,4 @@
@page "/GasStation"
@page "/GasStation/{PlantCode}/{OrderCode}"
@using Blazorise.Components
@using GWMS.UI.Components
+75 -56
View File
@@ -68,33 +68,31 @@ namespace GWMS.UI.Pages
#region Public Properties
public string BarcodeText { get; set; } = "";
[Parameter]
public string OrderCode
{
get
{
return BarcodeText;
return MessageService.SelOrderCode;
}
set
{
BarcodeText = $"{value}";
MessageService.SelOrderCode = $"{value}";
}
}
[Parameter]
public string PlantCode
{
get
{
return _plantCode;
}
set
{
_plantCode = $"{value}";
}
}
//[Parameter]
//public string PlantCode
//{
// get
// {
// return _plantCode;
// }
// set
// {
// _plantCode = $"{value}";
// }
//}
public int SelPlantId
{
@@ -133,9 +131,12 @@ namespace GWMS.UI.Pages
private void forceReset()
{
errorDescription = "";
OrderCode = "";
NavManager.NavigateTo("GasStation");
InvokeAsync(() =>
{
errorDescription = "";
OrderCode = "";
NavManager.NavigateTo("GasStation");
});
}
/// <summary>
@@ -162,62 +163,80 @@ namespace GWMS.UI.Pages
}
}
protected bool isProcessing = false;
protected bool doProcess(string newVal)
{
bool answ = false;
// verifico se sia da processare il NUOVO valore (se != da precedente...)
answ = OrderCode != newVal;
return answ;
}
protected DateTime vetoScan = DateTime.Now;
private async Task LocalReceivedBarcodeText(BarcodeReceivedEventArgs args)
{
// verifico ordine e stazione siano coerenti...
DateTime adesso = DateTime.Now;
// input
string ordCode = args.BarcodeText;
if (!isProcessing)
// non nullo
if (!string.IsNullOrEmpty(ordCode))
{
isProcessing = true;
await InvokeAsync(() =>
// non veto...
if (adesso.Subtract(vetoScan).TotalMinutes > 0)
{
OrderCode = ordCode;
});
var ordine = await DataService.OrderGetByCode(ordCode);
if (ordine != null)
{
if (ordine.DtExecEnd > ordine.DtOrder)
vetoScan = adesso.AddSeconds(4);
if (doProcess(ordCode))
{
errorDescription = "Errore: ordine già completato";
await Task.Run(() =>
await InvokeAsync(() =>
{
Thread.Sleep(3000);
forceReset();
OrderCode = ordCode;
});
}
else if (ordine.PlantId != SelPlantId)
{
errorDescription = "Errore: ordine destinato ad altro impianto";
var ordine = await DataService.OrderGetByCode(ordCode);
if (ordine != null)
{
if (ordine.DtExecEnd > ordine.DtOrder)
{
errorDescription = "Errore: ordine già completato";
await Task.Run(() =>
{
Thread.Sleep(3000);
forceReset();
});
}
else if (ordine.PlantId != SelPlantId)
{
errorDescription = "Errore: ordine destinato ad altro impianto";
await Task.Run(() =>
await Task.Run(() =>
{
Thread.Sleep(3000);
forceReset();
});
}
else
{
// salvo...
MessageService.SelPlantId = $"{SelPlantId}";
MessageService.SelOrderCode = args.BarcodeText;
// rimando a pagina con codice ordine....
NavManager.NavigateTo($"GasStationLoad");
//NavManager.NavigateTo($"GasStationLoad/{SelPlantId}/{args.BarcodeText}");
}
}
else
{
Thread.Sleep(3000);
forceReset();
});
}
else
{
// salvo...
MessageService.SelPlantId = $"{SelPlantId}";
MessageService.SelOrderCode = args.BarcodeText;
// rimando a pagina con codice ordine....
NavManager.NavigateTo($"GasStationLoad");
//NavManager.NavigateTo($"GasStationLoad/{SelPlantId}/{args.BarcodeText}");
errorDescription = "Errore: ordine non trovato";
}
}
}
else
{
errorDescription = "Errore: ordine non trovato";
}
isProcessing = false;
}
// verifico ordine e stazione siano coerenti...
}
private async Task ReloadAllData()
{
isLoading = true;
OrderCode = "";
errorDescription = "";
PlantsList = null;
await GetClaimsData();
+2 -4
View File
@@ -132,7 +132,6 @@ namespace GWMS.UI
string connStringRedis = Configuration.GetConnectionString("Redis");
string redisSrvAddr = connStringRedis.Substring(0, connStringRedis.IndexOf(":"));
#if FALSE
// healthchecks
services.AddHealthChecks()
.AddMySql(connStringDB, "MySql instance")
@@ -156,7 +155,6 @@ namespace GWMS.UI
s.SetHeaderText("GWMS Health Check Status");
})
.AddInMemoryStorage();
#endif
// abilitazione x email management con MailKit
services.AddTransient<IEmailSender, MailKitEmailSender>();
@@ -235,8 +233,8 @@ namespace GWMS.UI
services.AddDatabaseDeveloperPageExceptionFilter();
services.AddSingleton<IConfiguration>(Configuration);
//services.AddSingleton<GWMSDataService>();
services.AddTransient<GWMSDataService>();
//services.AddScoped<GWMSDataService>();
//services.AddTransient<GWMSDataService>();
services.AddScoped<GWMSDataService>();
services.AddScoped<MessageService>();
}
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>GWMS - Gas Warehouse Management System</i>
<h4>Versione: 1.0.2111.2514</h4>
<h4>Versione: 1.0.2111.2515</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
1.0.2111.2514
1.0.2111.2515
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.0.2111.2514</version>
<version>1.0.2111.2515</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>