- Test eliminazione kit + test dettaglio kit
- fix display show/hide dettaglio KIT
This commit is contained in:
Samuele Locatelli
2025-04-14 07:57:33 +02:00
parent 3b44311f6a
commit beb7ebd509
8 changed files with 68 additions and 60 deletions
+1 -1
View File
@@ -1700,7 +1700,7 @@ namespace MP.Data.Controllers
var dbResult = dbCtx
.Database
.ExecuteSqlRaw("EXEC dbo.stp_PodlIstKit_delete @IdxPODL", pIdxPODL);
answ = true;
answ = dbResult != 0;
}
return answ;
}
+2 -1
View File
@@ -62,7 +62,7 @@
<div>@record.NumPezzi</div>
</td>
<td class="text-end">
@if (ShowAllDet)
@if (ShowAllDet || ListPodlExpl2Show.Contains(record.IdxPromessa))
{
<table class="table table-sm table-striped small shadow">
<thead>
@@ -92,6 +92,7 @@
}
else
{
<button class="btn btn-sm" onclick="ShowDetail(record)"></button>
<span><b>@ListDetIKCount(record.IdxPromessa)</b> ordini</span>
}
</td>
+60 -53
View File
@@ -10,11 +10,14 @@ namespace MP.SPEC.Components.ProdKit
#region Public Properties
[Parameter]
public List<PODLExpModel> PodlRecords { get; set; } = new List<PODLExpModel>();
public EventCallback<bool> EC_ListUpdated { get; set; }
[Parameter]
public List<IstanzeKitModel> IstKitRecords { get; set; } = new List<IstanzeKitModel>();
[Parameter]
public List<PODLExpModel> PodlRecords { get; set; } = new List<PODLExpModel>();
#endregion Public Properties
#region Public Methods
@@ -30,10 +33,6 @@ namespace MP.SPEC.Components.ProdKit
#region Protected Fields
#if false
protected int kitCount = 0;
#endif
protected int totalCount = 0;
#endregion Protected Fields
@@ -90,8 +89,7 @@ namespace MP.SPEC.Components.ProdKit
protected bool DelEnabled(PODLExpModel reqRec)
{
bool answ = false;
bool answ = reqRec.IdxOdl == 0;
return answ;
}
@@ -118,13 +116,12 @@ namespace MP.SPEC.Components.ProdKit
return;
// da provare...
var done = MDService.PodlIstKitDelete(selRec.IdxPromessa);
var done = MDService.PodlIstKitDelete(selRec.IdxPromessa);
EditRecord = null;
ReloadData();
await EC_ListUpdated.InvokeAsync(true);
}
private bool OptAdmKitEnabled = false;
protected override void OnInitialized()
{
numRecord = 5;
@@ -184,6 +181,14 @@ namespace MP.SPEC.Components.ProdKit
numRecord = newNum;
}
protected void ShowDetail(PODLExpModel reqRec)
{
if (!ListPodlExpl2Show.Contains(reqRec.IdxPromessa))
{
ListPodlExpl2Show.Add(reqRec.IdxPromessa);
}
}
protected void UpdateData()
{
EditRecord = null;
@@ -200,9 +205,15 @@ namespace MP.SPEC.Components.ProdKit
private bool doSearchArt = false;
private PODLExpModel? EditRecord = null;
private List<PODLExpModel>? ListRecordsPODL;
/// <summary>
/// Elenco singoli podl esplosi
/// </summary>
private List<int> ListPodlExpl2Show = new List<int>();
private List<PODLExpModel>? ListRecordsPODL;
private int minChar = 2;
private bool OptAdmKitEnabled = false;
/// <summary>
/// RegExp x SAVE KIT
@@ -224,6 +235,10 @@ namespace MP.SPEC.Components.ProdKit
/// </summary>
private string regExp_OK = "#ROK";
/// <summary>
/// mostra tutti i dettagli delle istanze x PODL
/// </summary>
private bool ShowAllDet = false;
#endregion Private Fields
@@ -233,6 +248,11 @@ namespace MP.SPEC.Components.ProdKit
private int _numRecord { get; set; } = 10;
private string cssDetail
{
get => ShowAllDet ? "btn-secondary" : "btn-primary";
}
private int currPage
{
get => _currPage;
@@ -246,6 +266,11 @@ namespace MP.SPEC.Components.ProdKit
}
}
private string iconDetail
{
get => ShowAllDet ? "fa-chevron-up" : "fa-chevron-down";
}
private bool isLoading { get; set; } = false;
private int numRecord
@@ -269,23 +294,6 @@ namespace MP.SPEC.Components.ProdKit
#region Private Methods
private void ReloadData()
{
isLoading = true;
// reset preliminare...
ListRecordsPODL = new List<PODLExpModel>();
ListRecordsPODL= PodlRecords
.Where(x => !string.IsNullOrEmpty(x.KeyRichiesta) && x.Attivabile && x.KeyRichiesta.StartsWith("KIT"))
.Skip(numRecord * (currPage - 1))
.Take(numRecord)
.ToList();
// conto e filtro
totalCount = ListRecordsPODL.Count;
isLoading = false;
}
/// <summary>
/// Elenco record dettaglio IK dato IdxPODL
/// </summary>
@@ -299,7 +307,6 @@ namespace MP.SPEC.Components.ProdKit
return answ;
}
/// <summary>
/// Conteggio record dettaglio IK dato IdxPODL
/// </summary>
@@ -307,35 +314,28 @@ namespace MP.SPEC.Components.ProdKit
/// <returns></returns>
private int ListDetIKCount(int idxPODL)
{
int answ = IstKitRecords
.Where(x => x.IdxPodlParent == idxPODL)
.Count();
int answ = IstKitRecords
.Where(x => x.IdxPodlParent == idxPODL)
.Count();
return answ;
}
private void ToggleDetail()
private void ReloadData()
{
ShowAllDet = !ShowAllDet;
}
isLoading = true;
// reset preliminare...
ListRecordsPODL = new List<PODLExpModel>();
private string cssDetail
{
get => ShowAllDet ? "btn-secondary" : "btn-primary";
}
private string iconDetail
{
get => ShowAllDet ? "fa-chevron-up" : "fa-chevron-down";
}
ListRecordsPODL = PodlRecords
.Where(x => !string.IsNullOrEmpty(x.KeyRichiesta) && x.Attivabile && x.KeyRichiesta.StartsWith("KIT"))
.Skip(numRecord * (currPage - 1))
.Take(numRecord)
.ToList();
/// <summary>
/// mostra tutti i dettagli delle istanze x PODL
/// </summary>
private bool ShowAllDet = false;
/// <summary>
/// Elenco singoli podl esplosi
/// </summary>
private List<int> ListPodlExpl = new List<int>();
// conto e filtro
totalCount = ListRecordsPODL.Count;
isLoading = false;
}
/// <summary>
/// Toggle modale ricerca articoli
@@ -355,11 +355,18 @@ namespace MP.SPEC.Components.ProdKit
{
#if false
EditRecord.CodArtChild = codArt;
doSearchArt = false;
doSearchArt = false;
#endif
}
}
private void ToggleDetail()
{
ShowAllDet = !ShowAllDet;
// svuoto cmq lista sel singoli...
ListPodlExpl2Show = new List<int>();
}
#endregion Private Methods
}
}
+1 -1
View File
@@ -20,7 +20,7 @@
</div>
}
<div class="@KPColClass mb-1 px-1">
<GestKitPodl PodlRecords="@listPOdlAct" IstKitRecords="@listIKP"></GestKitPodl>
<GestKitPodl PodlRecords="@listPOdlAct" IstKitRecords="@listIKP" EC_ListUpdated="ForceReloadData"></GestKitPodl>
</div>
}
</div>
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.SPEC</RootNamespace>
<Version>6.16.2504.1207</Version>
<Version>6.16.2504.1407</Version>
<UserSecretsId>1800a78a-6ff1-40f9-b490-87fb8bfc1394</UserSecretsId>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2504.1207</h4>
<h4>Versione: 6.16.2504.1407</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2504.1207
6.16.2504.1407
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2504.1207</version>
<version>6.16.2504.1407</version>
<url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>