diff --git a/EgwCoreLib.Lux.Data/Controllers/LuxController.cs b/EgwCoreLib.Lux.Data/Controllers/LuxController.cs
index e8e1aace..1efef7fd 100644
--- a/EgwCoreLib.Lux.Data/Controllers/LuxController.cs
+++ b/EgwCoreLib.Lux.Data/Controllers/LuxController.cs
@@ -401,432 +401,6 @@ namespace EgwCoreLib.Lux.Data.Controllers
return answ;
}
-#if false
- ///
- /// Elimina riga e sposta eventuali righe successive...
- ///
- ///
- ///
- internal async Task OrderRowDelete(OrderRowModel rec2Del)
- {
- bool answ = false;
- //using (DataLayerContext dbCtx = new DataLayerContext(_config))
- using (DataLayerContext dbCtx = new DataLayerContext())
- {
- try
- {
- // recupero offerta...
- var currRec = dbCtx
- .DbSetOrderRow
- .Where(x => x.OrderRowID == rec2Del.OrderRowID)
- .FirstOrDefault();
-
- // se trovo procedo
- if (currRec != null)
- {
- // recupero indice attuale...
- int currRowNum = rec2Del.RowNum;
- // cerco righe successive
- var list2move = dbCtx
- .DbSetOrderRow
- .Where(x => x.OrderID == rec2Del.OrderID && x.RowNum > currRowNum)
- .ToList();
- // se ci sono aggiorno!
- if (list2move != null && list2move.Count > 0)
- {
- foreach (var item in list2move)
- {
- item.RowNum--;
- dbCtx.Entry(item).State = EntityState.Modified;
- }
- }
- // infine rimuovo riga
- dbCtx.DbSetOrderRow.Remove(currRec);
- }
-
- // salvo TUTTI i cambiamenti...
- var result = await dbCtx.SaveChangesAsync();
- answ = result > 0;
- }
- catch (Exception exc)
- {
- Log.Error($"Eccezione durante OrderRowDelete{Environment.NewLine}{exc}");
- }
- }
- return answ;
- }
-
- ///
- /// Aggiornamento valore UID non calcolato + ritorno elenco UID da aggiornare
- ///
- ///
- ///
- internal List OrderRowFixUid(int orderID)
- {
- List answ = new List();
- //using (DataLayerContext dbCtx = new DataLayerContext(_config))
- using (DataLayerContext dbCtx = new DataLayerContext())
- {
- try
- {
- var currList = dbCtx
- .DbSetOrderRow
- .Where(x => x.OrderID == orderID)
- .ToList();
- // se trovato --> verifico valori differenti, aggiorno e restituisco da calcolare
- if (currList != null)
- {
- var list2fix = currList.Where(x => string.IsNullOrEmpty(x.OrderRowUID) || x.OrderRowUID != x.OrderRowCode).ToList();
- if (list2fix != null && list2fix.Count > 0)
- {
- // salvo elenco
- answ = list2fix.Select(x => x.OrderRowCode).ToList();
- // sistemo UID
- foreach (var item in list2fix)
- {
- item.OrderRowUID = item.OrderRowCode;
- dbCtx.Entry(item).State = EntityState.Modified;
- }
- // salvo...
- var result = dbCtx.SaveChanges();
- }
- }
- }
- catch (Exception exc)
- {
- Log.Error($"Eccezione durante OrderRowFixUid{Environment.NewLine}{exc}");
- }
- }
- return answ;
- }
-
- ///
- /// Elenco righe Ordine specificato
- ///
- ///
- ///
- internal List OrderRowGetByOffer(int OrderID)
- {
- List dbResult = new List();
- //using (DataLayerContext dbCtx = new DataLayerContext(_config))
- using (DataLayerContext dbCtx = new DataLayerContext())
- {
- try
- {
- dbResult = dbCtx
- .DbSetOrderRow
- .Where(x => x.OrderID == OrderID)
- .Include(s => s.SellingItemNav)
- //.Include(d => d.DealerNav)
- .ToList();
- }
- catch (Exception exc)
- {
- Log.Error($"Eccezione durante OrderRowGetByOffer{Environment.NewLine}{exc}");
- }
- }
- return dbResult;
- }
-
- ///
- /// Elenco righe ordine dato stato richiesto
- ///
- ///
- ///
- internal List OrderRowGetByState(OrderStates reqState, DateTime dtStart, DateTime dtEnd)
- {
- List dbResult = new List();
- //using (DataLayerContext dbCtx = new DataLayerContext(_config))
- using (DataLayerContext dbCtx = new DataLayerContext())
- {
- try
- {
- dbResult = dbCtx
- .DbSetOrderRow
- .Where(x => x.OrderRowState == reqState && x.Inserted >= dtStart && x.Inserted <= dtEnd)
- .Include(s => s.SellingItemNav)
- //.Include(d => d.DealerNav)
- .ToList();
- }
- catch (Exception exc)
- {
- Log.Error($"Eccezione durante OrderRowGetByState{Environment.NewLine}{exc}");
- }
- }
- return dbResult;
- }
-
- ///
- /// Elenco righe ordine dato periodo + stato richiesto MINIMO
- ///
- ///
- ///
- internal List OrderRowGetByStateMin(OrderStates reqState, DateTime dtStart, DateTime dtEnd)
- {
- List dbResult = new List();
- //using (DataLayerContext dbCtx = new DataLayerContext(_config))
- using (DataLayerContext dbCtx = new DataLayerContext())
- {
- try
- {
- dbResult = dbCtx
- .DbSetOrderRow
- .Where(x => x.OrderRowState >= reqState && x.Inserted >= dtStart && x.Inserted <= dtEnd)
- .Include(s => s.SellingItemNav)
- //.Include(d => d.DealerNav)
- .ToList();
- }
- catch (Exception exc)
- {
- Log.Error($"Eccezione durante OrderRowGetByStateMin{Environment.NewLine}{exc}");
- }
- }
- return dbResult;
- }
-
- ///
- /// Riga Ordine dato suo UID
- ///
- ///
- ///
- internal OrderRowModel OrderRowGetByUID(string OrderRowUID)
- {
- OrderRowModel? dbResult = null;
- //using (DataLayerContext dbCtx = new DataLayerContext(_config))
- using (DataLayerContext dbCtx = new DataLayerContext())
- {
- try
- {
- dbResult = dbCtx
- .DbSetOrderRow
- .Include(s => s.SellingItemNav)
- .FirstOrDefault(x => x.OrderRowUID == OrderRowUID);
- }
- catch (Exception exc)
- {
- Log.Error($"Eccezione durante OrderRowGetByUID{Environment.NewLine}{exc}");
- }
- }
- return dbResult;
- }
-
- ///
- /// Effettua update stato await BOM/PRICE per l'Ordine indicato
- ///
- /// ID singola riga ordine
- /// Se non nullo è il nuovo stato await BOM
- /// Se non nullo è stato await Price
- ///
- internal async Task OrderRowUpdateAwaitState(int orderRowID, bool? awaitBom, bool? awaitPrice)
- {
- bool answ = false;
- //using (DataLayerContext dbCtx = new DataLayerContext(_config))
- using (DataLayerContext dbCtx = new DataLayerContext())
- {
- try
- {
- // recupero righe ordine...
- var currRec = dbCtx
- .DbSetOrderRow
- .Where(x => x.OrderRowID == orderRowID)
- .FirstOrDefault();
-
- // aggiorno parametri (se inviati)
- if (currRec != null)
- {
- currRec.AwaitBom = awaitBom ?? currRec.AwaitBom;
- currRec.AwaitPrice = awaitPrice ?? currRec.AwaitPrice;
- dbCtx.Entry(currRec).State = EntityState.Modified;
- }
-
- // salvo i cambiamenti...
- var result = await dbCtx.SaveChangesAsync();
- answ = result > 0;
- }
- catch (Exception exc)
- {
- Log.Error($"Eccezione durante OrderRowUpdateAwaitState{Environment.NewLine}{exc}");
- }
- }
- return answ;
- }
-
- ///
- /// Aggiorno sul DB i dati del file associato
- ///
- ///
- ///
- internal async Task OrderRowUpdateFileData(OrderRowModel updRec)
- {
- bool answ = false;
- //using (DataLayerContext dbCtx = new DataLayerContext(_config))
- using (DataLayerContext dbCtx = new DataLayerContext())
- {
- try
- {
- // recupero righe offerta...
- var currRec = dbCtx
- .DbSetOrderRow
- .Where(x => x.OrderRowID == updRec.OrderRowID)
- .FirstOrDefault();
-
- // aggiorno parametri (se inviati)
- if (currRec != null)
- {
- currRec.FileName = updRec.FileName;
- currRec.FileResource = updRec.FileResource;
- currRec.FileSize = updRec.FileSize;
- currRec.SerStruct = updRec.SerStruct;
- dbCtx.Entry(currRec).State = EntityState.Modified;
- }
-
- // salvo i cambiamenti...
- var result = await dbCtx.SaveChangesAsync();
- answ = result > 0;
- }
- catch (Exception exc)
- {
- Log.Error($"Eccezione durante OrderRowUpdateFileData{Environment.NewLine}{exc}");
- }
- }
- return answ;
- }
-
- ///
- /// Effettua update serStruct per l'Ordine indicato
- ///
- /// ID singola riga Ordine
- /// Valore serializzatoe
- ///
- internal async Task OrderRowUpdateSerStruct(int orderRowID, string serStruct)
- {
- bool answ = false;
- //using (DataLayerContext dbCtx = new DataLayerContext(_config))
- using (DataLayerContext dbCtx = new DataLayerContext())
- {
- try
- {
- // recupero righe offerta...
- var currRec = dbCtx
- .DbSetOrderRow
- .Where(x => x.OrderRowID == orderRowID)
- .FirstOrDefault();
-
- // aggiorno parametri (se inviati)
- if (currRec != null)
- {
- currRec.SerStruct = serStruct;
- dbCtx.Entry(currRec).State = EntityState.Modified;
- }
-
- // salvo i cambiamenti...
- var result = await dbCtx.SaveChangesAsync();
- answ = result > 0;
- }
- catch (Exception exc)
- {
- Log.Error($"Eccezione durante OrderRowUpdateSerStruct{Environment.NewLine}{exc}");
- }
- }
- return answ;
- }
-
- ///
- /// Aggiorna stato riga ordine
- ///
- ///
- ///
- ///
- internal async Task OrderRowUpdateState(int orderRowID, OrderStates reqState)
- {
- bool answ = false;
- //using (DataLayerContext dbCtx = new DataLayerContext(_config))
- using (DataLayerContext dbCtx = new DataLayerContext())
- {
- try
- {
- // recupero righe offerta...
- var currRec = dbCtx
- .DbSetOrderRow
- .Where(x => x.OrderRowID == orderRowID)
- .FirstOrDefault();
-
- // aggiorno parametri (se inviati)
- if (currRec != null)
- {
- currRec.OrderRowState = reqState;
- dbCtx.Entry(currRec).State = EntityState.Modified;
- }
-
- // salvo i cambiamenti...
- var result = await dbCtx.SaveChangesAsync();
- answ = result > 0;
- }
- catch (Exception exc)
- {
- Log.Error($"Eccezione durante OrderRowUpdateState{Environment.NewLine}{exc}");
- }
- }
- return answ;
- }
-
- ///
- /// Add riga ordine
- ///
- ///
- ///
- internal async Task OrderRowUpsert(OrderRowModel updRec)
- {
- bool answ = false;
- //using (DataLayerContext dbCtx = new DataLayerContext(_config))
- using (DataLayerContext dbCtx = new DataLayerContext())
- {
- try
- {
- // recupero offerta...
- var currRec = dbCtx
- .DbSetOrderRow
- .Where(x => x.OrderRowID == updRec.OrderRowID)
- .FirstOrDefault();
-
- // se non trovo aggiungo
- if (currRec == null)
- {
- dbCtx.DbSetOrderRow.Add(updRec);
- // se ci sono record successivi li devo spostare...
- var list2move = dbCtx
- .DbSetOrderRow
- .Where(x => x.OrderID == updRec.OrderID && x.RowNum >= updRec.RowNum)
- .ToList();
- if (list2move != null && list2move.Count > 0)
- {
- foreach (var item2move in list2move)
- {
- item2move.RowNum++;
- dbCtx.Entry(item2move).State = EntityState.Modified;
- }
- }
- }
- // altrimenti aggiorno
- else
- {
- dbCtx.Entry(currRec).CurrentValues.SetValues(updRec);
- }
-
- // salvo TUTTI i cambiamenti...
- var result = await dbCtx.SaveChangesAsync();
- answ = result > 0;
- }
- catch (Exception exc)
- {
- Log.Error($"Eccezione durante OrderRowUpsert{Environment.NewLine}{exc}");
- }
- }
- return answ;
- }
-
-#endif
-
///
/// Add record del solo ProdEstimate
///
diff --git a/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs b/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs
index 6ed2e959..c9b5bb64 100644
--- a/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs
+++ b/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs
@@ -349,320 +349,6 @@ namespace EgwCoreLib.Lux.Data.Services
return answ;
}
-#if false
- ///
- /// Effettua eliminazione della riga Ordine
- ///
- /// Riga ordine coi dati da aggiornare
- ///
- public async Task OrderRowDelete(OrderRowModel updRec)
- {
- using var activity = StartActivity();
- string source = "DB+REDIS";
- // calcolo
- bool fatto = await dbController.OrderRowDelete(updRec);
- // svuoto cache...
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:Orders:*");
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:OrderRows:*");
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:OrderRowsByState:*");
- activity?.SetTag("data.source", source);
- LogTrace($"{source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms");
- return fatto;
- }
-
- ///
- /// Effettua fix UID righe child dell'Ordine indicato e restituisce elenco UID da chiamare x refresh
- ///
- /// Key
- ///
- public async Task> OrderRowFixUid(int OrderID)
- {
- using var activity = StartActivity();
- string source = "DB+REDIS";
- List answ = new List();
- // calcolo
- answ = dbController.OrderRowFixUid(OrderID);
- // svuoto cache...
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:Orders:*");
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:OrderRows:*");
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:OrderRowsByState:*");
- activity?.SetTag("data.source", source);
- LogTrace($"{source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms");
- return answ;
- }
- public async Task> OrderRowFixImgType(int OrderID)
- {
- using var activity = StartActivity();
- string source = "DB+REDIS";
- List answ = new List();
- //// calcolo
- //answ = dbController.OrderRowFixImgType(OrderID);
- // svuoto cache...
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:Orders:*");
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:OrderRows:*");
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:OrderRowsByState:*");
- activity?.SetTag("data.source", source);
- LogTrace($"{source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms");
- return answ;
- }
-
- ///
- /// Elenco righe Ordine specificato
- ///
- ///
- ///
- public async Task> OrderRowGetByOffer(int OrderID)
- {
- using var activity = StartActivity();
- string source = "DB";
- List? result = new List();
- // cerco in redis...
- string currKey = $"{redisBaseKey}:OrderRows:{OrderID}";
- RedisValue rawData = await _redisDb.StringGetAsync(currKey);
- //if (!string.IsNullOrEmpty($"{rawData}"))
- if (rawData.HasValue)
- {
- result = JsonConvert.DeserializeObject>($"{rawData}");
- source = "REDIS";
- }
- else
- {
- result = dbController.OrderRowGetByOffer(OrderID);
- // serializzo e salvo...
- rawData = JsonConvert.SerializeObject(result);
- await _redisDb.StringSetAsync(currKey, rawData, LongCache);
- }
- if (result == null)
- {
- result = new List();
- }
- activity?.SetTag("data.source", source);
- LogTrace($"{source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms");
- return result;
- }
-
- ///
- /// Fornisce OrderRow da stato
- ///
- ///
- ///
- public async Task> OrderRowGetByState(OrderStates reqState, DateTime dtStart, DateTime dtEnd)
- {
- using var activity = StartActivity();
- string source = "DB";
- List? result = new List();
- // cerco in redis...
- string currKey = $"{redisBaseKey}:OrderRows:ByState:{reqState}";
- RedisValue rawData = await _redisDb.StringGetAsync(currKey);
- //if (!string.IsNullOrEmpty($"{rawData}"))
- if (rawData.HasValue)
- {
- result = JsonConvert.DeserializeObject>($"{rawData}");
- source = "REDIS";
- }
- else
- {
- result = dbController.OrderRowGetByState(reqState, dtStart, dtEnd);
- // serializzo e salvo...
- rawData = JsonConvert.SerializeObject(result);
- await _redisDb.StringSetAsync(currKey, rawData, FastCache);
- }
- if (result == null)
- {
- result = new List();
- }
- activity?.SetTag("data.source", source);
- LogTrace($"{source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms");
- return result;
- }
-
- ///
- /// Fornisce OrderRow da stato
- ///
- ///
- ///
- public async Task> OrderRowGetByStateMin(OrderStates reqState, DateTime dtStart, DateTime dtEnd)
- {
- using var activity = StartActivity();
- string source = "DB";
- List? result = new List();
- // cerco in redis...
- string currKey = $"{redisBaseKey}:OrderRows:ByStateMin:{reqState}";
- RedisValue rawData = await _redisDb.StringGetAsync(currKey);
- //if (!string.IsNullOrEmpty($"{rawData}"))
- if (rawData.HasValue)
- {
- result = JsonConvert.DeserializeObject>($"{rawData}");
- source = "REDIS";
- }
- else
- {
- result = dbController.OrderRowGetByStateMin(reqState, dtStart, dtEnd);
- // serializzo e salvo...
- rawData = JsonConvert.SerializeObject(result);
- await _redisDb.StringSetAsync(currKey, rawData, FastCache);
- }
- if (result == null)
- {
- result = new List();
- }
- activity?.SetTag("data.source", source);
- LogTrace($"{source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms");
- return result;
- }
-
- ///
- /// Riga Ordine dato suo UID
- ///
- ///
- ///
- public async Task OrderRowGetByUID(string OrderRowUID)
- {
- using var activity = StartActivity();
- string source = "DB";
- OrderRowModel? result = null;
- // cerco in redis...
- string currKey = $"{redisBaseKey}:OrderRows:ByUID:{OrderRowUID}";
- RedisValue rawData = await _redisDb.StringGetAsync(currKey);
- //if (!string.IsNullOrEmpty($"{rawData}"))
- if (rawData.HasValue)
- {
- result = JsonConvert.DeserializeObject($"{rawData}");
- source = "REDIS";
- }
- else
- {
- result = dbController.OrderRowGetByUID(OrderRowUID);
- // serializzo e salvo...
- rawData = JsonConvert.SerializeObject(result);
- await _redisDb.StringSetAsync(currKey, rawData, LongCache);
- }
- activity?.SetTag("data.source", source);
- LogTrace($"{source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms");
- return result;
- }
-
- ///
- /// Effettua update stato await BOM/PRICE per la riga Ordine indicata
- ///
- /// ID singola riga Ordine
- /// Se non nullo è il nuovo stato await BOM
- /// Se non nullo è stato await Price
- /// Indica se svuotare la cache
- ///
- public async Task OrderRowUpdateAwaitState(int orderRowID, bool? awaitBom, bool? awaitPrice, bool flushCache = false)
- {
- using var activity = StartActivity();
- string source = "DB+REDIS";
- // aggiorno
- bool fatto = await dbController.OrderRowUpdateAwaitState(orderRowID, awaitBom, awaitPrice);
- if (flushCache)
- {
- // svuoto cache...
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:OrderRows:*");
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:OrderRowsByState:*");
- }
- activity?.SetTag("data.source", source);
- LogTrace($"{source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms");
- return fatto;
- }
-
- public async Task OrderRowUpdateBom(int orderRowID, List newBomList)
- {
- using var activity = StartActivity();
- string source = "DB+REDIS";
- bool fatto = false;
- //// calcolo
- //fatto = await dbController.OrderRowUpdateBom(OfferRowID, newBomList);
- // svuoto cache...
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:Offers:*");
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:OfferRows:*");
- activity?.SetTag("data.source", source);
- LogTrace($"{source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms");
- return fatto;
- }
- ///
- /// Effettua update delle info legate al file per la Riga Ordine
- ///
- /// Riga Offerta coi dati da aggiornare
- ///
- public async Task OrderRowUpdateFileData(OrderRowModel updRec)
- {
- using var activity = StartActivity();
- string source = "DB+REDIS";
- // calcolo
- bool fatto = await dbController.OrderRowUpdateFileData(updRec);
- // svuoto cache...
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:Orders:*");
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:OrderRows:*");
- activity?.SetTag("data.source", source);
- LogTrace($"{source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms");
- return fatto;
- }
-
- ///
- /// Effettua update del valore serializzato della riga Ordine
- ///
- /// ID Riga Ordine da aggiornare
- /// Serializzazione oggetto (es JWD)
- ///
- public async Task OrderRowUpdateSerStruct(int OrderRowID, string serStruct)
- {
- using var activity = StartActivity();
- string source = "DB+REDIS";
- // calcolo
- bool fatto = await dbController.OrderRowUpdateSerStruct(OrderRowID, serStruct);
- // svuoto cache...
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:Orders:*");
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:OrderRows:*");
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:OrderRowsByState:*");
- activity?.SetTag("data.source", source);
- LogTrace($"{source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms");
- return fatto;
- }
-
- ///
- /// Effettua Add della riga Ordine
- ///
- /// Riga Ordine con i dati da aggiornare
- ///
- public async Task OrderRowUpsert(OrderRowModel updRec)
- {
- using var activity = StartActivity();
- string source = "DB+REDIS";
- // calcolo
- bool fatto = await dbController.OrderRowUpsert(updRec);
- // svuoto cache...
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:Orders:*");
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:OrderRows:*");
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:OrderRowsByState:*");
- activity?.SetTag("data.source", source);
- LogTrace($"{source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms");
- return fatto;
- }
-
-
- ///
- /// Aggiorna stato riga ordine al valore richiesto
- ///
- ///
- ///
- ///
- public async Task OrderRowUpdateState(int orderRowID, OrderStates reqState)
- {
- using var activity = StartActivity();
- string source = "DB+REDIS";
- // calcolo
- bool fatto = await dbController.OrderRowUpdateState(orderRowID, reqState);
- // svuoto cache...
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:Orders:*");
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:OrderRows:*");
- await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:ProdGroup:*");
- activity?.SetTag("data.source", source);
- LogTrace($"{source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms");
- return fatto;
- }
-#endif
///
/// Validazione record:
/// - controllo state vs estimate
diff --git a/Lux.UI/Components/Pages/WorkLoadBalance.razor.cs b/Lux.UI/Components/Pages/WorkLoadBalance.razor.cs
index 1f2aec34..5a752932 100644
--- a/Lux.UI/Components/Pages/WorkLoadBalance.razor.cs
+++ b/Lux.UI/Components/Pages/WorkLoadBalance.razor.cs
@@ -77,8 +77,6 @@ namespace Lux.UI.Components.Pages
[Inject]
private DataLayerServices DLService { get; set; } = null!;
- [Inject]
- private IOrderRowService OrdRService { get; set; } = null!;
[Inject]
private IGenValService GVService { get; set; } = default!;
@@ -86,6 +84,9 @@ namespace Lux.UI.Components.Pages
[Inject]
private IJSRuntime JSRuntime { get; set; } = null!;
+ [Inject]
+ private IOrderRowService OrdRService { get; set; } = null!;
+
[Inject]
private IOrderService OrdService { get; set; } = null!;