5e76d56abe
- Fix visualizzazione post update dei vari componenti
88 lines
2.4 KiB
C#
88 lines
2.4 KiB
C#
using Microsoft.AspNetCore.Components;
|
|
using Microsoft.JSInterop;
|
|
using MP.Data.DbModels;
|
|
using MP.SPEC.Data;
|
|
|
|
namespace MP.SPEC.Components.ProdKit
|
|
{
|
|
public partial class KitVerify
|
|
{
|
|
#region Public Properties
|
|
|
|
[Parameter]
|
|
public string KeyFilt { get; set; } = "";
|
|
|
|
[Parameter]
|
|
public List<TksScoreModel> AllRecTSM { get; set; } = new List<TksScoreModel>();
|
|
[Parameter]
|
|
public List<WipSetupKitModel> AllRecWSM { get; set; } = new List<WipSetupKitModel>();
|
|
[Parameter]
|
|
public List<PODLExpModel> AllRecPODL { get; set; } = new List<PODLExpModel>();
|
|
|
|
[Parameter]
|
|
public EventCallback<bool> EC_KitCreated { get; set; }
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Protected Properties
|
|
|
|
[Inject]
|
|
protected IJSRuntime JSRuntime { get; set; } = null!;
|
|
|
|
[Inject]
|
|
protected MpDataService MDService { get; set; } = null!;
|
|
|
|
#endregion Protected Properties
|
|
|
|
#region Protected Methods
|
|
|
|
protected override void OnParametersSet()
|
|
{
|
|
ReloadData();
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
|
|
#region Private Fields
|
|
|
|
private List<TksScoreModel> ListRecScore = new List<TksScoreModel>();
|
|
private List<PODLExpModel> ListRecPODL = new List<PODLExpModel>();
|
|
|
|
#endregion Private Fields
|
|
|
|
#region Private Methods
|
|
|
|
/// <summary>
|
|
/// Crea una NUOVA istanza KIT
|
|
/// </summary>
|
|
/// <param name="currRec">Record selezionato da generare x Assieme/KIT</param>
|
|
private async Task DoCreatePOdl(TksScoreModel currRec)
|
|
{
|
|
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler creare il PODL del KIT selezionato?"))
|
|
return;
|
|
|
|
// eseguo stored...
|
|
bool fatto = MDService.IstKitInsertByWKS(currRec.CodArtParent, KeyFilt);
|
|
if (fatto)
|
|
{
|
|
// segnalo update
|
|
await EC_KitCreated.InvokeAsync(true);
|
|
}
|
|
}
|
|
|
|
private void ReloadData()
|
|
{
|
|
ListRecScore = AllRecTSM.ToList();
|
|
ListRecPODL = AllRecPODL.ToList();
|
|
numRecWsm = AllRecWSM.Count();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Num record composizione kit...
|
|
/// </summary>
|
|
private int numRecWsm = 0;
|
|
|
|
|
|
#endregion Private Methods
|
|
}
|
|
} |