fix pagina invio sessione
This commit is contained in:
@@ -5,6 +5,7 @@ using MP.Data.DatabaseModels;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Formats.Asn1;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -573,6 +574,7 @@ namespace MP.Data.Controllers
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Inventari tipo Azienda (TUTTI, chiusi e paerti) filtrati x data
|
||||
/// </summary>
|
||||
@@ -615,6 +617,48 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Chiusura/apertura sessione
|
||||
/// </summary>
|
||||
/// <param name="sessID"></param>
|
||||
/// <param name="flgclose"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> CloseOpenSessione(int sessID, bool flgClose)
|
||||
{
|
||||
bool answ = false;
|
||||
using (var dbCtx = new MoonPro_InveContext(_configuration))
|
||||
{
|
||||
var SessID = new SqlParameter("@InveSessID", sessID);
|
||||
var FlgClose = new SqlParameter("@FlgClose", flgClose);
|
||||
|
||||
var callResulr = await dbCtx
|
||||
.Database
|
||||
.ExecuteSqlRawAsync("exec dbo.stp_INV_CloseOpen @InveSessID, @FlgClose", SessID, FlgClose);
|
||||
|
||||
answ = true;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Trasferimento
|
||||
/// </summary>
|
||||
/// <param name="sessID"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> TransferSessione(int sessID)
|
||||
{
|
||||
bool answ = false;
|
||||
using (var dbCtx = new MoonPro_InveContext(_configuration))
|
||||
{
|
||||
var SessID = new SqlParameter("@InveSessID", sessID);
|
||||
|
||||
var callResulr = await dbCtx
|
||||
.Database
|
||||
.ExecuteSqlRawAsync("exec dbo.stp_INV_InveSess_Transfer @InveSessID", SessID);
|
||||
|
||||
answ = true;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
#endregion gestione sessione
|
||||
|
||||
#region gestione totale lotti
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">ID sessione</th>
|
||||
<th scope="col">Magazzino</th>
|
||||
<th scope="col">Descrizione Mag</th>
|
||||
<th scope="col">Lotto</th>
|
||||
<th scope="col">Articolo</th>
|
||||
<th scope="col">Descrizione Art</th>
|
||||
@@ -19,15 +16,6 @@
|
||||
@foreach (var item in elencoTotLotto)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@item.InveSessID
|
||||
</td>
|
||||
<td>
|
||||
@item.CodMag
|
||||
</td>
|
||||
<td>
|
||||
@item.DescMag
|
||||
</td>
|
||||
<td>
|
||||
@item.Lotto
|
||||
</td>
|
||||
@@ -41,7 +29,7 @@
|
||||
@item.NumColli
|
||||
</td>
|
||||
<td>
|
||||
@item.TotLotto
|
||||
@($"{item.TotLotto:N2}")
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
@@ -641,6 +641,31 @@ namespace MP.INVE.Data
|
||||
Log.Debug($"InventSessByID Read from {source}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<bool> CloseOpenSessione(int sessID, bool flgClose)
|
||||
{
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
bool result = false;
|
||||
string source = "DB";
|
||||
result = await dbController.CloseOpenSessione(sessID, flgClose);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"CloseOpenSessione Read from {source}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
public async Task<bool> TransferSessione(int sessID)
|
||||
{
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
bool result = false;
|
||||
string source = "DB";
|
||||
result = await dbController.TransferSessione(sessID);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"TransferSessione Read from {source}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP.INVE</RootNamespace>
|
||||
<Version>6.16.2212.1416</Version>
|
||||
<Version>6.16.2212.1418</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
+38
-20
@@ -13,17 +13,6 @@ else
|
||||
<div class="card-header">
|
||||
<div class="d-flex justify-content-between">
|
||||
<h3>Invio</h3>
|
||||
<div>
|
||||
@if (sessione.DtEnd == null)
|
||||
{
|
||||
<button class="btn btn-sm btn-danger" @onclick="chiudiSessione()">CHIUDI</button>
|
||||
}
|
||||
else if ((sessione.DtEnd != null) && (!sessione.Transferred))
|
||||
{
|
||||
<button class="btn btn-sm btn-danger">RIAPRI</button>
|
||||
<button class="btn btn-sm btn-danger">TRASFERISCI</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@@ -35,6 +24,7 @@ else
|
||||
<th>Magazzino</th>
|
||||
<th>Descrizione Mag</th>
|
||||
<th class="text-center">Durata</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -73,19 +63,47 @@ else
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class="text-center d-flex justify-content-between">
|
||||
<div>
|
||||
<button class="btn btn-sm btn-primary mx-1" @onclick="mostraDati">
|
||||
<i class="fa-regular fa-rectangle-list"></i>
|
||||
</button>
|
||||
@if (sessione.DtEnd == null)
|
||||
{
|
||||
<button class="btn btn-sm btn-danger mx-1" @onclick="()=>chiudiSessione(sessione.InveSessID)"><i class="fa-solid fa-stop"></i></button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="btn btn-sm btn-secondary mx-1" @onclick="()=>chiudiSessione(sessione.InveSessID)" disabled><i class="fa-solid fa-stop"></i></button>
|
||||
}
|
||||
@if ((sessione.DtEnd != null) && (!sessione.Transferred))
|
||||
{
|
||||
<button class="btn btn-sm btn-success mx-1" @onclick="()=>apriSessione(sessione.InveSessID)"><i class="fa-regular fa-circle-play"></i></button>
|
||||
<button class="btn btn-sm btn-warning mx-1" @onclick="()=>trasfSessione(sessione.InveSessID)"><i class="fa-solid fa-file-import"></i></button>
|
||||
}
|
||||
else{
|
||||
<button class="btn btn-sm btn-secondary mx-1" @onclick="()=>apriSessione(sessione.InveSessID)" disabled><i class="fa-regular fa-circle-play"></i></button>
|
||||
<button class="btn btn-sm btn-secondary mx-1" @onclick="()=>trasfSessione(sessione.InveSessID)" disabled><i class="fa-solid fa-file-import"></i></button>
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="text-center">
|
||||
<div>
|
||||
<div class="img-fluid" id="qrCodeImg_101"></div>
|
||||
</div>
|
||||
</div>
|
||||
@if (sessID != 0)
|
||||
@if ((sessione.DtEnd == null) && (!sessione.Transferred))
|
||||
{
|
||||
<ListTotLotto SessionID="@sessID" currParams="@invioParams" isLoading="@isLoading"></ListTotLotto>
|
||||
<div class="text-center">
|
||||
<div>
|
||||
<div class="img-fluid" id="qrCodeImg_101"></div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (mostra)
|
||||
{
|
||||
@if (sessID != 0)
|
||||
{
|
||||
<ListTotLotto SessionID="@sessID" currParams="@invioParams" isLoading="@isLoading"></ListTotLotto>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -84,7 +84,37 @@ namespace MP.INVE.Pages
|
||||
{
|
||||
currPage = newNum;
|
||||
}
|
||||
protected bool mostra = false;
|
||||
|
||||
protected void mostraDati()
|
||||
{
|
||||
mostra = true;
|
||||
}
|
||||
protected async void chiudiSessione(int sessID)
|
||||
{
|
||||
var closed = await MIService.CloseOpenSessione(sessID, true);
|
||||
if (closed)
|
||||
{
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
}
|
||||
|
||||
protected async void apriSessione(int sessID)
|
||||
{
|
||||
var open = await MIService.CloseOpenSessione(sessID, false);
|
||||
if (open)
|
||||
{
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
}
|
||||
protected async void trasfSessione(int sessID)
|
||||
{
|
||||
var trasf = await MIService.TransferSessione(sessID);
|
||||
if (trasf)
|
||||
{
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
}
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
|
||||
@@ -94,7 +124,7 @@ namespace MP.INVE.Pages
|
||||
sessID = int.Parse(_inveSessionId);
|
||||
codMag = int.Parse(_idMag);
|
||||
}
|
||||
|
||||
|
||||
await reloadData();
|
||||
|
||||
}
|
||||
@@ -102,8 +132,14 @@ namespace MP.INVE.Pages
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{101}");
|
||||
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{101}", rawCode);
|
||||
if (sessione != null)
|
||||
{
|
||||
if ((sessione.DtEnd == null) && (!sessione.Transferred))
|
||||
{
|
||||
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{101}");
|
||||
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{101}", rawCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +167,7 @@ namespace MP.INVE.Pages
|
||||
|
||||
private async Task reloadData()
|
||||
{
|
||||
|
||||
|
||||
sessione = null;
|
||||
isLoading = true;
|
||||
sessione = MIService.InventSessByID(sessID);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOINVE </i>
|
||||
<h4>Versione: 6.16.2212.1416</h4>
|
||||
<h4>Versione: 6.16.2212.1418</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2212.1416
|
||||
6.16.2212.1418
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2212.1416</version>
|
||||
<version>6.16.2212.1418</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/MP.INVE.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user