diff --git a/EgwCoreLib.Lux.Data/Controllers/LuxController.cs b/EgwCoreLib.Lux.Data/Controllers/LuxController.cs
index 6a409cbe..01666d64 100644
--- a/EgwCoreLib.Lux.Data/Controllers/LuxController.cs
+++ b/EgwCoreLib.Lux.Data/Controllers/LuxController.cs
@@ -2194,6 +2194,55 @@ namespace EgwCoreLib.Lux.Data.Controllers
}
return answ;
}
+ ///
+ /// Aggiornamento valore ImgType da tipo Prodotto sellingItem ancestor
+ ///
+ ///
+ ///
+ internal async Task OffertRowFixImgTypeAsync(int offertID)
+ {
+ bool answ = false;
+ //using (DataLayerContext dbCtx = new DataLayerContext(_config))
+ using (DataLayerContext dbCtx = new DataLayerContext())
+ {
+#if false
+ try
+ {
+#endif
+ var currList = await dbCtx
+ .DbSetOfferRow
+ .Where(x => x.OfferID == offertID)
+ .Include(s => s.SellingItemNav)
+ .ToListAsync();
+ // se trovato --> verifico valori differenti, aggiorno e restituisco da calcolare
+ if (currList != null)
+ {
+ var list2fix = currList.Where(x => x.ImgType == ImageType.ND).ToList();
+ if (list2fix != null && list2fix.Count > 0)
+ {
+ // sistemo ImgType
+ foreach (var item in list2fix)
+ {
+ // se รจ calcolato il selling item --> img calcolata
+ if (item.SellingItemNav != null && (item.SellingItemNav.SourceType == ItemSourceType.Jwd || item.SellingItemNav.SourceType == ItemSourceType.FileBTL))
+ item.ImgType = ImageType.Calculated;
+ dbCtx.Entry(item).State = EntityState.Modified;
+ }
+ // salvo...
+ var result = await dbCtx.SaveChangesAsync();
+ answ = result > 0;
+ }
+ }
+#if false
+ }
+ catch (Exception exc)
+ {
+ Log.Error($"Eccezione durante OffertRowFixUid{Environment.NewLine}{exc}");
+ }
+#endif
+ }
+ return answ;
+ }
///
/// Effettua update stato await BOM/PRICE per l'offerta indicata
diff --git a/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs b/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs
index 29e5e0a9..8d13f81c 100644
--- a/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs
+++ b/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs
@@ -1258,6 +1258,42 @@ namespace EgwCoreLib.Lux.Data.Services
return answ;
}
+ ///
+ /// Aggiornamento valore UID non calcolato + ritorno elenco UID da aggiornare
+ ///
+ ///
+ ///
+ public async Task OffertRowFixImgType(int OffertID)
+ {
+ using var activity = StartActivity();
+ string source = "DB+REDIS";
+ bool answ = false;
+ try
+ {
+ // calcolo
+ answ = await dbController.OffertRowFixImgTypeAsync(OffertID);
+ // svuoto cache...
+ await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:Offers:*");
+ await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:OfferRows:*");
+ }
+ catch (Exception exc)
+ {
+ string exMsg = $"Eccezione durante OffertRowFixImgType";
+ LogTrace($"{exMsg}{Environment.NewLine}{exc}", LogLevel.Error);
+ // traccio errore
+ activity?.SetStatus(ActivityStatusCode.Error, exc.Message);
+ activity?.AddEvent(new ActivityEvent("exception", tags: new ActivityTagsCollection {
+ { "exception.type", exc.GetType().Name },
+ { "exception.message", exc.Message },
+ { "exception.stacktrace", exc.StackTrace }
+ }));
+ }
+ activity?.SetTag("data.source", source);
+ LogTrace($"{source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms");
+ return answ;
+ }
+
+
///
/// Effettua update stato await BOM/PRICE per l'offerta indicata
///
@@ -1376,6 +1412,7 @@ namespace EgwCoreLib.Lux.Data.Services
{
// sistemo UID...
await OffertRowFixUid(updRec.OfferID);
+ await OffertRowFixImgType(updRec.OfferID);
dbResult = await dbController.OfferRowGetByIdAsync(updRec.OfferRowID);
}
else
diff --git a/Lux.UI/Components/Compo/OfferRowMan.razor b/Lux.UI/Components/Compo/OfferRowMan.razor
index 94d0a7b0..95e867d3 100644
--- a/Lux.UI/Components/Compo/OfferRowMan.razor
+++ b/Lux.UI/Components/Compo/OfferRowMan.razor
@@ -35,18 +35,17 @@ else