Files
mapo-core/MP.INVE/Pages/Test.razor.cs
T
2022-12-13 18:02:46 +01:00

77 lines
2.9 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.INVE.Data;
using MP.Data.DatabaseModels;
namespace MP.INVE.Pages
{
public partial class Test
{
[Inject]
MiDataService MIService { get; set; } = null!;
[Inject]
IJSRuntime JSRuntime { get; set; } = null!;
protected string rawScan { get; set; } = null!;
List<ScanDataModel>? elencoSCAN;
protected override async Task OnParametersSetAsync()
{
await Task.Delay(1);
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
//if (firstRender)
//{
// await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{101}");
// await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{101}", "20MFI000000001");
// await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{102}");
// await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{102}", "20MSL000000002");
// await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{103}");
// await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{103}", "21MFI000000017");
// await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{104}");
// await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{104}", "M200000019");
// await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{105}");
// await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{105}", "M210000055");
// await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{106}");
// await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{106}", "027407");
// await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{107}");
// await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{107}", "ABCDE");
//}
}
protected void saveScan(string newScan)
{
if (!string.IsNullOrEmpty(newScan))
{
rawScan = newScan;
elencoSCAN = MIService.ScanList().Where(x => x.ScanValue == newScan).ToList();
}
}
protected async Task deleteScan(ScanDataModel scan)
{
await MIService.deleteScansione(scan);
}
private string CodUDC { get; set; } = null!;
}
}