COdeMaid cleanup

This commit is contained in:
Samuele Locatelli
2025-05-15 16:11:21 +02:00
parent ea66ab89c5
commit ced2cd90a3
2 changed files with 38 additions and 40 deletions
+37 -38
View File
@@ -7,7 +7,6 @@ using MP.SPEC.Data;
using MP.SPEC.Services;
using NLog;
namespace MP.SPEC.Components
{
public partial class ListODL : IDisposable
@@ -85,6 +84,21 @@ namespace MP.SPEC.Components
#region Protected Methods
/// <summary>
/// Verifica se sia un articolo di tipo "KIT" x mostrare show dettaglio
/// </summary>
/// <param name="CodArticolo"></param>
/// <returns></returns>
protected bool CheckIsKit(string CodArticolo)
{
bool answ = false;
if (ListArtKit != null && ListArtKit.Count > 0)
{
answ = ListArtKit.Count(x => x.CodArticolo == CodArticolo) > 0;
}
return answ;
}
/// <summary>
/// Registra chiusura ODL alla data indicata
/// </summary>
@@ -103,7 +117,7 @@ namespace MP.SPEC.Components
// RESETTO task x setComm, setArt, SetPzComm
await MpIoApiCall.addTask2Exe(currRecord.IdxMacchina, "setArt", "");
await MpIoApiCall.addTask2Exe(currRecord.IdxMacchina, "setComm", "");
await MpIoApiCall.addTask2Exe(currRecord.IdxMacchina, "setPzComm","");
await MpIoApiCall.addTask2Exe(currRecord.IdxMacchina, "setPzComm", "");
// richiesto anche sync DB
await MpIoApiCall.callSyncDb(currRecord.IdxMacchina);
@@ -179,6 +193,19 @@ namespace MP.SPEC.Components
return answ;
}
protected void KitToggleDetail(string? selCodArt)
{
if (!string.IsNullOrEmpty(selCodArt))
{
ListKitTemplate = MDService.TemplateKitFilt(selCodArt, "");
}
else
{
ListKitTemplate = null;
}
showKitDetail = !showKitDetail;
}
protected override async Task OnInitializedAsync()
{
ListStati = await MDService.AnagStatiComm();
@@ -268,6 +295,12 @@ namespace MP.SPEC.Components
/// </summary>
private string KeyFolderMan = "OP_ODL_FOLDER";
/// <summary>
/// Elenco articoli tipo KIT
/// </summary>
private List<AnagArticoliModel>? ListArtKit;
private List<TemplateKitModel>? ListKitTemplate = null;
private List<StatODLModel>? ListOdlStats;
private List<ODLExpModel>? ListRecords;
@@ -276,6 +309,7 @@ namespace MP.SPEC.Components
private List<ODLExpModel>? SearchRecords;
private bool showKitDetail = false;
private ODLExpModel? statRecord = null;
#endregion Private Fields
@@ -336,7 +370,7 @@ namespace MP.SPEC.Components
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
await Task.Delay(1);
#if false
await InvokeAsync(StateHasChanged);
await InvokeAsync(StateHasChanged);
#endif
isLoading = false;
}
@@ -369,40 +403,5 @@ namespace MP.SPEC.Components
}
#endregion Private Methods
/// <summary>
/// Verifica se sia un articolo di tipo "KIT" x mostrare show dettaglio
/// </summary>
/// <param name="CodArticolo"></param>
/// <returns></returns>
protected bool CheckIsKit(string CodArticolo)
{
bool answ = false;
if (ListArtKit != null && ListArtKit.Count > 0)
{
answ = ListArtKit.Count(x => x.CodArticolo == CodArticolo) > 0;
}
return answ;
}
protected void KitToggleDetail(string? selCodArt)
{
if (!string.IsNullOrEmpty(selCodArt))
{
ListKitTemplate = MDService.TemplateKitFilt(selCodArt, "");
}
else
{
ListKitTemplate = null;
}
showKitDetail = !showKitDetail;
}
/// <summary>
/// Elenco articoli tipo KIT
/// </summary>
private List<AnagArticoliModel>? ListArtKit;
private List<TemplateKitModel>? ListKitTemplate = null;
private bool showKitDetail = false;
}
}
+1 -2
View File
@@ -175,7 +175,6 @@ namespace MP.SPEC.Components
showKitDetail = !showKitDetail;
}
protected override async Task OnInitializedAsync()
{
ListStati = await MDService.AnagStatiComm();
@@ -346,8 +345,8 @@ namespace MP.SPEC.Components
private List<AnagArticoliModel>? ListArtKit;
private List<TemplateKitModel>? ListKitTemplate = null;
private List<PODLExpModel>? ListRecords;
private List<PODLExpModel>? ListPOdlKit;
private List<PODLExpModel>? ListRecords;
/// <summary>
/// Elenco stati