33016c9f84
procOperation in procSuggesiotn
71 lines
2.2 KiB
C#
71 lines
2.2 KiB
C#
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;
|
|
using MP.INVE.Pages;
|
|
|
|
namespace MP.INVE.Components
|
|
{
|
|
public partial class ProcOperat
|
|
{
|
|
[Parameter]
|
|
public AnagUdcModel UDC { get; set; } = null!;
|
|
[Parameter]
|
|
public string userScan { get; set; } = null!;
|
|
[Parameter]
|
|
public int sessID { get; set; } = 0;
|
|
|
|
[Inject]
|
|
public MiDataService MIService { get; set; } = null!;
|
|
[Inject]
|
|
public IJSRuntime JSRuntime { get; set; } = null!;
|
|
[Inject]
|
|
public NavigationManager NavManager{ get; set; } = null!;
|
|
|
|
private bool isForced = false;
|
|
|
|
protected async void insertSession()
|
|
{
|
|
var alert = await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler creare una nuova sessione per il magazzino selezionato?");
|
|
|
|
if (alert)
|
|
{
|
|
ScanDataModel newScan = new ScanDataModel()
|
|
{
|
|
DtScan = DateTime.Now,
|
|
UserScan = userScan,
|
|
IsForced = false,
|
|
CodArticolo = UDC.lottoNav.CodArt,
|
|
Lotto = UDC.lottoNav.Lotto,
|
|
RifExt = UDC.lottoNav.RifExt,
|
|
Qty = UDC.Qta,
|
|
Note = UDC.Note,
|
|
IsKnown = true,
|
|
IsUnique = true,
|
|
InveSessID = sessID
|
|
};
|
|
await MIService.InsertNewScansione(newScan);
|
|
NavManager.NavigateTo(NavManager.Uri, true);
|
|
}
|
|
else
|
|
{
|
|
NavManager.NavigateTo(NavManager.Uri, true);
|
|
}
|
|
|
|
}
|
|
}
|
|
} |