Merge branch 'Release/UpdateSearchMag'
This commit is contained in:
@@ -127,8 +127,10 @@ namespace MP.Data.Controllers
|
||||
/// <summary>
|
||||
/// Elenco Scansioni Totali
|
||||
/// </summary>
|
||||
/// <param name="Udc"></param>
|
||||
/// <param name="InveSessId"></param>
|
||||
/// <returns></returns>
|
||||
public ScanDataModel ScanByUdcSession(string udc, int InveSessId)
|
||||
public ScanDataModel ScanByUdcSession(string Udc, int InveSessId)
|
||||
{
|
||||
ScanDataModel dbResult = new ScanDataModel();
|
||||
using (var dbCtx = new MoonPro_InveContext(_configuration))
|
||||
@@ -137,7 +139,7 @@ namespace MP.Data.Controllers
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbScanData
|
||||
.Where(x => (x.ScanValue == udc) && (x.InveSessID == InveSessId))
|
||||
.Where(x => (x.ScanValue == Udc) && (x.InveSessID == InveSessId))
|
||||
.AsNoTracking()
|
||||
.OrderByDescending(x => x.DtScan)
|
||||
.FirstOrDefault();
|
||||
@@ -146,7 +148,7 @@ namespace MP.Data.Controllers
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbScanData
|
||||
.Where(x => (x.ScanValue == udc))
|
||||
.Where(x => (x.ScanValue == Udc))
|
||||
.AsNoTracking()
|
||||
.OrderByDescending(x => x.DtScan)
|
||||
.FirstOrDefault();
|
||||
@@ -154,6 +156,39 @@ namespace MP.Data.Controllers
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Scansioni dato lotto e sessione
|
||||
/// </summary>
|
||||
/// <param name="Lotto"></param>
|
||||
/// <param name="InveSessId"></param>
|
||||
/// <returns></returns>
|
||||
public List<ScanDataModel> ScanByLottoSession(string Lotto, int InveSessId)
|
||||
{
|
||||
List<ScanDataModel> dbResult = new List<ScanDataModel>();
|
||||
using (var dbCtx = new MoonPro_InveContext(_configuration))
|
||||
{
|
||||
if (InveSessId != 0)
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbScanData
|
||||
.Where(x => (x.Lotto == Lotto) && (x.InveSessID == InveSessId))
|
||||
.AsNoTracking()
|
||||
.OrderByDescending(x => x.DtScan)
|
||||
.ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbScanData
|
||||
.Where(x => (x.Lotto == Lotto))
|
||||
.AsNoTracking()
|
||||
.OrderByDescending(x => x.DtScan)
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
/// <summary>
|
||||
/// Elenco Scansioni per valore, operatore e sessione
|
||||
/// </summary>
|
||||
@@ -339,7 +374,7 @@ namespace MP.Data.Controllers
|
||||
/// Elenco Magazzini
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<AnagMagModel> ElencoMagazzini()
|
||||
public List<AnagMagModel> MagazziniList()
|
||||
{
|
||||
List<AnagMagModel> dbResult = new List<AnagMagModel>();
|
||||
using (var dbCtx = new MoonPro_InveContext(_configuration))
|
||||
@@ -443,7 +478,7 @@ namespace MP.Data.Controllers
|
||||
|
||||
#region gestione UDC
|
||||
/// <summary>
|
||||
/// elenco udc
|
||||
/// elenco Udc
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<AnagUdcModel> ElencoUdc()
|
||||
@@ -461,7 +496,7 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
/// <summary>
|
||||
/// check udc
|
||||
/// check Udc
|
||||
/// </summary>
|
||||
/// <param name="Udc"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
@@ -19,10 +19,9 @@ namespace MP.INVE.Components
|
||||
// rimando a pagina corrente
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
|
||||
public async Task LogOut()
|
||||
{
|
||||
await localStorage.ClearAsync();
|
||||
await MsgService.clearLocalStorageAsync();
|
||||
// rimando a pagina login
|
||||
NavManager.NavigateTo("OperatoreLogin", true);
|
||||
}
|
||||
@@ -33,8 +32,11 @@ namespace MP.INVE.Components
|
||||
|
||||
[Inject]
|
||||
protected IJSRuntime JSRuntime { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected MiDataService MIDataService { get; set; } = null!;
|
||||
[Inject]
|
||||
protected MessageService MsgService { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
@@ -44,16 +46,19 @@ namespace MP.INVE.Components
|
||||
|
||||
protected async Task getId()
|
||||
{
|
||||
#if false
|
||||
OperatoreDTO answ = new OperatoreDTO();
|
||||
answ = await localStorage.GetItemAsync<OperatoreDTO>("MatrOpr");
|
||||
#endif
|
||||
OperatoreDTO answ = await MsgService.getCurrOperDtoAsync();
|
||||
if (!NavManager.Uri.Contains("Jumper?"))
|
||||
{
|
||||
if (answ != null)
|
||||
if (answ.MatrOpr != 0)
|
||||
{
|
||||
userName = $"{answ.Cognome} {answ.Nome} ({answ.MatrOpr})";
|
||||
if (NavManager.Uri.Contains("OperatoreLogin"))
|
||||
{
|
||||
NavManager.NavigateTo("Starter", true);
|
||||
NavManager.NavigateTo("ElencoMagazzini", true);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -72,10 +77,6 @@ namespace MP.INVE.Components
|
||||
await getId();
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
await getId();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
@@ -89,10 +90,14 @@ namespace MP.INVE.Components
|
||||
|
||||
[Inject]
|
||||
private NavigationManager NavManager { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
private ISessionStorageService sessionStorage { get; set; } = null!;
|
||||
|
||||
#if false
|
||||
[Inject]
|
||||
private ILocalStorageService localStorage { get; set; } = null!;
|
||||
#endif
|
||||
|
||||
#endregion Private Properties
|
||||
}
|
||||
|
||||
@@ -70,10 +70,7 @@
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
@if (inCorso)
|
||||
{
|
||||
<th scope="col">QR</th>
|
||||
}
|
||||
<th>Apri</th>
|
||||
<th scope="col">ID sessione</th>
|
||||
<th scope="col">Magazzino</th>
|
||||
<th scope="col">Operatore</th>
|
||||
|
||||
@@ -1,27 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System.Net.Http;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Forms;
|
||||
using Microsoft.AspNetCore.Components.Routing;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.AspNetCore.Components.Web.Virtualization;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.INVE;
|
||||
using MP.INVE.Shared;
|
||||
using MP.INVE.Components;
|
||||
using MP.INVE.Data;
|
||||
using MP.Data.DatabaseModels;
|
||||
using Blazored.LocalStorage;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.INVE.Data;
|
||||
|
||||
namespace MP.INVE.Components
|
||||
{
|
||||
public partial class InveSessionList : IDisposable
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public string currIdMag { get; set; }
|
||||
|
||||
public int currIdSess { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public SelectInveSessionParams currParams { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public bool isLoading { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
@@ -31,8 +32,128 @@ namespace MP.INVE.Components
|
||||
SearchRecords = null;
|
||||
GC.Collect();
|
||||
}
|
||||
private int magazzino { get; set; } = 0;
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected string BaseUrlTab { get => $"{Configuration["ServerConf:BaseUrlJumper"]}"; }
|
||||
|
||||
[Inject]
|
||||
protected IJSRuntime JSRuntime { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected ILocalStorageService localStorage { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected NavigationManager NavManager { get; set; } = null!;
|
||||
|
||||
protected string rawCode
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
answ = $"{BaseUrlTab}IdSessione={currIdSess}&IdMag={currIdMag}&MatrOpr={idOperatore}&UserAuthKey={authKey}";
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected async Task getCurrSess(int idSess, string idMag)
|
||||
{
|
||||
currIdSess = idSess;
|
||||
currIdMag = idMag;
|
||||
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{101}");
|
||||
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{101}", rawCode);
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await reloadData();
|
||||
await popola();
|
||||
}
|
||||
|
||||
protected async Task popola()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
if (reqNew)
|
||||
{
|
||||
elencoOperatori = MIDataservice.ElencoOperatori();
|
||||
ElencoMagazzini = MIDataservice.MagazziniList();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private List<AnagMagModel>? ElencoMagazzini;
|
||||
private List<AnagOperatoriModel>? elencoOperatori;
|
||||
private List<InventorySessionModel>? elencoSessioni;
|
||||
private List<InventorySessionModel>? SearchRecords;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private string authKey
|
||||
{
|
||||
get => currParams.authKey;
|
||||
set => currParams.authKey = value;
|
||||
}
|
||||
private string searchVal
|
||||
{
|
||||
get => currParams.searchVal;
|
||||
set => currParams.searchVal = value;
|
||||
}
|
||||
|
||||
[Inject]
|
||||
private IConfiguration Configuration { get; set; } = null!;
|
||||
|
||||
private int currPage
|
||||
{
|
||||
get => currParams.CurrPage;
|
||||
set
|
||||
{
|
||||
currParams.CurrPage = value;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private string desc { get; set; } = "";
|
||||
private DateTime dtEnd { get; set; } = DateTime.Now;
|
||||
private DateTime dtStart { get; set; } = DateTime.Now.AddMonths(-1);
|
||||
|
||||
private string idOperatore
|
||||
{
|
||||
get => currParams.idOperatore;
|
||||
set => currParams.idOperatore = value;
|
||||
}
|
||||
|
||||
private bool inCorso
|
||||
{
|
||||
get => currParams.inCorso;
|
||||
set => currParams.inCorso = value;
|
||||
}
|
||||
|
||||
private int magazzino { get; set; } = 0;
|
||||
|
||||
[Inject]
|
||||
private MiDataService MIDataservice { get; set; } = null!;
|
||||
|
||||
private int numRecord
|
||||
{
|
||||
get => currParams.NumRec;
|
||||
set
|
||||
{
|
||||
currParams.NumRec = value;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private bool reqNew
|
||||
{
|
||||
get => currParams.reqNew;
|
||||
@@ -44,40 +165,10 @@ namespace MP.INVE.Components
|
||||
get => currParams.TotCount;
|
||||
set => currParams.TotCount = value;
|
||||
}
|
||||
private int numRecord
|
||||
{
|
||||
get => currParams.NumRec;
|
||||
set
|
||||
{
|
||||
currParams.NumRec = value;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
private int currPage
|
||||
{
|
||||
get => currParams.CurrPage;
|
||||
set
|
||||
{
|
||||
currParams.CurrPage = value;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
private string idOperatore
|
||||
{
|
||||
get => currParams.idOperatore;
|
||||
set => currParams.idOperatore = value;
|
||||
}
|
||||
private string authKey
|
||||
{
|
||||
get => currParams.authKey;
|
||||
set => currParams.authKey = value;
|
||||
}
|
||||
private bool inCorso
|
||||
{
|
||||
get => currParams.inCorso;
|
||||
set => currParams.inCorso = value;
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void closeNew()
|
||||
{
|
||||
@@ -86,38 +177,16 @@ namespace MP.INVE.Components
|
||||
ElencoMagazzini = new List<AnagMagModel>();
|
||||
}
|
||||
|
||||
private DateTime dtStart { get; set; } = DateTime.Now.AddMonths(-1);
|
||||
private DateTime dtEnd { get; set; } = DateTime.Now;
|
||||
|
||||
protected string BaseUrlTab { get => $"{Configuration["ServerConf:BaseUrlJumper"]}"; }
|
||||
|
||||
|
||||
protected string rawCode
|
||||
private async Task deleteSession(InventorySessionModel session)
|
||||
{
|
||||
get
|
||||
var alert = await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler creare una nuova sessione per il magazzino selezionato?");
|
||||
if (alert)
|
||||
{
|
||||
string answ = "";
|
||||
answ = $"{BaseUrlTab}IdSessione={currIdSess}&IdMag={currIdMag}&MatrOpr={idOperatore}&UserAuthKey={authKey}";
|
||||
return answ;
|
||||
await MIDataservice.deleteSessione(session);
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
await reloadData();
|
||||
}
|
||||
}
|
||||
protected async Task popola()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
if (reqNew)
|
||||
{
|
||||
elencoOperatori = MIDataservice.ElencoOperatori();
|
||||
ElencoMagazzini = MIDataservice.ElencoMagazzini();
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task getCurrSess(int idSess, string idMag)
|
||||
{
|
||||
currIdSess = idSess;
|
||||
currIdMag = idMag;
|
||||
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{101}");
|
||||
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{101}", rawCode);
|
||||
}
|
||||
|
||||
private async Task insertNewSession()
|
||||
{
|
||||
@@ -144,22 +213,7 @@ namespace MP.INVE.Components
|
||||
closeNew();
|
||||
}
|
||||
}
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await reloadData();
|
||||
await popola();
|
||||
}
|
||||
|
||||
private async Task deleteSession(InventorySessionModel session)
|
||||
{
|
||||
var alert = await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler creare una nuova sessione per il magazzino selezionato?");
|
||||
if (alert)
|
||||
{
|
||||
await MIDataservice.deleteSessione(session);
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
await reloadData();
|
||||
}
|
||||
}
|
||||
private async Task reloadData()
|
||||
{
|
||||
elencoSessioni = null;
|
||||
@@ -172,6 +226,12 @@ namespace MP.INVE.Components
|
||||
{
|
||||
SearchRecords = MIDataservice.InventSessHistList();
|
||||
}
|
||||
//verifico filtro ricerca mag
|
||||
if (!string.IsNullOrEmpty(searchVal))
|
||||
{
|
||||
StringComparison strComp = StringComparison.CurrentCultureIgnoreCase;
|
||||
SearchRecords = SearchRecords.Where(x => x.AnagMagNav.DescMag.Contains(searchVal, strComp) || x.Description.Contains(searchVal, strComp)).ToList();
|
||||
}
|
||||
totalCount = SearchRecords.Count;
|
||||
elencoSessioni = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
await Task.Delay(1);
|
||||
@@ -180,29 +240,6 @@ namespace MP.INVE.Components
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public SelectInveSessionParams currParams { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public bool isLoading { get; set; }
|
||||
|
||||
public int currIdSess { get; set; }
|
||||
public string currIdMag { get; set; }
|
||||
|
||||
[Inject]
|
||||
private MiDataService MIDataservice { get; set; } = null!;
|
||||
[Inject]
|
||||
private IConfiguration Configuration { get; set; } = null!;
|
||||
[Inject]
|
||||
protected ILocalStorageService localStorage { get; set; } = null!;
|
||||
[Inject]
|
||||
protected NavigationManager NavManager { get; set; } = null!;
|
||||
[Inject]
|
||||
protected IJSRuntime JSRuntime { get; set; } = null!;
|
||||
|
||||
private List<InventorySessionModel>? elencoSessioni;
|
||||
private List<InventorySessionModel>? SearchRecords;
|
||||
private List<AnagOperatoriModel>? elencoOperatori;
|
||||
private List<AnagMagModel>? ElencoMagazzini;
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System.Net.Http;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Forms;
|
||||
using Microsoft.AspNetCore.Components.Routing;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.AspNetCore.Components.Web.Virtualization;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.INVE;
|
||||
using MP.INVE.Shared;
|
||||
using MP.INVE.Components;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.INVE.Data;
|
||||
|
||||
@@ -21,26 +7,51 @@ namespace MP.INVE.Components
|
||||
{
|
||||
public partial class ListScan
|
||||
{
|
||||
[Inject]
|
||||
MiDataService MIService { get; set; } = null!;
|
||||
[Inject]
|
||||
IJSRuntime JSRuntime { get; set; } = null!;
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public string lastScan { get; set; } = "";
|
||||
[Parameter]
|
||||
public string userScan { get; set; } = null!;
|
||||
[Parameter]
|
||||
public int sessID { get; set; } = 0;
|
||||
|
||||
[Parameter]
|
||||
public string magID { get; set; } = "";
|
||||
|
||||
[Parameter]
|
||||
public int sessID { get; set; } = 0;
|
||||
|
||||
[Parameter]
|
||||
public string userScan { get; set; } = null!;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected string rawScan { get; set; } = null!;
|
||||
|
||||
List<ScanDataModel>? elencoSCAN;
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private List<ScanDataModel>? elencoSCAN;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
[Inject]
|
||||
private IJSRuntime JSRuntime { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
private MiDataService MIService { get; set; } = null!;
|
||||
|
||||
#endregion Private Properties
|
||||
}
|
||||
}
|
||||
@@ -1,38 +1,55 @@
|
||||
<h3>Totale lotti</h3>
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Lotto</th>
|
||||
<th scope="col">Articolo</th>
|
||||
<th scope="col">Descrizione Art</th>
|
||||
<th scope="col">Tot colli</th>
|
||||
<th scope="col">Tot lotto</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (elencoTotLotto != null)
|
||||
{
|
||||
@foreach (var item in elencoTotLotto)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="@mainCss">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>
|
||||
@item.Lotto
|
||||
</td>
|
||||
<td>
|
||||
@item.CodArticolo
|
||||
</td>
|
||||
<td class="small textCondensed">
|
||||
@item.DescrArt
|
||||
</td>
|
||||
<td>
|
||||
@item.NumColli
|
||||
</td>
|
||||
<td>
|
||||
@($"{item.TotLotto:N2}")
|
||||
</td>
|
||||
<th>
|
||||
@if (currRecord != null)
|
||||
{
|
||||
<button @onclick="() => resetSel()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>
|
||||
}
|
||||
</th>
|
||||
<th scope="col">Lotto</th>
|
||||
<th scope="col">Cod.Art.</th>
|
||||
<th scope="col">Descrizione Articolo</th>
|
||||
<th scope="col" class="text-end"># Colli</th>
|
||||
<th scope="col" class="text-end">Qty Tot</th>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (elencoTotLotto != null)
|
||||
{
|
||||
@foreach (var item in elencoTotLotto)
|
||||
{
|
||||
<tr class="@checkSelect(item)">
|
||||
<td>
|
||||
<button class="btn btn-primary btn-sm" @onclick="() => selRecord(item)"><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||
</td>
|
||||
<td>
|
||||
@item.Lotto
|
||||
</td>
|
||||
<td>
|
||||
@item.CodArticolo
|
||||
</td>
|
||||
<td class="small textCondensed">
|
||||
@item.DescrArt
|
||||
</td>
|
||||
<td class="text-end">
|
||||
@item.NumColli
|
||||
</td>
|
||||
<td class="text-end">
|
||||
@($"{item.TotLotto:N2}")
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@if (currRecord != null)
|
||||
{
|
||||
<div class="col-3">
|
||||
<LotScanDetail LottoSel="@currRecord.Lotto" InveSessID="@currRecord.InveSessID" CodArtSel="@currRecord.CodArticolo"></LotScanDetail>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -1,19 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System.Net.Http;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Forms;
|
||||
using Microsoft.AspNetCore.Components.Routing;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.AspNetCore.Components.Web.Virtualization;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.INVE;
|
||||
using MP.INVE.Shared;
|
||||
using MP.INVE.Components;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.INVE.Data;
|
||||
|
||||
@@ -21,35 +6,72 @@ namespace MP.INVE.Components
|
||||
{
|
||||
public partial class ListTotLotto
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public SelectInvioParams currParams { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public bool isLoading { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public string searchVal { get; set; } = "";
|
||||
|
||||
[Parameter]
|
||||
public int SessionID { get; set; } = 0;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<int> updateRecordCount { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
elencoTotLotto = null;
|
||||
SearchRecords = null;
|
||||
GC.Collect();
|
||||
}
|
||||
[Parameter]
|
||||
public int SessionID { get; set; } = 0;
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected List<InveSessTotLotModel>? elencoTotLotto;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
[Inject]
|
||||
protected MiDataService MIService { get; set; } = null!;
|
||||
private int totalCount
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
get => currParams.TotCount;
|
||||
set
|
||||
await Task.Delay(1);
|
||||
if (SessionID != 0)
|
||||
{
|
||||
currParams.TotCount = value;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
private int numRecord
|
||||
{
|
||||
get => currParams.NumRec;
|
||||
set
|
||||
{
|
||||
currParams.NumRec = value;
|
||||
StateHasChanged();
|
||||
await reloadData();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private List<InveSessTotLotModel>? SearchRecords;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private int _totalCount { get; set; } = 0;
|
||||
|
||||
private int currPage
|
||||
{
|
||||
get => currParams.CurrPage;
|
||||
@@ -60,20 +82,79 @@ namespace MP.INVE.Components
|
||||
}
|
||||
}
|
||||
|
||||
protected async override Task OnParametersSetAsync()
|
||||
private int numRecord
|
||||
{
|
||||
await Task.Delay(1);
|
||||
if (SessionID != 0)
|
||||
get => currParams.NumRec;
|
||||
set
|
||||
{
|
||||
await reloadData();
|
||||
currParams.NumRec = value;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private int totalCount
|
||||
{
|
||||
get => _totalCount;
|
||||
set
|
||||
{
|
||||
if (_totalCount != value)
|
||||
{
|
||||
_totalCount = value;
|
||||
updateRecordCount.InvokeAsync(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected async Task selRecord(InveSessTotLotModel selRecord)
|
||||
{
|
||||
currRecord = selRecord;
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
protected async Task resetSel()
|
||||
{
|
||||
currRecord = null;
|
||||
await Task.Delay(1);
|
||||
}
|
||||
public string checkSelect(InveSessTotLotModel thisRecord)
|
||||
{
|
||||
string answ = "";
|
||||
if (currRecord != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = (currRecord.Lotto == thisRecord.Lotto && currRecord.CodArticolo==thisRecord.CodArticolo) ? "table-info" : "";
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
public string mainCss
|
||||
{
|
||||
get => currRecord != null ? "col-9" : "col-12";
|
||||
}
|
||||
|
||||
protected InveSessTotLotModel? currRecord { get; set; } = null;
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async Task reloadData()
|
||||
{
|
||||
elencoTotLotto = null;
|
||||
totalCount = 0;
|
||||
//totalCount = 0;
|
||||
isLoading = true;
|
||||
SearchRecords = MIService.InveSessTotLotList(SessionID);
|
||||
// se ho search --> filtro...
|
||||
if (!string.IsNullOrEmpty(searchVal))
|
||||
{
|
||||
StringComparison strComp = StringComparison.CurrentCultureIgnoreCase;
|
||||
SearchRecords = SearchRecords.Where(x => x.CodArticolo.Contains(searchVal, strComp) || x.DescrArt.Contains(searchVal, strComp) || x.Lotto.Contains(searchVal, strComp)).ToList();
|
||||
}
|
||||
totalCount = SearchRecords.Count;
|
||||
elencoTotLotto = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
await Task.Delay(1);
|
||||
@@ -81,12 +162,7 @@ namespace MP.INVE.Components
|
||||
await Task.Delay(1);
|
||||
isLoading = false;
|
||||
}
|
||||
protected List<InveSessTotLotModel>? elencoTotLotto;
|
||||
private List<InveSessTotLotModel>? SearchRecords;
|
||||
[Parameter]
|
||||
public SelectInvioParams currParams { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public bool isLoading { get; set; }
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<div class="card">
|
||||
<div class="card-header bg-primary text-light">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="px-1">
|
||||
<b>@LottoSel</b>
|
||||
</div>
|
||||
<div class="px-1 text-end">
|
||||
<b>@CodArtSel</b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body p-0 mb-0">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">DTime</th>
|
||||
<th scope="col">User</th>
|
||||
<th scope="col" class="text-end">Qty</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (ListRecords != null)
|
||||
{
|
||||
@foreach (var item in ListRecords)
|
||||
{
|
||||
<tr>
|
||||
<td class="small textCondensed">
|
||||
<span class="small">
|
||||
@($"{item.DtScan:yy.MM.dd HH:mm:ss}")
|
||||
</span>
|
||||
</td>
|
||||
<td class="small textCondensed">
|
||||
@item.UserScan
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<b>@($"{item.Qty:N2}")</b>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System.Net.Http;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Forms;
|
||||
using Microsoft.AspNetCore.Components.Routing;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.AspNetCore.Components.Web.Virtualization;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.INVE;
|
||||
using MP.INVE.Shared;
|
||||
using MP.INVE.Components;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.INVE.Data;
|
||||
|
||||
namespace MP.INVE.Components
|
||||
{
|
||||
public partial class LotScanDetail
|
||||
{
|
||||
|
||||
[Parameter]
|
||||
public string LottoSel { get; set; } = "";
|
||||
|
||||
[Parameter]
|
||||
public string CodArtSel { get; set; } = "";
|
||||
[Parameter]
|
||||
public int InveSessID { get; set; } = 0;
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
private async Task reloadData()
|
||||
{
|
||||
ListRecords = null;
|
||||
//totalCount = 0;
|
||||
isLoading = true;
|
||||
SearchRecords = await MIService.ScanByLottoSession(LottoSel, InveSessID);
|
||||
totalCount = SearchRecords.Count;
|
||||
ListRecords = SearchRecords;//.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
await Task.Delay(1);
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
private int _totalCount { get; set; } = 0;
|
||||
private int totalCount
|
||||
{
|
||||
get => _totalCount;
|
||||
set
|
||||
{
|
||||
if (_totalCount != value)
|
||||
{
|
||||
_totalCount = value;
|
||||
//updateRecordCount.InvokeAsync(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
private List<ScanDataModel>? SearchRecords;
|
||||
protected List<ScanDataModel>? ListRecords;
|
||||
public bool isLoading { get; set; }
|
||||
|
||||
[Inject]
|
||||
protected MiDataService MIService { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
@@ -90,7 +90,7 @@ namespace MP.INVE.Components
|
||||
isLoading = true;
|
||||
ElencoMagazzini = null;
|
||||
SearchRecords = null;
|
||||
SearchRecords = MIDataservice.ElencoMagazzini();
|
||||
SearchRecords = MIDataservice.MagazziniList();
|
||||
totalCount = SearchRecords.Count;
|
||||
ElencoMagazzini = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
await Task.Delay(1);
|
||||
|
||||
@@ -23,7 +23,6 @@ namespace MP.INVE.Components
|
||||
public partial class NavMenuTerm
|
||||
{
|
||||
private bool collapseNavMenu = true;
|
||||
//public List<MP.Data.DatabaseModels.LinkMenu>? ElencoLink { get; set; }
|
||||
private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
|
||||
private void ToggleNavMenu()
|
||||
{
|
||||
@@ -39,6 +38,7 @@ namespace MP.INVE.Components
|
||||
protected string @cssCancScan = "";
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
if (isScan)
|
||||
{
|
||||
cssCancScan = "bg-info";
|
||||
@@ -52,8 +52,8 @@ namespace MP.INVE.Components
|
||||
cssCancBack = "background-color: rgba(255,255,255,0.7)";
|
||||
cssCanc = "fw-bold text-decoration-underline";
|
||||
}
|
||||
// recupero elenco JQM
|
||||
//ElencoLink = await MDService.ElencoLink();
|
||||
// verifico se sia tutto OK (sessione aperta)
|
||||
|
||||
}
|
||||
|
||||
protected bool showText { get; set; } = true;
|
||||
|
||||
@@ -10,76 +10,84 @@
|
||||
|
||||
@if (!firstMsg)
|
||||
{
|
||||
@if (!isQtaSbagliata)
|
||||
{
|
||||
|
||||
<ul class="p-0">
|
||||
<li class="list-group-item p-0">
|
||||
Lotto:
|
||||
<div class="input-group input-group-sm">
|
||||
<input class="form-control" value="@lottoScan" disabled />
|
||||
<span class="input-group-text" id="basic-addon1">@tipo</span>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item p-0">
|
||||
Articolo:
|
||||
<div class="input-group input-group-sm">
|
||||
<input class="form-control @reqArtMod" @bind-value="@articoloScan" type="text" />
|
||||
@if ((canMod != "false") || (tipo != "U") || (!isKnown))
|
||||
{
|
||||
<button title="Mod articolo" @onclick="@cssDisableArt" class="btn btn-sm btn-primary">
|
||||
<i class="fa-solid fa-pen-to-square"></i>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item p-0">
|
||||
Quantità:
|
||||
<div class="input-group input-group-sm">
|
||||
@if (currLottoInterno != null || currLottoEsterno != null)
|
||||
{
|
||||
<input class="form-control" @bind-value="@quantitaScan" type="number" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<input class="form-control @reqQtaMod" @bind-value="@quantitaScan" type="number" />
|
||||
}
|
||||
@if ((canMod != "false") || (tipo != "U") || (!isKnown))
|
||||
{
|
||||
<button title="Mod quantità" @onclick="@cssDisableQta" class="btn btn-sm btn-primary">
|
||||
<i class="fa-solid fa-pen-to-square"></i>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item p-0">
|
||||
Note:
|
||||
<div class="input-group input-group-sm">
|
||||
<input class="form-control " @bind-value="@noteScan" type="text" />
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="btn-group col-12 py-1" role="group">
|
||||
@if (articoloScan != "" && quantitaScan != 0 && canSave)
|
||||
{
|
||||
<button type="button" class="btn btn-success col-6" @onclick="()=>insertScan()">Conferma</button>
|
||||
<button type="button" class="btn btn-danger col-6" @onclick="()=>resetAll()">Annulla</button>
|
||||
}
|
||||
else if (articoloScan == "" && quantitaScan != 0)
|
||||
{
|
||||
<div class="alert bg-warning col-12 py-1">Dati mancanti: Codice articolo</div>
|
||||
}
|
||||
else if (quantitaScan == 0 && articoloScan != "")
|
||||
{
|
||||
<div class="alert bg-warning col-12 py-1">Dati mancanti: Quantità a "0"</div>
|
||||
}
|
||||
else if (isKnown)
|
||||
{
|
||||
<div class="alert bg-warning col-12 py-1">Codice già scansionato per la sessione corrente</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="alert bg-warning col-12 py-1">Dati mancanti: Codice articolo e Quantità </div>
|
||||
}
|
||||
</div>
|
||||
<ul class="p-0">
|
||||
<li class="list-group-item p-0">
|
||||
Lotto:
|
||||
<div class="input-group input-group-sm">
|
||||
<input class="form-control" value="@lottoScan" disabled />
|
||||
<span class="input-group-text" id="basic-addon1">@tipo</span>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item p-0">
|
||||
Articolo:
|
||||
<div class="input-group input-group-sm">
|
||||
<input class="form-control @reqArtMod" @bind-value="@articoloScan" type="text" />
|
||||
@if ((canMod != "false") || (tipo != "U") || (!isKnown))
|
||||
{
|
||||
<button title="Mod articolo" @onclick="@cssDisableArt" class="btn btn-sm btn-primary">
|
||||
<i class="fa-solid fa-pen-to-square"></i>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item p-0">
|
||||
Quantità:
|
||||
<div class="input-group input-group-sm">
|
||||
@if (currLottoInterno != null || currLottoEsterno != null)
|
||||
{
|
||||
<input class="form-control" @bind-value="@quantitaScan" type="number" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<input class="form-control @reqQtaMod" @bind-value="@quantitaScan" type="number" />
|
||||
}
|
||||
@if ((canMod != "false") || (tipo != "U") || (!isKnown))
|
||||
{
|
||||
<button title="Mod quantità" @onclick="@cssDisableQta" class="btn btn-sm btn-primary">
|
||||
<i class="fa-solid fa-pen-to-square"></i>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item p-0">
|
||||
Note:
|
||||
<div class="input-group input-group-sm">
|
||||
<input class="form-control " @bind-value="@noteScan" type="text" />
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="btn-group col-12 py-1" role="group">
|
||||
@if (articoloScan != "" && quantitaScan != 0 && canSave)
|
||||
{
|
||||
<button type="button" class="btn btn-success col-6" @onclick="()=>insertScan()">Conferma</button>
|
||||
<button type="button" class="btn btn-danger col-6" @onclick="()=>resetAll()">Annulla</button>
|
||||
}
|
||||
else if (articoloScan == "" && quantitaScan != 0)
|
||||
{
|
||||
<div class="alert bg-warning col-12 py-1">Dati mancanti: Codice articolo</div>
|
||||
}
|
||||
else if (quantitaScan == 0 && articoloScan != "")
|
||||
{
|
||||
<div class="alert bg-warning col-12 py-1">Dati mancanti: Quantità a "0"</div>
|
||||
}
|
||||
else if (isKnown)
|
||||
{
|
||||
<div class="alert bg-danger col-12 py-1">Codice già scansionato per la sessione corrente</div>
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
<div class="alert bg-warning col-12 py-1">Dati mancanti: Codice articolo e Quantità </div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="alert bg-danger col-12 mt-3">Quantità registrata minore o uguale a 0</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -59,6 +59,7 @@ namespace MP.INVE.Components
|
||||
protected bool isKnown = false;
|
||||
protected bool canSave = true;
|
||||
protected string oldArt = "";
|
||||
protected bool isQtaSbagliata = false;
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
@@ -74,12 +75,13 @@ namespace MP.INVE.Components
|
||||
currLottoInterno = null;
|
||||
currUdc = null;
|
||||
alreadyScan = null;
|
||||
|
||||
isQtaSbagliata = false;
|
||||
|
||||
// se il valore scansionato è != null...
|
||||
if (string.IsNullOrEmpty(lastScan))
|
||||
{
|
||||
firstMsg = true;
|
||||
await Task.Delay(1);
|
||||
await Task.Delay(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -129,19 +131,26 @@ namespace MP.INVE.Components
|
||||
|
||||
if (udc != null)
|
||||
{
|
||||
var udcString = udc.UDC.Substring(2, 3);
|
||||
if (udcString == "MFI")
|
||||
if (udc.Qta > 0)
|
||||
{
|
||||
var udcString = udc.UDC.Substring(2, 3);
|
||||
if (udcString == "MFI")
|
||||
{
|
||||
|
||||
isKnown = true;
|
||||
canSave = true;
|
||||
currUdc = udc;
|
||||
tipo = "U";
|
||||
lottoScan = udc.lottoNav.Lotto;
|
||||
oldArt = udc.lottoNav.CodArt;
|
||||
articoloScan = udc.lottoNav.CodArt;
|
||||
quantitaScan = Math.Round(udc.Qta, 2);
|
||||
noteScan = udc.Note;
|
||||
isKnown = true;
|
||||
canSave = true;
|
||||
currUdc = udc;
|
||||
tipo = "U";
|
||||
lottoScan = udc.lottoNav.Lotto;
|
||||
oldArt = udc.lottoNav.CodArt;
|
||||
articoloScan = udc.lottoNav.CodArt;
|
||||
quantitaScan = Math.Round(udc.Qta, 2);
|
||||
noteScan = udc.Note;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
isQtaSbagliata = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,8 +1,69 @@
|
||||
namespace MP.INVE.Data
|
||||
using Blazored.LocalStorage;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MP.Data.DTO;
|
||||
using NLog;
|
||||
using NLog.Fluent;
|
||||
|
||||
namespace MP.INVE.Data
|
||||
{
|
||||
public class MessageService
|
||||
{
|
||||
#region Public Events
|
||||
protected ILocalStorageService localStorage { get; set; } = null!;
|
||||
|
||||
public MessageService(ILocalStorageService genLocalStorage)
|
||||
{
|
||||
localStorage = genLocalStorage;
|
||||
}
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
/// <summary>
|
||||
/// Effettua pulizia localstorage
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> clearLocalStorageAsync()
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
await localStorage.ClearAsync();
|
||||
answ = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
//Log.Error($"Eccezione in clearLocalStorage{Environment.NewLine}{exc}");
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce il record OperatoreDTO da localstorage
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<OperatoreDTO> getCurrOperDtoAsync()
|
||||
{
|
||||
OperatoreDTO answ = new OperatoreDTO();
|
||||
var result = await localStorage.GetItemAsync<OperatoreDTO>("Opr");
|
||||
if (result != null)
|
||||
{
|
||||
answ = result;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// scrive il record OperatoreDTO nel localstorage
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> setCurrOperDtoAsync(OperatoreDTO opr)
|
||||
{
|
||||
bool answ = false;
|
||||
await localStorage.SetItemAsync("Opr", opr);
|
||||
answ = true;
|
||||
return answ;
|
||||
}
|
||||
|
||||
#if false
|
||||
|
||||
public event Action EA_PageUpdated = null!;
|
||||
|
||||
@@ -12,10 +73,6 @@
|
||||
|
||||
public event Action EA_StatoSearch = null!;
|
||||
|
||||
#endregion Public Events
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public int currPage
|
||||
{
|
||||
get => _currPage;
|
||||
@@ -123,10 +180,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void reportPaging()
|
||||
{
|
||||
if (EA_PageUpdated != null)
|
||||
@@ -143,24 +196,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private string searchVal = "";
|
||||
private bool showSearch;
|
||||
private string stateSel = "*";
|
||||
private string tipoSearch = "";
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private int _currPage { get; set; } = 1;
|
||||
|
||||
private int _numRecord { get; set; } = 10;
|
||||
private int _totalCount { get; set; } = 0;
|
||||
|
||||
#endregion Private Properties
|
||||
#endif
|
||||
}
|
||||
}
|
||||
+496
-415
File diff suppressed because it is too large
Load Diff
@@ -23,6 +23,7 @@ namespace MP.INVE.Data
|
||||
public int currIdSession { get; set; } = 0;
|
||||
public int currIdMag { get; set; } = 0;
|
||||
public bool reqNew { get; set; } = false;
|
||||
public string searchVal { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
@@ -33,6 +34,9 @@ namespace MP.INVE.Data
|
||||
if (!(obj is SelectInveSessionParams item))
|
||||
return false;
|
||||
|
||||
if (searchVal != item.searchVal)
|
||||
return false;
|
||||
|
||||
if (MaxRecord != item.MaxRecord)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP.INVE</RootNamespace>
|
||||
<Version>6.16.2212.1610</Version>
|
||||
<Version>6.16.2212.1915</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,27 +1,5 @@
|
||||
@page "/Acquisizione"
|
||||
|
||||
@*<div class="d-flex justify-content-between">
|
||||
<h5 class="fw-bold py-1">MP.INVE</h5>
|
||||
<div class="fs-5 py-0">
|
||||
<span class="fw-bold badge bg-dark py-1 text-light">Acquisizione</span>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button class="btn btn-sm btn-primary mb-2" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasRight" aria-controls="offcanvasRight"><i class="fa-solid fa-bars"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="offcanvas offcanvas-end" data-bs-scroll="true" data-bs-backdrop="false" tabindex="-1" id="offcanvasRight" aria-labelledby="offcanvasRightLabel">
|
||||
<div class="offcanvas-header">
|
||||
<h5 id="offcanvasRightLabel">Menu</h5>
|
||||
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="offcanvas-body text-center">
|
||||
|
||||
<a class="btn btn-sm btn-danger text-end mb-2" href="Cancellazione?idOpr=@idOpr&sessID=@sessionId">
|
||||
MODALITÀ CANCELLAZIONE
|
||||
</a>
|
||||
</div>
|
||||
</div>*@
|
||||
<div class="mb-2">
|
||||
<NavMenuTerm isScan="true" link="@link"></NavMenuTerm>
|
||||
</div>
|
||||
@@ -41,9 +19,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body py-0">
|
||||
@*if (rawScan != null)
|
||||
{
|
||||
}*@
|
||||
<div class="col-12">
|
||||
<ProcSuggestion lastScan="@rawScan" sessID="@sessionId" magID="@magazzinoId" userScan="@idOpr"></ProcSuggestion>
|
||||
</div>
|
||||
|
||||
@@ -1,36 +1,14 @@
|
||||
@page "/Cancellazione"
|
||||
|
||||
@*<div class="d-flex justify-content-between">
|
||||
<h5 class="fw-bold py-1">MP.INVE</h5>
|
||||
<div class="fs-5 py-0">
|
||||
<span class="fw-bold badge bg-info py-1 text-dark">Cancellazione</span>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button class="btn btn-sm btn-primary mb-2" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasRight" aria-controls="offcanvasRight"><i class="fa-solid fa-bars"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="offcanvas offcanvas-end" data-bs-scroll="true" data-bs-backdrop="false" tabindex="-1" id="offcanvasRight" aria-labelledby="offcanvasRightLabel">
|
||||
<div class="offcanvas-header">
|
||||
<h5 id="offcanvasRightLabel">Menu</h5>
|
||||
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="offcanvas-body text-center">
|
||||
|
||||
<button class="btn btn-sm btn-success text-end mb-2" @onclick="()=>goBack()">
|
||||
MODALITÀ SCANSIONE
|
||||
</button>
|
||||
</div>
|
||||
</div>*@
|
||||
|
||||
<div class="mb-2">
|
||||
<NavMenuTerm isScan="false"></NavMenuTerm>
|
||||
</div>
|
||||
|
||||
<CodeScan lastRawScan="saveScan"></CodeScan>
|
||||
@if (currScan != null)
|
||||
{
|
||||
<div class="card p-0">
|
||||
<div class="card p-0 mb-5">
|
||||
<div class="card-header d-flex justify-content-between">
|
||||
<span>
|
||||
Dati ultima scansione
|
||||
@@ -72,7 +50,7 @@
|
||||
<span><b>Quantità: </b></span>
|
||||
</div>
|
||||
<div class="fs-3">
|
||||
@Math.Round(currScan.Qty, 0)
|
||||
@Math.Round(currScan.Qty, 2)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
@page "/ClosedSession"
|
||||
<div class="mb-2">
|
||||
<NavMenuTerm isScan="true" link="@link"></NavMenuTerm>
|
||||
</div>
|
||||
<h3>ClosedSession</h3>
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.WebUtilities;
|
||||
using MP.INVE.Data;
|
||||
|
||||
namespace MP.INVE.Pages
|
||||
{
|
||||
public partial class ClosedSession
|
||||
{
|
||||
#region Protected Properties
|
||||
|
||||
protected string descr { get; set; } = "";
|
||||
protected string idOpr { get; set; } = null!;
|
||||
protected string link { get; set; } = "";
|
||||
protected string magazzinoId { get; set; } = "";
|
||||
|
||||
protected string magInv { get; set; } = "";
|
||||
|
||||
[Inject]
|
||||
protected MiDataService MIService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected NavigationManager NavManager { get; set; } = null!;
|
||||
|
||||
protected int sessionId { get; set; } = 0;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
var uri = NavManager.ToAbsoluteUri(NavManager.Uri);
|
||||
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("idOpr", out var _matrOpr) && QueryHelpers.ParseQuery(uri.Query).TryGetValue("idSess", out var _inveSessionId) && QueryHelpers.ParseQuery(uri.Query).TryGetValue("codMag", out var _idMag))
|
||||
{
|
||||
idOpr = _matrOpr;
|
||||
sessionId = int.Parse(_inveSessionId);
|
||||
magazzinoId = _idMag;
|
||||
|
||||
// recupero dati della sessione di inventario...
|
||||
var currSessions = MIService.InventSessCurrList();
|
||||
var currInv = currSessions.Where(x => x.InveSessID == sessionId).FirstOrDefault();
|
||||
if (currInv != null)
|
||||
{
|
||||
descr = currInv.Description;
|
||||
magInv = currInv.AnagMagNav.DescMag;
|
||||
}
|
||||
}
|
||||
link = $"ClosedSession?idOpr={idOpr}&sessID={sessionId}";
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,6 @@ namespace MP.INVE.Pages
|
||||
{
|
||||
Titolo = "MP INVE";
|
||||
Messaggio = "I nostri contattatti e siti di supporto";
|
||||
AppMService.ShowSearch = false;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
@@ -22,7 +22,7 @@ using MP.Data.DatabaseModels;
|
||||
|
||||
namespace MP.INVE.Pages
|
||||
{
|
||||
public partial class Starter
|
||||
public partial class ElencoMagazzini
|
||||
{
|
||||
[Inject]
|
||||
private IConfiguration Configuration { get; set; } = null!;
|
||||
@@ -85,13 +85,14 @@ namespace MP.INVE.Pages
|
||||
|
||||
}
|
||||
|
||||
private List<AnagMagModel>? ElencoMagazzini;
|
||||
protected override async Task OnInitializedAsync()
|
||||
private List<AnagMagModel>? ListaMagazzini;
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
await reloadData();
|
||||
//await getId();
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
private void openNew()
|
||||
{
|
||||
reqNew = true;
|
||||
@@ -106,9 +107,9 @@ namespace MP.INVE.Pages
|
||||
private async Task reloadData()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
ElencoMagazzini = null;
|
||||
//ListaMagazzini = null;
|
||||
isLoading = true;
|
||||
ElencoMagazzini = MIDataservice.ElencoMagazzini();
|
||||
//ListaMagazzini = MIDataservice.MagazziniList();
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
@@ -128,7 +129,7 @@ namespace MP.INVE.Pages
|
||||
await MIDataservice.InsertNewMag(newMag);
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
//await MIDataservice.FlushRedisCache();
|
||||
await reloadData();
|
||||
//await reloadData();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1,19 +1,11 @@
|
||||
using Blazored.LocalStorage;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.DTO;
|
||||
using MP.INVE.Data;
|
||||
|
||||
namespace MP.INVE.Pages
|
||||
{
|
||||
public partial class Index
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
//public List<LinkMenu>? ElencoLink { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
@@ -34,14 +26,9 @@ namespace MP.INVE.Pages
|
||||
//await getId();
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private string currAzienda = "";
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private List<ConfigModel>? configData { get; set; } = null;
|
||||
|
||||
@@ -4,10 +4,19 @@
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between">
|
||||
<div class="col-5">
|
||||
<h3>Sessione</h3>
|
||||
<div class="px-1">
|
||||
<div class="d-flex">
|
||||
<div class="px-2">
|
||||
<b class="fs-3">Sessione</b>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<button class="btn btn-success" @onclick="()=>openNew()">
|
||||
<i class="fa-regular fa-square-plus"></i> NUOVA
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2 align-content-center">
|
||||
<div class="px-1">
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-text">
|
||||
<span class="me-1">In corso</span>
|
||||
@@ -18,10 +27,12 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-5 d-flex flex-row-reverse">
|
||||
<button class="btn btn-success" @onclick="()=>openNew()">
|
||||
<i class="fa-regular fa-square-plus"></i> NUOVO
|
||||
</button>
|
||||
<div class="px-1">
|
||||
<div class="input-group">
|
||||
<label class="input-group-text" for="txtSearch"><i class="fa-solid fa-magnifying-glass"></i></label>
|
||||
<input type="text" class="form-control" id="txtSearch" @bind="@searchVal" title="Campo Ricerca" placeholder="Ricerca [ALT-R]" accesskey="R">
|
||||
<button @onclick="reset" class="btn btn-success input-group-text"><i class="fa-solid fa-rotate"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -32,7 +43,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<InveSessionList currParams="@currParams" isLoading="@isLoading" ></InveSessionList>
|
||||
<InveSessionList currParams="@currParams" isLoading="@isLoading"></InveSessionList>
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
@@ -28,13 +28,11 @@ namespace MP.INVE.Pages
|
||||
|
||||
private SelectInveSessionParams currParams = new SelectInveSessionParams();
|
||||
|
||||
private List<InventorySessionModel>? elencoSessioni;
|
||||
private List<InventorySessionModel>? SearchRecords;
|
||||
private List<AnagOperatoriModel>? elencoOperatori;
|
||||
private List<AnagMagModel>? ElencoMagazzini;
|
||||
|
||||
private DataPager pagerSession = null!;
|
||||
|
||||
protected string searchVal
|
||||
{
|
||||
get => currParams.searchVal;
|
||||
set => currParams.searchVal = value;
|
||||
}
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await getId();
|
||||
@@ -50,6 +48,11 @@ namespace MP.INVE.Pages
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
protected async Task reset()
|
||||
{
|
||||
searchVal = "";
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
private bool isLoading { get; set; } = false;
|
||||
|
||||
@@ -124,11 +127,12 @@ namespace MP.INVE.Pages
|
||||
{
|
||||
currPage = newNum;
|
||||
}
|
||||
|
||||
[Inject]
|
||||
protected MessageService MsgService { get; set; } = null!;
|
||||
protected async Task getId()
|
||||
{
|
||||
OperatoreDTO local = new OperatoreDTO();
|
||||
local = await localStorage.GetItemAsync<OperatoreDTO>("MatrOpr");
|
||||
local = await MsgService.getCurrOperDtoAsync();
|
||||
if (local != null)
|
||||
{
|
||||
idOperatore = local.MatrOpr.ToString();
|
||||
|
||||
+31
-16
@@ -12,7 +12,19 @@ else
|
||||
<div class="card mb-5">
|
||||
<div class="card-header">
|
||||
<div class="d-flex justify-content-between">
|
||||
<h3>Invio</h3>
|
||||
<div class="px-2">
|
||||
<b class="fs-3">Invio</b>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<button class="btn btn-danger" @onclick="() => returnToSessions()">TORNA A SESSIONI</button>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<div class="input-group">
|
||||
<label class="input-group-text" for="txtSearch"><i class="fa-solid fa-magnifying-glass"></i></label>
|
||||
<input type="text" class="form-control" id="txtSearch" @bind="@searchVal" title="Campo Ricerca" placeholder="Ricerca [ALT-R]" accesskey="R">
|
||||
<button @onclick="reset" class="btn btn-success input-group-text"><i class="fa-solid fa-rotate"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@@ -65,26 +77,26 @@ else
|
||||
</td>
|
||||
<td class="text-center d-flex justify-content-between">
|
||||
<div>
|
||||
<button class="btn btn-sm btn-primary mx-1" @onclick="mostraDati">
|
||||
<button class="btn btn-sm btn-primary mx-1" title="Mostra i dati delle scansioni per questa sessione" @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>
|
||||
<button class="btn btn-sm btn-danger mx-1 " title="Chiudi la sessione corrente" @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>
|
||||
<button class="btn btn-sm btn-secondary mx-1" title="Chiudi la sessione corrente" @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>
|
||||
<button class="btn btn-sm btn-success mx-1" title="Ripri la sessione corrente" @onclick="()=>apriSessione(sessione.InveSessID)"><i class="fa-regular fa-circle-play"></i></button>
|
||||
<button class="btn btn-sm btn-warning mx-1" title="Trasferisci la sessione corrente" @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>
|
||||
<button class="btn btn-sm btn-secondary mx-1" title="Ripri la sessione corrente" @onclick="()=>apriSessione(sessione.InveSessID)" disabled><i class="fa-regular fa-circle-play"></i></button>
|
||||
<button class="btn btn-sm btn-secondary mx-1" title="Trasferisci la sessione corrente" @onclick="()=>trasfSessione(sessione.InveSessID)" disabled><i class="fa-solid fa-file-import"></i></button>
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
@@ -104,17 +116,20 @@ else
|
||||
{
|
||||
@if (sessID != 0)
|
||||
{
|
||||
<ListTotLotto SessionID="@sessID" currParams="@invioParams" isLoading="@isLoading"></ListTotLotto>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<b class="fs-4">Totale lotti</b>
|
||||
</div>
|
||||
<div class="card-body p-1">
|
||||
<ListTotLotto SessionID="@sessID" currParams="@invioParams" isLoading="@isLoading" searchVal="@searchVal" updateRecordCount="UpdateTotCount"></ListTotLotto>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
@*if (sessID != 0)
|
||||
{
|
||||
<div class="card-footer py-1">
|
||||
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="@isLoading" />
|
||||
</div>
|
||||
}*@
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
+174
-120
@@ -1,79 +1,77 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System.Net.Http;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Forms;
|
||||
using Microsoft.AspNetCore.Components.Routing;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.AspNetCore.Components.Web.Virtualization;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.INVE;
|
||||
using MP.INVE.Shared;
|
||||
using MP.INVE.Components;
|
||||
using Blazored.LocalStorage;
|
||||
using MP.Data.DTO;
|
||||
using MP.Data;
|
||||
using MP.INVE.Data;
|
||||
using MP.Data.DatabaseModels;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.WebUtilities;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.DTO;
|
||||
using MP.INVE.Data;
|
||||
|
||||
namespace MP.INVE.Pages
|
||||
{
|
||||
public partial class Invio
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Inject]
|
||||
public MiDataService MIService { get; set; } = null!;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected SelectInvioParams invioParams = new SelectInvioParams();
|
||||
protected bool isLoading = false;
|
||||
protected bool mostra = false;
|
||||
protected SelectInveSessionParams sessParams = new SelectInveSessionParams();
|
||||
|
||||
private int totalCount
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected string BaseUrlTab { get => $"{Configuration["ServerConf:BaseUrlJumper"]}"; }
|
||||
|
||||
protected string codMag { get; set; } = "";
|
||||
|
||||
[Inject]
|
||||
protected MessageService MsgService { get; set; } = null!;
|
||||
|
||||
protected string rawCode
|
||||
{
|
||||
get => invioParams.TotCount;
|
||||
set
|
||||
get
|
||||
{
|
||||
if (invioParams.TotCount != value)
|
||||
{
|
||||
invioParams.TotCount = value;
|
||||
}
|
||||
string answ = "";
|
||||
answ = $"{BaseUrlTab}IdSessione={sessID}&IdMag={codMag}&MatrOpr={idOperatore}&UserAuthKey={authKey}";
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
private int numRecord
|
||||
|
||||
protected string searchVal { get; set; } = "";
|
||||
|
||||
protected int sessID { get; set; } = 0;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected async void apriSessione(int sessID)
|
||||
{
|
||||
get => invioParams.NumRec;
|
||||
set
|
||||
var open = await MIService.CloseOpenSessione(sessID, false);
|
||||
await resetCacheSessInv();
|
||||
if (open)
|
||||
{
|
||||
if (invioParams.NumRec != value)
|
||||
{
|
||||
invioParams.NumRec = value;
|
||||
}
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
}
|
||||
private int currPage
|
||||
|
||||
protected async void chiudiSessione(int sessID)
|
||||
{
|
||||
get => invioParams.CurrPage;
|
||||
set
|
||||
var closed = await MIService.CloseOpenSessione(sessID, true);
|
||||
await resetCacheSessInv();
|
||||
if (closed)
|
||||
{
|
||||
if (invioParams.CurrPage != value)
|
||||
{
|
||||
invioParams.CurrPage = value;
|
||||
}
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
}
|
||||
private string idOperatore
|
||||
{
|
||||
get => sessParams.idOperatore;
|
||||
set => sessParams.idOperatore = value;
|
||||
}
|
||||
private string authKey
|
||||
{
|
||||
get => sessParams.authKey;
|
||||
set => sessParams.authKey = value;
|
||||
}
|
||||
|
||||
protected void ForceReload(int newNum)
|
||||
{
|
||||
@@ -84,52 +82,26 @@ namespace MP.INVE.Pages
|
||||
{
|
||||
currPage = newNum;
|
||||
}
|
||||
protected bool mostra = false;
|
||||
|
||||
protected async Task getId()
|
||||
{
|
||||
OperatoreDTO local = new OperatoreDTO();
|
||||
local = await MsgService.getCurrOperDtoAsync();
|
||||
if (local != null)
|
||||
{
|
||||
idOperatore = local.MatrOpr.ToString();
|
||||
authKey = local.hashAuthKey;
|
||||
}
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
|
||||
var uri = NavManager.ToAbsoluteUri(NavManager.Uri);
|
||||
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("sessID", out var _inveSessionId) && QueryHelpers.ParseQuery(uri.Query).TryGetValue("codMag", out var _idMag))
|
||||
{
|
||||
sessID = int.Parse(_inveSessionId);
|
||||
codMag = _idMag;
|
||||
}
|
||||
|
||||
await reloadData();
|
||||
|
||||
}
|
||||
protected async override Task OnAfterRenderAsync(bool firstRender)
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
await Task.Delay(50);
|
||||
if (firstRender)
|
||||
{
|
||||
if (sessione != null)
|
||||
@@ -144,33 +116,118 @@ namespace MP.INVE.Pages
|
||||
}
|
||||
}
|
||||
|
||||
[Inject]
|
||||
private IConfiguration Configuration { get; set; } = null!;
|
||||
[Inject]
|
||||
private IJSRuntime JSRuntime { get; set; } = null!;
|
||||
[Inject]
|
||||
private NavigationManager NavManager { get; set; } = null!;
|
||||
[Inject]
|
||||
private ILocalStorageService localStorage { get; set; } = null!;
|
||||
protected string BaseUrlTab { get => $"{Configuration["ServerConf:BaseUrlJumper"]}"; }
|
||||
|
||||
|
||||
protected string rawCode
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
get
|
||||
var uri = NavManager.ToAbsoluteUri(NavManager.Uri);
|
||||
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("sessID", out var _inveSessionId) && QueryHelpers.ParseQuery(uri.Query).TryGetValue("codMag", out var _idMag))
|
||||
{
|
||||
string answ = "";
|
||||
answ = $"{BaseUrlTab}IdSessione={sessID}&IdMag={codMag}&MatrOpr={idOperatore}&UserAuthKey={authKey}";
|
||||
return answ;
|
||||
sessID = int.Parse(_inveSessionId);
|
||||
codMag = _idMag;
|
||||
}
|
||||
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
protected async Task returnToSessions()
|
||||
{
|
||||
await resetCacheSessInv();
|
||||
// ritorno pagina...
|
||||
NavManager.NavigateTo("InveSession", true);
|
||||
}
|
||||
|
||||
protected async void trasfSessione(int sessID)
|
||||
{
|
||||
var trasf = await MIService.TransferSessione(sessID);
|
||||
await resetCacheSessInv();
|
||||
if (trasf)
|
||||
{
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
}
|
||||
|
||||
protected void UpdateTotCount(int newTotCount)
|
||||
{
|
||||
totalCount = newTotCount;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private InventorySessionModel? sessione;
|
||||
protected bool isLoading = false;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private int _totalCount { get; set; } = 0;
|
||||
|
||||
private string authKey
|
||||
{
|
||||
get => sessParams.authKey;
|
||||
set => sessParams.authKey = value;
|
||||
}
|
||||
|
||||
[Inject]
|
||||
private IConfiguration Configuration { get; set; } = null!;
|
||||
|
||||
private int currPage
|
||||
{
|
||||
get => invioParams.CurrPage;
|
||||
set
|
||||
{
|
||||
if (invioParams.CurrPage != value)
|
||||
{
|
||||
invioParams.CurrPage = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string idOperatore
|
||||
{
|
||||
get => sessParams.idOperatore;
|
||||
set => sessParams.idOperatore = value;
|
||||
}
|
||||
|
||||
[Inject]
|
||||
private IJSRuntime JSRuntime { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
private ILocalStorageService localStorage { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
private NavigationManager NavManager { get; set; } = null!;
|
||||
|
||||
private int numRecord
|
||||
{
|
||||
get => invioParams.NumRec;
|
||||
set
|
||||
{
|
||||
if (invioParams.NumRec != value)
|
||||
{
|
||||
invioParams.NumRec = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int totalCount
|
||||
{
|
||||
get => invioParams.TotCount;
|
||||
set
|
||||
{
|
||||
if (invioParams.TotCount != value)
|
||||
{
|
||||
invioParams.TotCount = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async Task reloadData()
|
||||
{
|
||||
|
||||
sessione = null;
|
||||
isLoading = true;
|
||||
sessione = MIService.InventSessByID(sessID);
|
||||
@@ -178,19 +235,16 @@ namespace MP.INVE.Pages
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
protected int sessID { get; set; } = 0;
|
||||
protected string codMag { get; set; } = "";
|
||||
|
||||
|
||||
protected async Task getId()
|
||||
private void reset()
|
||||
{
|
||||
OperatoreDTO local = new OperatoreDTO();
|
||||
local = await localStorage.GetItemAsync<OperatoreDTO>("MatrOpr");
|
||||
if (local != null)
|
||||
{
|
||||
idOperatore = local.MatrOpr.ToString();
|
||||
authKey = local.hashAuthKey;
|
||||
}
|
||||
searchVal = "";
|
||||
}
|
||||
|
||||
private async Task resetCacheSessInv()
|
||||
{
|
||||
await MIService.FlushSessInvCache();
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,8 @@ namespace MP.INVE.Pages
|
||||
|
||||
[Inject]
|
||||
protected MiDataService MIService { get; set; } = null!;
|
||||
[Inject]
|
||||
protected MessageService MsgService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected NavigationManager NavManager { get; set; } = null!;
|
||||
@@ -69,7 +71,10 @@ namespace MP.INVE.Pages
|
||||
dtExp = DateTime.Now.AddMinutes(1)
|
||||
};
|
||||
|
||||
#if false
|
||||
await localStorage.SetItemAsync("MatrOpr", currOpr);
|
||||
#endif
|
||||
await MsgService.setCurrOperDtoAsync(sessionOpr);
|
||||
await sessionStorage.SetItemAsync("idSessione", inveSessionId);
|
||||
}
|
||||
NavManager.NavigateTo($"Acquisizione?idSess={inveSessionId}&idOpr={idOpr}&codMag={codMag}");
|
||||
|
||||
@@ -60,8 +60,9 @@ namespace MP.INVE.Pages
|
||||
elencoOperatori = MIDataservice.ElencoOperatori();
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
private void login()
|
||||
[Inject]
|
||||
protected MessageService MsgService { get; set; } = null!;
|
||||
private async void login()
|
||||
{
|
||||
logged = MIDataservice.loginOperatore(idOperatore, authKey);
|
||||
|
||||
@@ -80,7 +81,10 @@ namespace MP.INVE.Pages
|
||||
hashAuthKey = hash,
|
||||
dtExp = DateTime.Now.AddMinutes(1)
|
||||
};
|
||||
localStorage.SetItemAsync("MatrOpr", sessionOpr);
|
||||
#if false
|
||||
localStorage.SetItemAsync("MatrOpr", sessionOpr);
|
||||
#endif
|
||||
await MsgService.setCurrOperDtoAsync(sessionOpr);
|
||||
NavManager.NavigateTo("InveSession", true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOINVE </i>
|
||||
<h4>Versione: 6.16.2212.1610</h4>
|
||||
<h4>Versione: 6.16.2212.1915</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2212.1610
|
||||
6.16.2212.1915
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2212.1610</version>
|
||||
<version>6.16.2212.1915</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>
|
||||
|
||||
@@ -52,26 +52,36 @@
|
||||
</div>
|
||||
</NavLink>
|
||||
</div>
|
||||
@* <div class="nav-item px-2 col-12">
|
||||
<NavLink class="nav-link px-2" href="Acquisizione">
|
||||
<div class="nav-item px-2 col-12">
|
||||
<NavLink class="nav-link px-2" href="Contacts">
|
||||
<div class="col-2">
|
||||
<span class="px-2" aria-hidden="true"><i class="fa-solid fa-barcode"></i></span>
|
||||
<span class="px-2" aria-hidden="true"><i class="fa-solid fa-envelope"></i></span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="@hideText">Acquisizione</span>
|
||||
<span class="@hideText">Contatti</span>
|
||||
</div>
|
||||
</NavLink>
|
||||
</div>*@
|
||||
</div>
|
||||
@* <div class="nav-item px-2 col-12">
|
||||
<NavLink class="nav-link px-2" href="Acquisizione">
|
||||
<div class="col-2">
|
||||
<span class="px-2" aria-hidden="true"><i class="fa-solid fa-barcode"></i></span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="@hideText">Acquisizione</span>
|
||||
</div>
|
||||
</NavLink>
|
||||
</div>*@
|
||||
@*<div class="nav-item px-2 col-12">
|
||||
<NavLink class="nav-link px-2" href="Invio">
|
||||
<div class="col-2">
|
||||
<span class="px-2" aria-hidden="true"><i class="fa-solid fa-file-export"></i></span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="@hideText">Invio</span>
|
||||
</div>
|
||||
</NavLink>
|
||||
</div>*@
|
||||
<NavLink class="nav-link px-2" href="Invio">
|
||||
<div class="col-2">
|
||||
<span class="px-2" aria-hidden="true"><i class="fa-solid fa-file-export"></i></span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="@hideText">Invio</span>
|
||||
</div>
|
||||
</NavLink>
|
||||
</div>*@
|
||||
</nav>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -10,8 +10,11 @@
|
||||
"AllowedHosts": "*",
|
||||
"CodApp": "MP.INVE",
|
||||
"ConnectionStrings": {
|
||||
"Mp.Data": "Server=localhost\\SQLEXPRESS;Database=MoonPro; User ID=steamware;Password=viadante16; integrated security=False; MultipleActiveResultSets=True; App=Blazor.ServerApp;",
|
||||
"Redis": "localhost:6379,DefaultDatabase=13,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false"
|
||||
"Mp.Inve": "Server=SQL2016DEV;Database=MoonPro_MAG; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.INVE;",
|
||||
"Mp.IS": "Server=SQL2016DEV;Database=MoonPro_IS_EdilChim; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.INVE;",
|
||||
"Mp.Data": "Server=SQL2016DEV;Database=MoonPro; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.INVE;",
|
||||
"Redis": "localhost:6379,DefaultDatabase=1,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false",
|
||||
"RedisAdmin": "localhost:6379,DefaultDatabase=1,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false,allowAdmin=true"
|
||||
},
|
||||
"ServerConf": {
|
||||
"maxAge": "2000",
|
||||
@@ -19,4 +22,4 @@
|
||||
"redisLongTimeCache": 15,
|
||||
"MpIoBaseUrl": "http://localhost/MP/IO/"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user