+ @if (showKitDetail)
+ {
+
+ }
@if (currRecord != null && !showStats && isCurrOdl)
{
@@ -102,7 +105,13 @@ else
- @record.CodArticolo
+
+ @record.CodArticolo
+ @if (CheckIsKit(record.CodArticolo))
+ {
+
+ }
+
@record.DescArticolo
|
diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs
index 48ba8531..2b9dbc00 100644
--- a/MP.SPEC/Components/ListODL.razor.cs
+++ b/MP.SPEC/Components/ListODL.razor.cs
@@ -182,6 +182,7 @@ namespace MP.SPEC.Components
protected override async Task OnInitializedAsync()
{
ListStati = await MDService.AnagStatiComm();
+ ListArtKit = MDService.ArticoliGetByTipo("KIT", "*");
string SPEC_PODL_gest = await MDService.ConfigTryGetAsync("SPEC_PODL_gest");
if (!string.IsNullOrEmpty(SPEC_PODL_gest))
{
@@ -368,5 +369,42 @@ namespace MP.SPEC.Components
}
#endregion Private Methods
+
+ ///
+ /// Verifica se sia un articolo di tipo "KIT" x mostrare show dettaglio
+ ///
+ ///
+ ///
+ 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)
+ {
+ CodArtParent = selCodArt ?? "";
+ if (!string.IsNullOrEmpty(CodArtParent))
+ {
+ ListKitTemplate = MDService.TemplateKitFilt(CodArtParent, "");
+ }
+ else
+ {
+ ListKitTemplate = null;
+ }
+ showKitDetail = !showKitDetail;
+ }
+
+ ///
+ /// Elenco articoli tipo KIT
+ ///
+ private List? ListArtKit;
+
+ private List? ListKitTemplate = null;
+ private bool showKitDetail = false;
+ private string CodArtParent = "";
}
}
\ No newline at end of file
diff --git a/MP.SPEC/Components/ListPODL.razor b/MP.SPEC/Components/ListPODL.razor
index 4b9d12e2..90d57359 100644
--- a/MP.SPEC/Components/ListPODL.razor
+++ b/MP.SPEC/Components/ListPODL.razor
@@ -1,5 +1,4 @@
@using MP.SPEC.Components
-@using MP.SPEC.Components.ProdKit
@using MP.SPEC.Data
@if (ListRecords == null || isLoading)
@@ -16,7 +15,7 @@ else
@if (showKitDetail)
{
-
+
}
@@ -118,7 +117,7 @@ else
@record.CodArticolo
@if (CheckIsKit(record.CodArticolo))
{
-
+
}
@record.DescArticolo
diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs
index e4725619..892ddc08 100644
--- a/MP.SPEC/Data/MpDataService.cs
+++ b/MP.SPEC/Data/MpDataService.cs
@@ -359,7 +359,7 @@ namespace MP.SPEC.Data
}
else
{
- result = dbController.ArticoliGetByTipo(tipo);
+ result = dbController.ArticoliGetByTipo(tipo, azienda);
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
|