diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs
index 8fba916b..a0d843ec 100644
--- a/MP.Data/Controllers/MpSpecController.cs
+++ b/MP.Data/Controllers/MpSpecController.cs
@@ -1686,6 +1686,25 @@ namespace MP.Data.Controllers
return fatto;
}
+ ///
+ /// Effettua il task di eliminazione PODL KIT + istanze + riattivazione PODL originali disattivate tramite stored
+ ///
+ /// IdxPODL parent
+ public bool PodlIstKitDelete(int IdxPODL)
+ {
+ bool answ = false;
+ using (var dbCtx = new MoonProContext(_configuration))
+ {
+ var pIdxPODL = new SqlParameter("@IdxPODL", IdxPODL);
+
+ var dbResult = dbCtx
+ .Database
+ .ExecuteSqlRaw("EXEC dbo.stp_PodlIstKit_delete @IdxPODL", pIdxPODL);
+ answ = true;
+ }
+ return answ;
+ }
+
///
/// Update Record
///
diff --git a/MP.SPEC/Components/ProdKit/GestKitPodl.razor.cs b/MP.SPEC/Components/ProdKit/GestKitPodl.razor.cs
index a93af333..ebb38f9f 100644
--- a/MP.SPEC/Components/ProdKit/GestKitPodl.razor.cs
+++ b/MP.SPEC/Components/ProdKit/GestKitPodl.razor.cs
@@ -117,30 +117,12 @@ namespace MP.SPEC.Components.ProdKit
if (!await JSRuntime.InvokeAsync("confirm", "Eliminazione PODL + Istanze KIT: sei sicuro di voler procedere?"))
return;
- await Task.Delay(1);
- // chiamare nuova stored!!!
-#if false
- var done = await MDService.IstKitDelete(selRec);
-#endif
+ // da provare...
+ var done = MDService.PodlIstKitDelete(selRec.IdxPromessa);
EditRecord = null;
ReloadData();
- await Task.Delay(1);
}
-#if false
- protected async Task DoUpdate(IstanzeKitModel selRec)
- {
- if (!await JSRuntime.InvokeAsync("confirm", "Confermi di voler salvare le modifiche?"))
- return;
-
- await Task.Delay(1);
- var done = await MDService.IstKitUpsert(selRec);
- EditRecord = null;
- ReloadData();
- await Task.Delay(1);
- }
-#endif
-
private bool OptAdmKitEnabled = false;
protected override void OnInitialized()
diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs
index bf16aea3..77dd4df1 100644
--- a/MP.SPEC/Data/MpDataService.cs
+++ b/MP.SPEC/Data/MpDataService.cs
@@ -1218,7 +1218,7 @@ namespace MP.SPEC.Data
string currKey = $"{Utils.redisPOdlByCodArt}:{CodArticolo}:{avType}";
// cerco in redis dato valore sel macchina...
RedisValue rawData = redisDb.StringGet(currKey);
- if (rawData.HasValue && rawData.Length()>2)
+ if (rawData.HasValue && rawData.Length() > 2)
{
var rawResult = JsonConvert.DeserializeObject>($"{rawData}");
if (rawResult != null)
@@ -1815,6 +1815,21 @@ namespace MP.SPEC.Data
return result;
}
+ ///
+ /// Effettua il task di eliminazione PODL KIT + istanze + riattivazione PODL originali disattivate tramite stored
+ ///
+ /// IdxPODL parent
+ public bool PodlIstKitDelete(int IdxPODL)
+ {
+ bool fatto = false;
+ // salvo
+ fatto = dbController.PodlIstKitDelete(IdxPODL);
+ // svuoto cache
+ RedisValue pattern = $"{Utils.redisKit}:*";
+ ExecFlushRedisPattern(pattern);
+ return fatto;
+ }
+
///
/// Elenco PODL non avviati filtrati x articolo, KeyRich (che contiene stato)
///