Compare commits

..

76 Commits

Author SHA1 Message Date
Samuele Locatelli 52dffc36d7 Merge tag 'FixIobObj_02' into develop
Update metodi API x versione e salvataggio senza errori + fix
salvataggio aprametri
2026-03-13 10:14:52 +01:00
Samuele Locatelli 58c90034af Merge branch 'release/FixIobObj_02' 2026-03-13 10:14:38 +01:00
Samuele Locatelli c96b2eba1d Aggiunta REST call x versione
Fix salvataggio conf
2026-03-13 10:14:19 +01:00
Samuele Locatelli 2a4e46240c Fix errori params update 2026-03-13 10:10:54 +01:00
Samuele Locatelli 3739f888f9 Merge tag 'FixIobObj_01' into develop
Ancora fix valori double min/max
2026-03-13 09:14:06 +01:00
Samuele Locatelli e406fce2eb Merge branch 'release/FixIobObj_01' 2026-03-13 09:13:57 +01:00
Samuele Locatelli aa19832649 Forzato fix iobObject che non aveva preso val double 2026-03-13 09:13:28 +01:00
Samuele Locatelli 25d5ba81d2 Fix round fact in edit param 2026-03-13 09:11:43 +01:00
Samuele Locatelli 822a0fdfb8 Merge tag 'AddDebugParams_04' into develop
Ancora fix objItem ricevibili x evitare erroi invio
2026-03-13 09:02:37 +01:00
Samuele Locatelli b4a4db08d1 Merge branch 'release/AddDebugParams_04' 2026-03-13 09:02:25 +01:00
Samuele Locatelli 9d9dcecb1c fix IobObject: da int a double min/max val da conf 2026-03-13 09:02:03 +01:00
Samuele Locatelli fd5433f3c9 Forzo writable all'atto dell'editing... 2026-03-12 19:37:33 +01:00
Samuele Locatelli 4b365e1760 Merge tag 'AddDebugParams_03' into develop
Review localizzazione IT x evitare problema decimali verso IOB
2026-03-12 19:00:15 +01:00
Samuele Locatelli 693687a1ee Merge branch 'release/AddDebugParams_03' 2026-03-12 19:00:03 +01:00
Samuele Locatelli a45b70af9b Ripristinata culture ITA x evitare problemi con decimali inviati... 2026-03-12 18:59:44 +01:00
Samuele Locatelli 153438e4d6 Merge tag 'AddDebugParams_02' into develop
Update decimali con . tramite tulture EN-US
2026-03-12 18:50:37 +01:00
Samuele Locatelli f63d153d5b Merge branch 'release/AddDebugParams_02' 2026-03-12 18:50:27 +01:00
Samuele Locatelli 85298a16d7 Forzato culture a EN-US x problema decimali parametri 2026-03-12 18:50:07 +01:00
Samuele Locatelli 16ccb1c57e Merge tag 'AddDebugParams_01' into develop
update gestione parametri forzabili in debug + update round valori
2026-03-12 17:06:56 +01:00
Samuele Locatelli ecfa85ff38 Merge branch 'release/AddDebugParams_01' 2026-03-12 17:04:49 +01:00
Samuele Locatelli b45b728eb1 Fix round val 2 decimali + conf da json roundFactor 2026-03-12 17:04:11 +01:00
Samuele Locatelli 1dfd0c60d1 Aggiunta gestione currMode x plantParameters x forzare parametri 2026-03-12 16:55:18 +01:00
Samuele Locatelli 76f6151f75 Merge tag 'Telemetry_09' into develop
Aggiunta log duplicati
2026-03-04 09:44:41 +01:00
Samuele Locatelli 39559e3151 Merge branch 'release/Telemetry_09' 2026-03-04 09:44:33 +01:00
Samuele Locatelli 9625911cf1 Aggiunto log esteso rimozione allarmi duplicati 2026-03-04 09:44:06 +01:00
Samuele Locatelli 3e0b496764 Merge tag 'Rel_1.2' into develop
Update minor version
2026-03-04 09:23:13 +01:00
Samuele Locatelli cd902129a5 Merge branch 'release/Rel_1.2' 2026-03-04 09:23:07 +01:00
Samuele Locatelli 4f14df94bb Update vers 1.2 2026-03-04 09:22:39 +01:00
Samuele Locatelli 879e54d194 Merge tag 'Telemetry_08' into develop
Update x fix errori HEALT su ipv6 + fix varie aree commentate
2026-03-04 09:22:24 +01:00
Samuele Locatelli a4a9bb55b6 Merge branch 'release/Telemetry_08' 2026-03-04 09:21:55 +01:00
Samuele Locatelli 1eab3ad672 Cleanup finale e update mino vers x fiix trasmissione telemetria (FINALLY!) in prod 2026-03-04 09:21:39 +01:00
Samuele Locatelli bd505ab5ef Merge tag 'Telemetry_07' into develop
update versione
2026-03-04 08:57:56 +01:00
Samuele Locatelli a68471ec6f Merge branch 'release/Telemetry_07' 2026-03-04 08:57:51 +01:00
Samuele Locatelli 8f3239b6d6 update vers 2026-03-04 08:57:34 +01:00
Samuele Locatelli d6e5b07e2d Merge tag 'Telemetry_06' into develop
Update init x http vs grpc
2026-03-04 08:53:22 +01:00
Samuele Locatelli 89492349b6 Merge branch 'release/Telemetry_06' 2026-03-04 08:53:11 +01:00
Samuele Locatelli 971f2c51e9 Update conf x usare http vs grpc 2026-03-04 08:52:55 +01:00
Samuele Locatelli dbfc13e968 Merge tag 'Telemetry_05' into develop
Update telemetria con unico program.cs e nuova vers 1.1
2026-03-04 07:42:08 +01:00
Samuele Locatelli cb42c0a7ca Merge branch 'release/Telemetry_05' 2026-03-04 07:41:43 +01:00
Samuele Locatelli 06bae1d955 Update con startup in unico program.cs, vers 1.1 2026-03-04 07:41:06 +01:00
Samuele Locatelli 9459492599 Merge tag 'Telemetry_04' into develop
Merge nuova versione x test telemetria
2026-03-04 07:12:48 +01:00
Samuele Locatelli c208513988 Merge branch 'release/Telemetry_04' 2026-03-04 07:12:38 +01:00
Samuele Locatelli f0dc98a4f8 vers refres 2026-03-04 07:12:07 +01:00
Samuele Locatelli 7742d49b08 update vers con cleanup 2026-03-04 07:11:50 +01:00
Samuele Locatelli d6ed7c56a4 Merge tag 'Telemetry_03' into develop
Aggiunta parametro linux x grpc in http vs http2
2026-03-04 07:07:19 +01:00
Samuele Locatelli d17175b405 Merge branch 'release/Telemetry_03' 2026-03-04 07:07:03 +01:00
Samuele Locatelli 38b89c9a81 Update codice startup (da testare!) 2026-03-03 19:17:19 +01:00
Samuele Locatelli e31f773b34 Merge tag 'Telemetry_02' into develop
Update altri metodi export e async
2026-03-03 18:58:33 +01:00
Samuele Locatelli 74b4c50b00 Merge branch 'release/Telemetry_02' 2026-03-03 18:58:11 +01:00
Samuele Locatelli 4fda312aac Avanzamento telemetria:
- altri metodi tracciati
- modifica json x prod
- aggiunta Async vari
2026-03-03 18:57:46 +01:00
Samuele Locatelli 165c7ebb5f Merge tag 'OrderDedup_Telemetry_01' into develop
Inserito controllo ordini duplicati + telemetrica (non ancora completa)
+ fix naming Async metodi DAL
2026-03-03 15:05:43 +01:00
Samuele Locatelli b0274e0f33 Merge branch 'release/OrderDedup_Telemetry_01' 2026-03-03 15:05:22 +01:00
Samuele Locatelli c52a35082f Update
- naming metodi async
- inserimento funzione controllo ordini duplicati
- telemetria (continuo)
2026-03-03 15:03:29 +01:00
Samuele Locatelli c572a9556e Modifiche x inizio gestione telemetria 2026-03-03 12:51:37 +01:00
Samuele Locatelli fb74462ecd Aggiunta preliminare intercept errore (sostituzione NLog? approfondire...) 2026-02-26 18:42:40 +01:00
Samuele Locatelli 003f8792c4 Code reorg-cleanup 2026-02-26 18:35:53 +01:00
Samuele Locatelli 8757528de3 iniziato aggiunta telemetria in DEBUG x verifica azioni operatori 2026-02-26 18:35:09 +01:00
Samuele Locatelli 5e3bbc23da Merge tag 'ReduceCacheSizeTSData_01' into develop
Fix gestione dati TSData più compatti + review log vari
2026-02-20 12:04:40 +01:00
Samuele Locatelli 2cbe549751 Merge branch 'release/ReduceCacheSizeTSData_01' 2026-02-20 12:04:24 +01:00
Samuele Locatelli a28d7cbc4a Merge remote-tracking branch 'origin/develop' into develop 2026-02-20 12:03:49 +01:00
Samuele Locatelli 9670e170f2 Modifiche in prod
- cambio livello logging x tracciare meglio funzionamento eventi
- modifica modalità serializzazione TSData (nuovo costruttore) x ridurre dimensione cache redis (circa -40%)
2026-02-20 12:01:42 +01:00
Samuele E. Locatelli b6c514ebe9 Merge tag 'AddOrderCreateNote_01' into develop
Update gestione ordini con commenti
2025-12-02 11:07:06 +01:00
Samuele E. Locatelli 50ac4a9e30 Merge branch 'release/AddOrderCreateNote_01' 2025-12-02 11:06:56 +01:00
Samuele E. Locatelli 4122e27d17 Update gestione creazione ordini:
- quelli automatici sono messi all'1:00 non a mezzanotte
- creazione da plant analisys e orders differenziata come log sul DB
2025-12-02 11:06:21 +01:00
Samuele Locatelli 2d8a4db24a Merge tag 'FixLogout_01' into develop
Fix logout con corretta chiamata da pagina logout
2025-10-17 14:34:15 +02:00
Samuele Locatelli ac7b284397 Merge branch 'release/FixLogout_01' 2025-10-17 14:34:05 +02:00
Samuele Locatelli 70469bc51d Fix logout da pagina Auth MVC 2025-10-17 14:33:24 +02:00
Samuele Locatelli e84e352795 Merge tag 'FixAlarmAndSel_01' into develop
Fix deduplica allarmi + fix gestione buttons e sel varie
2025-10-15 16:03:12 +02:00
Samuele Locatelli 603e8df10f Merge branch 'release/FixAlarmAndSel_01' 2025-10-15 16:02:57 +02:00
Samuele Locatelli 11751c2adb Update gestione allarmi: deduplica prima dir ecuperare
Update visualizzazione ordini (/mostra richiesta sel)
Update gestione buttons vari
2025-10-15 16:02:20 +02:00
Samuele Locatelli 45ecc0f796 Update conf x uso MDB cluster in ufficio, test ok 2025-09-22 11:15:50 +02:00
Samuele Locatelli b7193732a5 Email via services in produzione 2025-09-22 08:49:31 +02:00
Samuele Locatelli e139e98309 Typo refresh (no real changes) + nuova stored salvata x delete allarmi duplicati 2025-02-11 16:22:34 +01:00
Samuele Locatelli cc71178b7f Merge tag 'FixFactorDecimal01' into develop
Fix factor come decimal e non come intero
2024-10-21 10:54:35 +02:00
Samuele Locatelli 43589701fd Merge branch 'release/FixFactorDecimal01' 2024-10-21 10:54:26 +02:00
Samuele Locatelli 24e8999f95 Fix ricezione factor a decimale 2024-10-21 10:53:59 +02:00
59 changed files with 2971 additions and 2067 deletions
+272 -257
View File
@@ -12,13 +12,6 @@ namespace GWMS.Data.Controllers
{
public class GWMSController : IDisposable
{
#region Private Fields
private static IConfiguration _configuration;
private static Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
#region Public Constructors
public GWMSController(IConfiguration configuration)
@@ -30,6 +23,30 @@ namespace GWMS.Data.Controllers
#region Public Methods
/// <summary>
/// Esegue pulizia allarmi impianto richiesto
/// </summary>
/// <param name="PlantId"></param>
/// <returns></returns>
public async Task<int> AlarmLogCleanDup(int PlantId)
{
int numMod = 0;
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
{
try
{
// eseguo stored
string sqlCommand = $"CALL stp_deleteDuplicatedAlarms ({PlantId});";
numMod = await localDbCtx.Database.ExecuteSqlRawAsync(sqlCommand);
}
catch (Exception exc)
{
Log.Error($"Eccezione in AlarmLogCleanDup{Environment.NewLine}{exc}");
}
}
return numMod;
}
/// <summary>
/// Recupero elenco allarmi (ultimi?)
/// </summary>
@@ -37,21 +54,21 @@ namespace GWMS.Data.Controllers
/// <param name="skipRec"></param>
/// <param name="numRec"></param>
/// <returns></returns>
public List<AlarmLogModel> AlarmLogGetFilt(int PlantId, int skipRec, int numRec)
public async Task<List<AlarmLogModel>> AlarmLogGetFilt(int PlantId, int skipRec, int numRec)
{
List<AlarmLogModel> dbResult = new List<AlarmLogModel>();
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
{
try
{
dbResult = localDbCtx
dbResult = await localDbCtx
.DbSetAlarmLog
.Where(x => x.PlantId == PlantId)
.Include(p => p.Plant)
.OrderByDescending(x => x.AlarmLogId)
.Skip(skipRec)
.Take(numRec)
.ToList();
.ToListAsync();
}
catch (Exception exc)
{
@@ -64,7 +81,7 @@ namespace GWMS.Data.Controllers
/// <summary>
/// Inserimento di un record AlarmLog
/// </summary>
/// <param name="PlantLogModel">Record da inserire (senza ID...)</param>
/// <param name="newItem">Record da inserire</param>
/// <returns></returns>
public async Task<bool> AlarmLogInsert(AlarmLogModel newItem)
{
@@ -74,8 +91,8 @@ namespace GWMS.Data.Controllers
try
{
localDbCtx
.DbSetAlarmLog
.Add(newItem);
.DbSetAlarmLog
.Add(newItem);
await localDbCtx.SaveChangesAsync();
fatto = true;
}
@@ -101,6 +118,10 @@ namespace GWMS.Data.Controllers
return roundDate;
}
/// <summary>
/// Forza migrazione DB se necessario
/// </summary>
/// <returns></returns>
public bool DbForceMigrate()
{
bool answ = false;
@@ -149,69 +170,74 @@ namespace GWMS.Data.Controllers
return dbResult;
}
public OrderModel GetOrderByCode(string OrderCode)
public async Task<OrderModel> GetOrderByCodeAsync(string OrderCode)
{
OrderModel dbResult = new OrderModel();
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
{
dbResult = localDbCtx
.DbSetOrders
.Where(x => (x.OrderCode == OrderCode))
.Include(p => p.Plant)
.Include(s => s.Supplier)
.Include(t => t.Transporter)
.FirstOrDefault();
dbResult = await localDbCtx
.DbSetOrders
.Where(x => (x.OrderCode == OrderCode))
.Include(p => p.Plant)
.Include(s => s.Supplier)
.Include(t => t.Transporter)
.FirstOrDefaultAsync();
}
return dbResult;
}
public OrderModel GetOrderById(int OrderId)
public async Task<OrderModel> GetOrderByIdAsync(int OrderId)
{
OrderModel dbResult = new OrderModel();
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
{
dbResult = localDbCtx
.DbSetOrders
.Where(x => (x.OrderId == OrderId))
.Include(p => p.Plant)
.Include(s => s.Supplier)
.Include(t => t.Transporter)
.FirstOrDefault();
dbResult = await localDbCtx
.DbSetOrders
.Where(x => (x.OrderId == OrderId))
.Include(p => p.Plant)
.Include(s => s.Supplier)
.Include(t => t.Transporter)
.FirstOrDefaultAsync();
}
return dbResult;
}
public List<OrderModel> GetOrdersFilt(int PlantId, int SupplierId, int TransporterId, DateTime DtStart, DateTime DtEnd, bool ShowClosed)
public async Task<List<OrderModel>> GetOrdersFiltAsync(int PlantId, int SupplierId, int TransporterId, DateTime DtStart, DateTime DtEnd, bool ShowClosed)
{
List<OrderModel> dbResult = new List<OrderModel>();
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
{
dbResult = localDbCtx
.DbSetOrders
.Where(x => (x.PlantId == PlantId || PlantId == 0) && (x.SupplierId == SupplierId || SupplierId == 0) && (x.TransporterId == TransporterId || TransporterId == 0) && (x.DtOrder >= DtStart && x.DtOrder <= DtEnd) && (x.ExecutionQty == 0 || ShowClosed))
.Include(p => p.Plant)
.Include(s => s.Supplier)
.Include(t => t.Transporter)
.OrderByDescending(x => x.DtOrder)
.ToList();
dbResult = await localDbCtx
.DbSetOrders
.Where(x => (x.PlantId == PlantId || PlantId == 0)
&& (x.SupplierId == SupplierId || SupplierId == 0)
&& (x.TransporterId == TransporterId || TransporterId == 0)
&& (x.DtOrder >= DtStart && x.DtOrder <= DtEnd)
&& (x.ExecutionQty == 0 || ShowClosed))
.Include(p => p.Plant)
.Include(s => s.Supplier)
.Include(t => t.Transporter)
.OrderByDescending(x => x.DtOrder)
.ToListAsync();
}
return dbResult;
}
public List<OrderModel> GetOrdersOpen(int PlantId)
public async Task<List<OrderModel>> GetOrdersOpenAsync(int PlantId)
{
List<OrderModel> dbResult = new List<OrderModel>();
// limite ordini aperti: creati all'anno 0001 --> verifico anno start < 2000
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
{
dbResult = localDbCtx
.DbSetOrders
.Where(x => (x.PlantId == PlantId || PlantId == 0) && (x.DtExecStart < x.DtOrder && x.DtExecStart.Year < 2000))
.Include(p => p.Plant)
.Include(s => s.Supplier)
.Include(t => t.Transporter)
.OrderByDescending(x => x.DtOrder)
.ToList();
dbResult = await localDbCtx
.DbSetOrders
.Where(x => (x.PlantId == PlantId || PlantId == 0)
&& (x.DtExecStart < x.DtOrder && x.DtExecStart.Year < 2000))
.Include(p => p.Plant)
.Include(s => s.Supplier)
.Include(t => t.Transporter)
.OrderByDescending(x => x.DtOrder)
.ToListAsync();
}
return dbResult;
}
@@ -229,28 +255,6 @@ namespace GWMS.Data.Controllers
return dbResult;
}
/// <summary>
/// Elenco log registrati x plant
/// </summary>
/// <param name="PlantId">se 0 = tutto</param>
/// <param name="DtMaxDate">consigliato arrotondamento al minuto o multiplo</param>
/// <param name="numRec">num rec max da recuperare</param>
/// <returns></returns>
public List<PlantLogModel> GetPlantLog(int PlantId, DateTime DtMaxDate, int numRec)
{
List<PlantLogModel> dbResult = new List<PlantLogModel>();
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
{
dbResult = localDbCtx
.DbSetPlantLog
.Where(x => (x.PlantId == PlantId || PlantId == 0) && x.DtEvent <= DtMaxDate)
.OrderByDescending(x => x.DtEvent)
.Take(numRec)
.ToList();
}
return dbResult;
}
/// <summary>
/// Elenco in formato di lista DTO resoconti giornalieri x Plant
/// - elenco record livelli giornalieri
@@ -294,7 +298,8 @@ namespace GWMS.Data.Controllers
// recupero i dati della gioranta indicata
var currLevelTS = dbLevels
.Where(x => x.DtEvent > dataCurr && x.DtEvent <= dataCurr.AddDays(1))
.Select(x => new TSData() { DtEvent = x.DtEvent, ValDouble = x.ValNumber })
.Select(x => new TSData(x.DtEvent, x.ValNumber, true))
//.Select(x => new TSData() { DtEvent = x.DtEvent, ValDouble = x.ValNumber })
.ToList();
// SOLO SE ho almeno 1 record livello
if (currLevelTS.Count > 0)
@@ -332,11 +337,13 @@ namespace GWMS.Data.Controllers
{
newRec.ExecutionTS = dbOrders
.Where(x => x.DtExecStart >= dataCurr && x.DtExecStart < dataCurr.AddDays(1))
.Select(x => new TSData() { DtEvent = x.DtOrder, ValDouble = x.ExecutionQty }).ToList();
.Select(x => new TSData(x.DtOrder, x.ExecutionQty, true)).ToList();
//.Select(x => new TSData() { DtEvent = x.DtOrder, ValDouble = x.ExecutionQty }).ToList();
newRec.OrderTS = dbOrders
.Where(x => x.DtExecStart >= dataCurr && x.DtExecStart < dataCurr.AddDays(1))
.Select(x => new TSData() { DtEvent = x.DtOrder, ValDouble = x.OrderQty }).ToList();
.Select(x => new TSData(x.DtOrder, x.OrderQty, true)).ToList();
//.Select(x => new TSData() { DtEvent = x.DtOrder, ValDouble = x.OrderQty }).ToList();
newRec.OrdersIds = dbOrders
.Where(x => x.DtExecStart >= dataCurr && x.DtExecStart < dataCurr.AddDays(1))
@@ -352,6 +359,28 @@ namespace GWMS.Data.Controllers
return dbResult;
}
/// <summary>
/// Elenco log registrati x plant
/// </summary>
/// <param name="PlantId">se 0 = tutto</param>
/// <param name="DtMaxDate">consigliato arrotondamento al minuto o multiplo</param>
/// <param name="numRec">num rec max da recuperare</param>
/// <returns></returns>
public List<PlantLogModel> GetPlantLog(int PlantId, DateTime DtMaxDate, int numRec)
{
List<PlantLogModel> dbResult = new List<PlantLogModel>();
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
{
dbResult = localDbCtx
.DbSetPlantLog
.Where(x => (x.PlantId == PlantId || PlantId == 0) && x.DtEvent <= DtMaxDate)
.OrderByDescending(x => x.DtEvent)
.Take(numRec)
.ToList();
}
return dbResult;
}
public List<PlantDetailModel> GetPlants()
{
List<PlantDetailModel> dbResult = new List<PlantDetailModel>();
@@ -428,31 +457,31 @@ namespace GWMS.Data.Controllers
return dbResult;
}
public List<WeekPlanModel> GetWeekPlan()
public async Task<List<WeekPlanModel>> GetWeekPlanAsync()
{
List<WeekPlanModel> dbResult = new List<WeekPlanModel>();
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
{
dbResult = localDbCtx
.DbSetPlantSupplWeekPlan
.Include(p => p.Plant)
.Include(s => s.Supplier)
.Include(t => t.Transporter)
.ToList();
dbResult = await localDbCtx
.DbSetPlantSupplWeekPlan
.Include(p => p.Plant)
.Include(s => s.Supplier)
.Include(t => t.Transporter)
.ToListAsync();
}
return dbResult;
}
public bool HasPlantLog()
public async Task<bool> HasPlantLog()
{
bool answ = false;
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
{
try
{
var numRecord = localDbCtx
var numRecord = await localDbCtx
.DbSetPlantLog
.Count();
.CountAsync();
answ = numRecord > 0;
}
catch
@@ -462,33 +491,52 @@ namespace GWMS.Data.Controllers
}
/// <summary>
/// Eliminazione di un ordine
/// Eliminazione di un ordine dato record completo
/// </summary>
/// <param name="Item2Del"></param>
/// <returns></returns>
public bool OrderDelete(OrderModel Item2Del)
public async Task<bool> OrderDeleteAsync(OrderModel Item2Del)
{
bool done = false;
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
{
try
if (Item2Del != null)
{
if (Item2Del != null)
{
var rec2del = localDbCtx
.DbSetOrders
.Where(x => x.OrderId == Item2Del.OrderId)
.FirstOrDefault();
localDbCtx
.DbSetOrders
.Remove(rec2del);
localDbCtx.SaveChanges();
done = true;
}
var rec2del = await localDbCtx
.DbSetOrders
.Where(x => x.OrderId == Item2Del.OrderId)
.FirstOrDefaultAsync();
localDbCtx
.DbSetOrders
.Remove(rec2del);
int numDone = await localDbCtx.SaveChangesAsync();
done = numDone > 0;
}
catch (Exception exc)
}
return done;
}
/// <summary>
/// Eliminazione di un ordine dao codice ID univoco
/// </summary>
/// <param name="orderId"></param>
/// <returns></returns>
public async Task<bool> OrderDeleteAsync(int orderId)
{
bool done = false;
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
{
if (orderId > 0)
{
Log.Error($"Eccezione in OrderDelete:{Environment.NewLine}{exc}");
var rec2del = await localDbCtx
.DbSetOrders
.Where(x => x.OrderId == orderId)
.FirstOrDefaultAsync();
localDbCtx
.DbSetOrders
.Remove(rec2del);
int numDone = await localDbCtx.SaveChangesAsync();
done = numDone > 0;
}
}
return done;
@@ -565,55 +613,12 @@ namespace GWMS.Data.Controllers
return done;
}
/// <summary>
/// Recupera un record ParamSend
/// </summary>
/// <param name="updItem"></param>
/// <returns></returns>
public ParamSendModel ParamSendGet(int PlantId, string ParamUid)
{
ParamSendModel result = new ParamSendModel();
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
{
try
{
result = localDbCtx
.DbSetParamSend
.Where(x => x.PlantId == PlantId && x.ParamUid == ParamUid)
.FirstOrDefault();
if (result == null && PlantId > 0 && !string.IsNullOrEmpty(ParamUid))
{
ParamSendModel currData = new ParamSendModel()
{
PlantId = PlantId,
ParamUid = ParamUid,
enabled = false
};
if (currData != null)
{
localDbCtx.
DbSetParamSend
.Add(currData);
localDbCtx.SaveChanges();
}
}
}
catch (Exception exc)
{
Log.Error($"Eccezione in ParamSendGet:{Environment.NewLine}{exc}");
}
}
return result;
}
/// <summary>
/// Elenco di TUTTI i parametri gestiti
/// </summary>
/// <param name="updItem"></param>
/// <returns></returns>
public List<ParamSendModel> ParamSendGetAll()
public async Task<List<ParamSendModel>> ParamSendGetAllAsync()
{
List<ParamSendModel> listParams = new List<ParamSendModel>();
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
@@ -621,54 +626,83 @@ namespace GWMS.Data.Controllers
try
{
// elenco parametri gestiti
listParams = localDbCtx
.DbSetParamSend
//.Where(x => x.enabled)
.ToList();
listParams = await localDbCtx
.DbSetParamSend
//.Where(x => x.enabled)
.ToListAsync();
}
catch (Exception exc)
{
Log.Error($"Eccezione in ParamSendGetAll:{Environment.NewLine}{exc}");
Log.Error($"Eccezione in ParamSendGetAllAsync:{Environment.NewLine}{exc}");
}
}
return listParams;
}
/// <summary>
/// Recupera un record ParamSend
/// </summary>
/// <param name="updItem"></param>
/// <returns></returns>
public async Task<ParamSendModel> ParamSendGetAsync(int PlantId, string ParamUid)
{
ParamSendModel result = new ParamSendModel();
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
{
result = await localDbCtx
.DbSetParamSend
.Where(x => x.PlantId == PlantId && x.ParamUid == ParamUid)
.FirstOrDefaultAsync();
if (result == null && PlantId > 0 && !string.IsNullOrEmpty(ParamUid))
{
ParamSendModel currData = new ParamSendModel()
{
PlantId = PlantId,
ParamUid = ParamUid,
enabled = false
};
if (currData != null)
{
localDbCtx.
DbSetParamSend
.Add(currData);
await localDbCtx.SaveChangesAsync();
}
}
}
return result;
}
/// <summary>
/// Aggiorna un record ParamSend
/// </summary>
/// <param name="updItem"></param>
/// <returns></returns>
public bool ParamSendUpdate(ParamSendModel updItem)
public async Task<bool> ParamSendUpdateAsync(ParamSendModel updItem)
{
bool done = false;
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
{
try
ParamSendModel currData = null;
currData = await localDbCtx
.DbSetParamSend
.Where(x => x.PlantId == updItem.PlantId && x.ParamUid == updItem.ParamUid)
.FirstOrDefaultAsync();
if (currData != null)
{
ParamSendModel currData = null;
currData = localDbCtx
.DbSetParamSend
.Where(x => x.PlantId == updItem.PlantId && x.ParamUid == updItem.ParamUid)
.FirstOrDefault();
if (currData != null)
{
localDbCtx.Entry(currData).CurrentValues.SetValues(updItem);
localDbCtx.SaveChanges();
}
else
{
localDbCtx
.DbSetParamSend
.Add(updItem);
localDbCtx.SaveChanges();
}
done = true;
localDbCtx.Entry(currData).CurrentValues.SetValues(updItem);
await localDbCtx.SaveChangesAsync();
}
catch (Exception exc)
else
{
Log.Error($"Eccezione in ParamSendUpdate:{Environment.NewLine}{exc}");
localDbCtx
.DbSetParamSend
.Add(updItem);
localDbCtx.SaveChanges();
}
done = true;
}
return done;
}
@@ -678,44 +712,37 @@ namespace GWMS.Data.Controllers
/// </summary>
/// <param name="Item2Del"></param>
/// <returns></returns>
public bool ParamSetDelete(ParamSetModel Item2Del)
public async Task<bool> ParamSetDeleteAsync(ParamSetModel Item2Del)
{
bool done = false;
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
{
try
if (Item2Del != null)
{
if (Item2Del != null)
{
var rec2del = localDbCtx
.DbSetParamSet
.Where(x => x.ParamSetId == Item2Del.ParamSetId)
.FirstOrDefault();
localDbCtx
.DbSetParamSet
.Remove(rec2del);
localDbCtx.SaveChanges();
done = true;
}
}
catch (Exception exc)
{
Log.Error($"Eccezione in ParamSetDelete:{Environment.NewLine}{exc}");
var rec2del = await localDbCtx
.DbSetParamSet
.Where(x => x.ParamSetId == Item2Del.ParamSetId)
.FirstOrDefaultAsync();
localDbCtx
.DbSetParamSet
.Remove(rec2del);
await localDbCtx.SaveChangesAsync();
done = true;
}
}
return done;
}
public List<ParamSetModel> ParamSetGet(int PlantId, string ParamUid)
public async Task<List<ParamSetModel>> ParamSetGetAsync(int PlantId, string ParamUid)
{
List<ParamSetModel> dbResult = new List<ParamSetModel>();
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
{
dbResult = localDbCtx
.DbSetParamSet
.Where(x => (x.PlantId == PlantId || PlantId == 0) && (x.ParamUid == ParamUid || ParamUid == ""))
.OrderBy(x => x.Scadenza)
.ToList();
dbResult = await localDbCtx
.DbSetParamSet
.Where(x => (x.PlantId == PlantId || PlantId == 0) && (x.ParamUid == ParamUid || ParamUid == ""))
.OrderBy(x => x.Scadenza)
.ToListAsync();
}
return dbResult;
}
@@ -751,36 +778,28 @@ namespace GWMS.Data.Controllers
/// </summary>
/// <param name="updItem"></param>
/// <returns></returns>
public bool ParamSetUpdate(ParamSetModel updItem)
public async Task<bool> ParamSetUpdateAsync(ParamSetModel updItem)
{
bool done = false;
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
{
try
ParamSetModel currData = null;
currData = await localDbCtx
.DbSetParamSet
.Where(x => x.ParamSetId == updItem.ParamSetId)
.FirstOrDefaultAsync();
if (currData != null)
{
ParamSetModel currData = null;
currData = localDbCtx
.DbSetParamSet
.Where(x => x.ParamSetId == updItem.ParamSetId)
.FirstOrDefault();
if (currData != null)
{
localDbCtx.Entry(currData).CurrentValues.SetValues(updItem);
localDbCtx.SaveChanges();
}
else
{
localDbCtx
.DbSetParamSet
.Add(updItem);
localDbCtx.SaveChanges();
}
done = true;
localDbCtx.Entry(currData).CurrentValues.SetValues(updItem);
}
catch (Exception exc)
else
{
Log.Error($"Eccezione in ParamSetUpdate:{Environment.NewLine}{exc}");
localDbCtx
.DbSetParamSet
.Add(updItem);
}
await localDbCtx.SaveChangesAsync();
done = true;
}
return done;
}
@@ -815,14 +834,14 @@ namespace GWMS.Data.Controllers
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
{
// per prima cosa recupero dati RAW ultime 2 settimane...
// per prima cosa recupero dati RAW ultimo mese...
var rawData = localDbCtx
.DbSetPlantLog
.Where(x => x.DtEvent > DateTime.Today.AddMonths(-1) && x.PlantId == PlantId)
.AsNoTracking()
.ToList();
// ora recupero i distinct dell'ultima settimana x capire COSA posso poi ricavare...
// ora recupero i distinct x capire COSA posso poi ricavare...
var countData = rawData
.Select(e => e.FluxType)
.Distinct()
@@ -831,8 +850,6 @@ namespace GWMS.Data.Controllers
// recupero dal DB i dati PRESENTI...
if (countData.Contains("Level"))
{
//rawLevelData = localDbCtx
// .DbSetPlantLog
rawLevelData = rawData
.Where(x => x.FluxType == "Level" && x.PlantId == PlantId)
//.AsNoTracking()
@@ -923,19 +940,24 @@ namespace GWMS.Data.Controllers
}
LevelTS = rawLevelData
.Select(x => new TSData() { DtEvent = x.DtEvent, ValDouble = x.ValNumber }).ToList();
.Select(x => new TSData(x.DtEvent, x.ValNumber, true)).ToList();
//.Select(x => new TSData() { DtEvent = x.DtEvent, ValDouble = x.ValNumber }).ToList();
OrderTS = rawOpenOrderData
.Select(x => new TSData() { DtEvent = x.DtOrder, ValDouble = x.OrderQty }).ToList();
.Select(x => new TSData(x.DtOrder, x.OrderQty, true)).ToList();
//.Select(x => new TSData() { DtEvent = x.DtOrder, ValDouble = x.OrderQty }).ToList();
PressMainTS = rawMainPressData
.Select(x => new TSData() { DtEvent = x.DtEvent, ValDouble = x.ValNumber }).ToList();
.Select(x => new TSData(x.DtEvent, x.ValNumber, true)).ToList();
//.Select(x => new TSData() { DtEvent = x.DtEvent, ValDouble = x.ValNumber }).ToList();
PressBHTS = rawBHPressData
.Select(x => new TSData() { DtEvent = x.DtEvent, ValDouble = x.ValNumber }).ToList();
.Select(x => new TSData(x.DtEvent, x.ValNumber, true)).ToList();
//.Select(x => new TSData() { DtEvent = x.DtEvent, ValDouble = x.ValNumber }).ToList();
PressBLTS = rawBLPressData
.Select(x => new TSData() { DtEvent = x.DtEvent, ValDouble = x.ValNumber }).ToList();
.Select(x => new TSData(x.DtEvent, x.ValNumber, true)).ToList();
//.Select(x => new TSData() { DtEvent = x.DtEvent, ValDouble = x.ValNumber }).ToList();
PressTS.Add("Main", PressMainTS);
PressTS.Add("BH", PressBHTS);
@@ -1026,52 +1048,38 @@ namespace GWMS.Data.Controllers
/// </summary>
/// <param name="updItem"></param>
/// <returns></returns>
public bool PlantUpdate(PlantDTO updItem)
public async Task<bool> PlantUpdateAsync(PlantDTO updItem)
{
bool done = false;
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
{
try
PlantDetailModel currData = await localDbCtx
.DbSetPlant
.Where(x => x.PlantId == updItem.PlantId)
.FirstOrDefaultAsync();
if (currData != null)
{
PlantDetailModel currData = localDbCtx
.DbSetPlant
.Where(x => x.PlantId == updItem.PlantId)
.FirstOrDefault();
if (currData != null)
{
// aggiorno valori
currData.LevelReorder = updItem.LevelReorder;
currData.LevelMax = updItem.LevelMax;
localDbCtx.Entry(currData).State = EntityState.Modified;
localDbCtx.SaveChanges();
}
done = true;
}
catch (Exception exc)
{
Log.Error($"Eccezione in PlantUpdate:{Environment.NewLine}{exc}");
// aggiorno valori
currData.LevelReorder = updItem.LevelReorder;
currData.LevelMax = updItem.LevelMax;
localDbCtx.Entry(currData).State = EntityState.Modified;
int numDone = await localDbCtx.SaveChangesAsync();
done = numDone > 0;
}
}
return done;
}
public bool RecordRebootLog(RebootLogModel newItem)
public async Task<bool> RecordRebootLogAsync(RebootLogModel newItem)
{
bool done = false;
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
{
try
{
localDbCtx
.DbRebootLog
.Add(newItem);
localDbCtx.SaveChanges();
done = true;
}
catch (Exception exc)
{
Log.Error($"Eccezione durante RecordRebootLog{Environment.NewLine}{exc}");
}
localDbCtx
.DbRebootLog
.Add(newItem);
int numRec = await localDbCtx.SaveChangesAsync();
done = numRec > 0;
}
return done;
}
@@ -1174,5 +1182,12 @@ namespace GWMS.Data.Controllers
}
#endregion Public Methods
#region Private Fields
private static IConfiguration _configuration;
private static Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
}
}
+13 -6
View File
@@ -2,9 +2,6 @@
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GWMS.Data
{
@@ -27,7 +24,7 @@ namespace GWMS.Data
/// <summary>
/// Fattore per eventuale divisione (es leggo 1234 --> 12,34 con factor=100)
/// </summary>
public int factor { get; set; } = 1;
public decimal factor { get; set; } = 1;
/// <summary>
/// Indice nell'area di memoria (da valore iniziale = 0)
@@ -248,18 +245,28 @@ namespace GWMS.Data
/// <summary>
/// Valore MASSIMO (SE impostato)
/// </summary>
public int valMax { get; set; }
public double valMax { get; set; }
/// <summary>
/// Valore minimo (SE impostato)
/// </summary>
public int valMin { get; set; }
public double valMin { get; set; }
/// <summary>
/// Ordinamento
/// </summary>
public int displOrdinal { get; set; } = 0;
/// <summary>
/// Valore parametro (come stringa, decimali con ",", default VUOTO), sul CNC/PLC
/// </summary>
public string value { get; set; } = "";
/// <summary>
/// Descrizione valore
/// </summary>
public string description { get; set; } = "";
/// <summary>
/// Indica se sia abilitato in scrittura (WRITE)
/// </summary>
@@ -6,10 +6,10 @@ DROP PROCEDURE IF EXISTS DeletePlantLogrecords;
DELIMITER $$
CREATE PROCEDURE DeletePlantLogrecords(
IN pStartDate DATETIME,
IN pPlantId INT,
IN pMinInt INT,
IN pFluxType VARCHAR(250)
IN pStartDate DATETIME,
IN pPlantId INT,
IN pMinInt INT,
IN pFluxType VARCHAR(250)
)
BEGIN
@@ -0,0 +1,74 @@
USE GWMS_PZZFRR;
DROP PROCEDURE IF EXISTS stp_deleteDuplicatedAlarms;
DELIMITER $$
CREATE PROCEDURE `stp_deleteDuplicatedAlarms`(
IN `PlantIdReq` INT
)
BEGIN
-- Eliminazione allarmi duplicati + indicazione AllOk al secondo (ultimo) della serie per chiusura'
-- Step 1: Eliminazione record 'interni' duplicati (in una sequenza lascia solo primo ed ultimo)
DELETE
FROM AlarmLog
WHERE AlarmLogId IN (
SELECT AlarmLogId
FROM (
SELECT
AlarmLogId,
PlantId,
`Status` AS CurState,
LAG(`Status`) OVER (ORDER BY AlarmLogId) AS prev_State,
LEAD(`Status`) OVER (ORDER BY AlarmLogId) AS next_State
FROM AlarmLog
WHERE PlantId = PlantIdReq
) AS cte
WHERE
(CurState = prev_State) AND (CurState = next_State)
);
-- Step 2: Cambio secondo record in "ALL OK"
UPDATE AlarmLog
SET `Status` = 0,
ValDecoded = 'ALL OK'
WHERE AlarmLogId IN (
SELECT AlarmLogId
FROM (
SELECT
AlarmLogId,
PlantId,
`Status` AS CurState,
LAG(`Status`) OVER (ORDER BY AlarmLogId) AS prev_State,
LEAD(`Status`) OVER (ORDER BY AlarmLogId) AS next_State
FROM AlarmLog
WHERE PlantId = PlantIdReq
) AS cte
WHERE
(CurState = prev_State) AND (CurState != next_State)
);
-- Step 3: Eliminazione eventuali record duplicati 'ALL OK'
DELETE
FROM AlarmLog
WHERE AlarmLogId IN (
SELECT AlarmLogId
FROM (
SELECT
AlarmLogId,
PlantId,
`Status` AS CurState,
LAG(`Status`) OVER (ORDER BY AlarmLogId) AS prev_State,
LEAD(`Status`) OVER (ORDER BY AlarmLogId) AS next_State
FROM AlarmLog
WHERE PlantId = PlantIdReq
) AS cte
WHERE
(CurState = prev_State) AND (CurState = 0)
);
END$$
DELIMITER ;
+36 -1
View File
@@ -1,5 +1,7 @@
using System;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data.SqlTypes;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -8,10 +10,43 @@ namespace GWMS.Data
{
public class TSData
{
#region Public Constructors
///// <summary>
///// Init generico per retrocompatibilità e deserializzazione
///// </summary>
public TSData() { }
/// <summary>
/// Costruttore "Smart" per la creazione rapida e ottimizzata
/// </summary>
/// <param name="dt"></param>
/// <param name="val"></param>
/// <param name="doRound"></param>
public TSData(DateTime dt, double val, bool doRound = true)
{
if (doRound)
{
// Arrotonda al secondo: crea una nuova data ignorando i Tick (millisecondi)
DtEvent = new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, dt.Second);
// Arrotonda a 2 decimali
ValDouble = Math.Round(val, 2);
}
else
{
DtEvent = dt;
ValDouble = val;
}
}
#endregion Public Constructors
#region Public Properties
[JsonProperty("d")]
public DateTime DtEvent { get; set; } = DateTime.Now;
[JsonProperty("v")]
public double ValDouble { get; set; } = 0;
#endregion Public Properties
@@ -52,7 +52,7 @@ namespace GWMS.UI.Areas.Identity.Pages.Account
else
{
string appDir = $"{_configuration["RuntimeOpt:BaseUrl"]}{_configuration["RuntimeOpt:BaseAppPath"]}";
return RedirectToPage(appDir);
return Redirect(appDir);
}
}
+57
View File
@@ -0,0 +1,57 @@
using Microsoft.AspNetCore.Components;
using System;
using System.Diagnostics;
namespace GWMS.UI.Components
{
public abstract class BaseComp : ComponentBase, IDisposable
{
#region Public Methods
public virtual void Dispose()
{
// Opzionale: logga quando l'utente lascia la pagina/componente
}
#endregion Public Methods
#region Protected Fields
/// <summary>
/// Sorgente statica condivisa per tutto il layer UI
/// </summary>
protected static readonly ActivitySource UIActivitySource = new ActivitySource("GWMS.UI");
#endregion Protected Fields
#region Protected Properties
[Inject]
protected NavigationManager Navigation { get; set; } = default!;
#endregion Protected Properties
#region Protected Methods
/// <summary>
/// Avvia un'attività tracciata con metadati standard del componente
/// </summary>
protected Activity? StartTracing(string operationName)
{
// Verifica se qualcuno sta ascoltando questa sorgente
if (!UIActivitySource.HasListeners()) return null;
// init activity con nome gestito
var activity = UIActivitySource.StartActivity($"{GetType().Name}:{operationName}");
// Aggiungiamo tag standard utili per il debug su Uptrace
activity?.SetTag("ui.component_type", GetType().Name);
activity?.SetTag("ui.url", Navigation.Uri);
activity?.SetTag("data.source", "UI");
return activity;
}
#endregion Protected Methods
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
<div class="form-row text-light">
<div class="col-5 pr-0 text-left">
GWMS <span class="small">v.@version</span>
<string>GWMS</string> <span class="small">v.@version</span><small> | Srv: @nodeId</small>
</div>
<div class="col-7 pl-0 text-right">
<span class="small">@adesso</span>
+13 -1
View File
@@ -49,6 +49,8 @@ namespace GWMS.UI.Components
protected DateTime adesso = DateTime.Now;
private string nodeId = Environment.MachineName;
#endregion Protected Fields
#region Protected Methods
@@ -57,10 +59,20 @@ namespace GWMS.UI.Components
{
var rawVers = typeof(Program).Assembly.GetName().Version;
version = rawVers != null ? rawVers : new Version("0.0.0.0");
nodeId = Environment.MachineName;
#if DEBUG
// nome completo...
#else
//Se non fosse develop --> prende gli ultimi 2 caratteri(es. "01")
if (nodeId.Length > 2)
{
nodeId = nodeId.Substring(nodeId.Length - 2);
}
#endif
StartTimer();
}
#endregion Protected Methods
#endregion Protected Methods
#region Private Fields
+8 -2
View File
@@ -1,6 +1,8 @@
@using Microsoft.AspNetCore.Components.Authorization
@using GWMS.UI.Data
@inject AuthenticationStateProvider AuthenticationStateProvider
@inject MessageService MServ
<AuthorizeView>
<Authorized>
@@ -30,9 +32,13 @@
</NotAuthorized>
</AuthorizeView>
@code{
@code {
private string userName = "";
private string userName
{
get => MServ.UserName;
set => MServ.UserName = value;
}
protected override async Task OnInitializedAsync()
{
await forceReload();
+2 -119
View File
@@ -5,6 +5,8 @@
@using GWMS.UI.Data
@using Microsoft.Extensions.Configuration
@inherits BaseComp
@inject MessageService AppMService
@inject GWMSDataService DataService
@inject NavigationManager NavManager
@@ -181,122 +183,3 @@
</div>
</div>
@code {
private List<SupplierModel> suppList;
private List<TransporterModel> transpList;
protected OrderModel _currItem = new OrderModel();
protected int _supplierId { get; set; } = 0;
[Parameter]
public OrderModel currItem
{
get
{
return _currItem = null;
}
set
{
_currItem = value;
}
}
private bool editAll { get; set; } = false;
[Parameter]
public EventCallback<int> DataReset { get; set; }
[Parameter]
public EventCallback<int> DataUpdated { get; set; }
[Parameter]
public int SupplierId
{
get
{
return _supplierId;
}
set
{
_supplierId = value;
// condiziono visualizzazione...
var pUpd = Task.Run(async () => await ReloadAllData());
pUpd.Wait();
}
}
private async Task saveUpdate()
{
if (_currItem != null)
{
await DataService.OrderUpdate(_currItem);
await DataUpdated.InvokeAsync(1);
}
else
{
Console.WriteLine("Order null!");
}
}
private async Task cancelUpdate()
{
await DataReset.InvokeAsync(0);
}
private async Task deleteRecord()
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Sicuro di voler eliminare l'ordine selezionato??"))
return;
if (_currItem != null)
{
await DataService.OrderDelete(_currItem);
await DataUpdated.InvokeAsync(1);
}
else
{
Console.WriteLine("User null!");
}
}
protected override async Task OnInitializedAsync()
{
await ReloadAllData();
await JSRuntime.InvokeVoidAsync("displayQr", "qrCodeImg", rawCode);
}
protected string rawCode
{
get
{
string answ = "";
if (_currItem != null)
{
answ = _currItem.OrderCode;
}
return answ;
}
}
protected async Task ReloadAllData()
{
suppList = await DataService.SuppliersGetAll();
transpList = await DataService.TransportersGetAll();
// vedere anche https://www.mikesdotnetting.com/article/340/working-with-query-strings-in-blazor
var uri = NavManager.ToAbsoluteUri(NavManager.Uri);
var currMode = GetQueryParm("currMode");
if (!string.IsNullOrEmpty(currMode))
{
editAll = currMode.Equals("debug");
}
}
// Blazor: get query parm from the URL
protected string GetQueryParm(string parmName)
{
var uriBuilder = new UriBuilder(NavManager.Uri);
var q = System.Web.HttpUtility.ParseQueryString(uriBuilder.Query);
return q[parmName] ?? "";
}
}
@@ -0,0 +1,171 @@
using GWMS.Data.DatabaseModels;
using GWMS.UI.Data;
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace GWMS.UI.Components
{
public partial class OrderAdminEditor
{
#region Public Properties
[Parameter]
public OrderModel currItem
{
get
{
return _currItem = null;
}
set
{
_currItem = value;
}
}
[Parameter]
public EventCallback<int> DataReset { get; set; }
[Parameter]
public EventCallback<int> DataUpdated { get; set; }
[Parameter]
public int SupplierId
{
get
{
return _supplierId;
}
set
{
_supplierId = value;
// condiziono visualizzazione...
var pUpd = Task.Run(async () => await ReloadAllData());
pUpd.Wait();
}
}
#endregion Public Properties
#region Protected Fields
protected OrderModel _currItem = new OrderModel();
#endregion Protected Fields
#region Protected Properties
protected int _supplierId { get; set; } = 0;
[Inject]
protected MessageService MServ { get; set; } = null;
protected string rawCode
{
get
{
string answ = "";
if (_currItem != null)
{
answ = _currItem.OrderCode;
}
return answ;
}
}
#endregion Protected Properties
#region Protected Methods
// Blazor: get query parm from the URL
protected string GetQueryParm(string parmName)
{
var uriBuilder = new UriBuilder(NavManager.Uri);
var q = System.Web.HttpUtility.ParseQueryString(uriBuilder.Query);
return q[parmName] ?? "";
}
protected override async Task OnInitializedAsync()
{
await ReloadAllData();
await JSRuntime.InvokeVoidAsync("displayQr", "qrCodeImg", rawCode);
}
protected async Task ReloadAllData()
{
suppList = await DataService.SuppliersGetAllAsync();
transpList = await DataService.TransportersGetAllAsync();
// vedere anche https://www.mikesdotnetting.com/article/340/working-with-query-strings-in-blazor
var uri = NavManager.ToAbsoluteUri(NavManager.Uri);
var currMode = GetQueryParm("currMode");
if (!string.IsNullOrEmpty(currMode))
{
editAll = currMode.Equals("debug");
}
}
#endregion Protected Methods
#region Private Fields
private List<SupplierModel> suppList;
private List<TransporterModel> transpList;
#endregion Private Fields
#region Private Properties
private bool editAll { get; set; } = false;
#endregion Private Properties
#region Private Methods
private async Task cancelUpdate()
{
await DataReset.InvokeAsync(0);
}
private async Task deleteRecord()
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Sicuro di voler eliminare l'ordine selezionato??"))
return;
if (_currItem != null)
{
using var activity = StartTracing("Delete");
await DataService.OrderDeleteAsync(_currItem);
activity?.SetTag("order.code", _currItem.OrderCode);
activity?.SetTag("order.operator", MServ.UserName);
activity?.SetTag("order.quantity_req", _currItem.OrderQty);
await DataUpdated.InvokeAsync(1);
}
else
{
Console.WriteLine("User null!");
}
}
private async Task saveUpdate()
{
if (_currItem != null)
{
using var activity = StartTracing("SaveUpdate");
await DataService.OrderUpdateAsync(_currItem);
activity?.SetTag("order.code", _currItem.OrderCode);
activity?.SetTag("order.operator", MServ.UserName);
activity?.SetTag("order.quantity_req", _currItem.OrderQty);
await DataUpdated.InvokeAsync(1);
}
else
{
Console.WriteLine("Order null!");
}
}
#endregion Private Methods
}
}
+5 -2
View File
@@ -1,4 +1,6 @@
@if (@_currItem != null)
@inherits BaseComp
@if (@_currItem != null)
{
<ul class="list-group">
<li class="list-group-item active">
@@ -41,4 +43,5 @@
}
}
</ul>
}
}
+109 -88
View File
@@ -1,23 +1,69 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using GWMS.UI.Components;
using GWMS.UI.Data;
using GWMS.Data.DatabaseModels;
using GWMS.Data.DTO;
using GWMS.UI.Data;
using Microsoft.AspNetCore.Components;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
namespace GWMS.UI.Components
{
public partial class OrderLoad : ComponentBase
public partial class OrderLoad
{
#region Private Fields
#region Public Properties
private PlantDTO currPlantData = null;
private List<PlantDTO> plantsData = new List<PlantDTO>();
public string _orderCode { get; set; } = "";
public int _plantId { get; set; } = 0;
#endregion Private Fields
[Parameter]
public OrderModel currItem
{
get
{
return _currItem;
}
set
{
_currItem = value;
}
}
[Parameter]
public EventCallback<bool> loadCompleted { get; set; }
[Parameter]
public string OrderCode
{
get
{
return _orderCode;
}
set
{
_orderCode = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
[Parameter]
public int PlantId
{
get
{
return _plantId;
}
set
{
_plantId = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
#endregion Public Properties
#region Protected Fields
@@ -30,6 +76,9 @@ namespace GWMS.UI.Components
[Inject]
protected GWMSDataService DataService { get; set; }
[Inject]
protected MessageService MServ { get; set; } = null;
/// <summary>
/// verifica correttezza plant/ordine
/// </summary>
@@ -93,84 +142,12 @@ namespace GWMS.UI.Components
#endregion Protected Properties
#region Public Properties
public string _orderCode { get; set; } = "";
public int _plantId { get; set; } = 0;
[Parameter]
public OrderModel currItem
{
get
{
return _currItem;
}
set
{
_currItem = value;
}
}
[Parameter]
public EventCallback<bool> loadCompleted { get; set; }
[Parameter]
public string OrderCode
{
get
{
return _orderCode;
}
set
{
_orderCode = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
[Parameter]
public int PlantId
{
get
{
return _plantId;
}
set
{
_plantId = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
#endregion Public Properties
#region Private Methods
private async Task ReloadData()
{
plantsData = await DataService.PlantDtoGetAll();
// recupero dato del plant corrente
currPlantData = plantsData.Where(x => x.PlantId == PlantId).FirstOrDefault();
// solo se ho valore QR selezionato
if (!string.IsNullOrEmpty(OrderCode))
{
currItem = await DataService.OrderGetByCode(OrderCode);
}
else
{
currItem = null;
}
}
#endregion Private Methods
#region Protected Methods
protected async Task RefillEnd()
{
using var activity = StartTracing("RefillEnd");
//using var activity = UIActivitySource.StartActivity("RefillEnd");
if (currPlantData != null)
{
// aggiorno il record corrente con livello e dataora inizio carico...
@@ -179,7 +156,15 @@ namespace GWMS.UI.Components
}
// salvo...
await DataService.OrderUpdate(_currItem);
await DataService.OrderUpdateAsync(_currItem);
// telemetria!
activity?.SetStatus(ActivityStatusCode.Ok);
activity?.SetTag("order.code", _currItem.OrderCode);
activity?.SetTag("order.operator", MServ.UserName);
activity?.SetTag("order.level_start", _currItem.LevelStart);
activity?.SetTag("order.level_end", _currItem.LevelEnd);
activity?.SetTag("plant.level_act", currPlantData.LevelAct);
// segnalo completato
await loadCompleted.InvokeAsync(true);
@@ -187,6 +172,8 @@ namespace GWMS.UI.Components
protected async Task RefillStart()
{
//using var activity = ActivitySource.StartActivity("RefillEnd");
using var activity = StartTracing("RefillStart");
if (currPlantData != null)
{
// aggiorno il record corrente con livello e dataora inizio carico...
@@ -195,9 +182,43 @@ namespace GWMS.UI.Components
}
// salvo...
await DataService.OrderUpdate(_currItem);
await DataService.OrderUpdateAsync(_currItem);
// telemetria!
activity?.SetStatus(ActivityStatusCode.Ok);
activity?.SetTag("order.code", _currItem.OrderCode);
activity?.SetTag("order.operator", MServ.UserName);
activity?.SetTag("order.level_start", _currItem.LevelStart);
activity?.SetTag("plant.level_act", currPlantData.LevelAct);
}
#endregion Protected Methods
#region Private Fields
private PlantDTO currPlantData = null;
private List<PlantDTO> plantsData = new List<PlantDTO>();
#endregion Private Fields
#region Private Methods
private async Task ReloadData()
{
plantsData = await DataService.PlantDtoGetAllAsync();
// recupero dato del plant corrente
currPlantData = plantsData.Where(x => x.PlantId == PlantId).FirstOrDefault();
// solo se ho valore QR selezionato
if (!string.IsNullOrEmpty(OrderCode))
{
currItem = await DataService.OrderGetByCodeAsync(OrderCode);
}
else
{
currItem = null;
}
}
#endregion Private Methods
}
}
+2 -2
View File
@@ -123,7 +123,7 @@
{
if (_currItem != null)
{
await DataService.OrderUpdate(_currItem);
await DataService.OrderUpdateAsync(_currItem);
await DataUpdated.InvokeAsync(1);
}
else
@@ -158,7 +158,7 @@
protected async Task ReloadAllData()
{
transpList = await DataService.TransportersGetAll();
transpList = await DataService.TransportersGetAllAsync();
}
}
+2 -2
View File
@@ -76,7 +76,7 @@
{
if (_currItem != null)
{
await DataService.OrderUpdate(_currItem);
await DataService.OrderUpdateAsync(_currItem);
await DataUpdated.InvokeAsync(1);
}
else
@@ -111,7 +111,7 @@
protected async Task ReloadAllData()
{
transpList = await DataService.TransportersGetAll();
transpList = await DataService.TransportersGetAllAsync();
}
}
+66 -56
View File
@@ -1,6 +1,7 @@
using GWMS.Data.DatabaseModels;
using GWMS.UI.Data;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Configuration;
using Microsoft.JSInterop;
using NLog;
using System;
@@ -53,17 +54,59 @@ namespace GWMS.UI.Components
#endregion Public Properties
#region Protected Fields
protected objItem _currItem = new objItem();
protected int _plantId = 0;
protected string ParamUid = "";
#endregion Protected Fields
#region Protected Properties
protected decimal CalcVal
[Inject]
protected IConfiguration _configuration { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected override async Task OnInitializedAsync()
{
// fix arrotondamento
roundFactor = _configuration.GetValue<int>("RuntimeOpt:RoundFact", 10);
await ReloadData();
}
protected async Task ReloadData()
{
ListRecords = null;
try
{
ListRecords = await DataService.ParamSetGetFiltAsync(PlantId, ParamUid);
}
catch (Exception exc)
{
Log.Error($"Eccezione in ReloadData:{Environment.NewLine}{exc}");
}
}
#endregion Protected Methods
#region Private Fields
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
private objItem _currItem = new objItem();
private int _plantId = 0;
private List<ParamSetModel> ListRecords;
private string ParamUid = "";
/// <summary>
/// fattore arrotondamento valori calcolati
/// </summary>
private int roundFactor = 100;
#endregion Private Fields
#region Private Properties
private decimal CalcVal
{
get
{
@@ -88,9 +131,12 @@ namespace GWMS.UI.Components
}
[Inject]
protected GWMSDataService DataService { get; set; }
private GWMSDataService DataService { get; set; }
protected int totalCount
[Inject]
private IJSRuntime JSRuntime { get; set; }
private int totalCount
{
get
{
@@ -103,40 +149,6 @@ namespace GWMS.UI.Components
}
}
#endregion Protected Properties
#region Protected Methods
protected async Task ChildUpdated()
{
//await DataReset.InvokeAsync(0);
await Task.Delay(1);
}
protected override async Task OnInitializedAsync()
{
await ReloadData();
}
protected void setCalc()
{
currItem.reqValDec = Math.Round(CalcVal * 1000) / 1000;
}
#endregion Protected Methods
#region Private Fields
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
private List<ParamSetModel> ListRecords;
#endregion Private Fields
#region Private Properties
[Inject]
private IJSRuntime JSRuntime { get; set; }
#endregion Private Properties
#region Private Methods
@@ -146,17 +158,10 @@ namespace GWMS.UI.Components
await DataReset.InvokeAsync(0);
}
private async Task ReloadData()
private async Task ChildUpdated()
{
ListRecords = null;
try
{
ListRecords = await DataService.ParamSetGetFilt(PlantId, ParamUid);
}
catch (Exception exc)
{
Log.Error($"Eccezione in ReloadData:{Environment.NewLine}{exc}");
}
//await EC_DataReset.InvokeAsync(0);
await Task.Delay(1);
}
private async Task saveUpdate()
@@ -166,7 +171,7 @@ namespace GWMS.UI.Components
if (_currItem != null)
{
await DataService.updateMachineParameter(IdxMacchina, _currItem.uid, _currItem.reqValue);
await DataService.UpdateMachineParameterAsync(IdxMacchina, _currItem.uid, _currItem.reqValue);
await DataUpdated.InvokeAsync(0);
}
else
@@ -175,6 +180,11 @@ namespace GWMS.UI.Components
}
}
private void setCalc()
{
currItem.reqValDec = Math.Round(CalcVal * roundFactor) / roundFactor;
}
#endregion Private Methods
}
}
+5 -5
View File
@@ -51,13 +51,13 @@ namespace GWMS.UI.Components
// salvo!
var pUpd = Task.Run(async () =>
{
await DataService.ParamSendUpdate(currRecord);
await DataService.ParamSendUpdateAsync(currRecord);
// se viene abilitato --> verifico comunque invio
if (value)
{
// test set parametri + invio...
await DataService.ParamsSendCheck();
await DataService.ParamsSendCheckAsync();
paramSent = true;
}
await ReloadData();
@@ -112,7 +112,7 @@ namespace GWMS.UI.Components
// salvo!
var pUpd = Task.Run(async () =>
{
await DataService.ParamSendUpdate(currRecord);
await DataService.ParamSendUpdateAsync(currRecord);
await ReloadData();
});
pUpd.Wait();
@@ -131,7 +131,7 @@ namespace GWMS.UI.Components
// salvo!
var pUpd = Task.Run(async () =>
{
await DataService.ParamSendUpdate(currRecord);
await DataService.ParamSendUpdateAsync(currRecord);
await ReloadData();
});
pUpd.Wait();
@@ -147,7 +147,7 @@ namespace GWMS.UI.Components
currRecord = null;
try
{
currRecord = await DataService.ParamSendGet(PlantIdSel, ParamUidSel);
currRecord = await DataService.ParamSendGetAsync(PlantIdSel, ParamUidSel);
}
catch (Exception exc)
{
+1 -1
View File
@@ -2,7 +2,7 @@
@if (currRecord != null)
{
<ParamSetEditor currItem="@currRecord" DataReset="ResetData" DataUpdated="UpdateData"></ParamSetEditor>
<ParamSetEditor currItem="@currRecord" EC_DataReset="ResetData" EC_DataUpdated="UpdateData"></ParamSetEditor>
}
@if (ListRecords == null)
{
+4 -6
View File
@@ -5,9 +5,7 @@ using Microsoft.JSInterop;
using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using static GWMS.Data.IobObjects;
namespace GWMS.UI.Components
{
@@ -107,7 +105,7 @@ namespace GWMS.UI.Components
TargetVal = 0,
Note = "Nuovo record"
};
await DataService.ParamSetUpdate(newRecord);
await DataService.ParamSetUpdateAsync(newRecord);
await ReloadData();
}
@@ -117,7 +115,7 @@ namespace GWMS.UI.Components
ListRecords = null;
try
{
ListRecords = await DataService.ParamSetGetFilt(PlantIdSel, ParamUidSel);
ListRecords = await DataService.ParamSetGetFiltAsync(PlantIdSel, ParamUidSel);
}
catch (Exception exc)
{
@@ -147,7 +145,7 @@ namespace GWMS.UI.Components
if (selRecord != null)
{
await DataService.ParamSetDelete(selRecord);
await DataService.ParamSetDeleteAsync(selRecord);
}
await ReloadData();
}
@@ -161,7 +159,7 @@ namespace GWMS.UI.Components
protected async Task UpdateData()
{
currRecord = null;
await DataService.ParamSetUpdate(currRecord);
//await DataService.ParamSetUpdateAsync(currRecord);
await ReloadData();
}
+1 -1
View File
@@ -37,7 +37,7 @@
<div class="input-group-prepend">
<span class="input-group-text">Valore</span>
</div>
<input Decimals="2" @bind="@_currItem.TargetVal" class="form-control text-right" title="Valore Richiesto" />
<InputNumber @bind-value="@_currItem.TargetVal" class="form-control text-right" title="Valore Richiesto" />
</div>
</div>
</div>
+58 -46
View File
@@ -1,40 +1,15 @@
using AutoMapper.Configuration;
using GWMS.Data.DatabaseModels;
using GWMS.Data.DTO;
using GWMS.Data.DatabaseModels;
using GWMS.UI.Data;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Configuration;
using Microsoft.JSInterop;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using static GWMS.Data.IobObjects;
namespace GWMS.UI.Components
{
public partial class ParamSetEditor
{
#region Protected Fields
protected ParamSetModel _currItem = new ParamSetModel();
#endregion Protected Fields
#region Private Properties
[Inject]
private IJSRuntime JSRuntime { get; set; }
#endregion Private Properties
#region Protected Properties
[Inject]
protected GWMSDataService DataService { get; set; }
#endregion Protected Properties
#region Public Properties
[Parameter]
@@ -51,40 +26,45 @@ namespace GWMS.UI.Components
}
[Parameter]
public EventCallback<int> DataReset { get; set; }
public EventCallback<int> EC_DataReset { get; set; }
[Parameter]
public EventCallback<int> DataUpdated { get; set; }
public EventCallback<int> EC_DataUpdated { get; set; }
[Parameter]
public string IdxMacchina { get; set; } = "";
#endregion Public Properties
#region Private Methods
#region Protected Fields
private async Task cancelUpdate()
protected ParamSetModel _currItem = new ParamSetModel();
#endregion Protected Fields
/// <summary>
/// fattore arrotondamento valori calcolati
/// </summary>
private int roundFactor = 100;
[Inject]
protected IConfiguration _configuration { get; set; } = null!;
protected override void OnParametersSet()
{
await DataReset.InvokeAsync(0);
}
private async Task saveUpdate()
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Sicuro di voler modificare la programmazione del parametro?"))
return;
// fix arrotondamento
roundFactor = _configuration.GetValue<int>("RuntimeOpt:RoundFact", 10);
// aggiorno targetVal...
if (_currItem != null)
{
await DataService.ParamSetUpdate(_currItem);
await DataUpdated.InvokeAsync(0);
}
else
{
Console.WriteLine("Record null!");
_currItem.TargetVal = Math.Round(_currItem.TargetVal * roundFactor) / roundFactor;
}
}
#endregion Private Methods
#region Protected Properties
[Inject]
protected GWMSDataService DataService { get; set; }
#endregion Protected Properties
#region Protected Methods
@@ -94,5 +74,37 @@ namespace GWMS.UI.Components
}
#endregion Protected Methods
#region Private Properties
[Inject]
private IJSRuntime JSRuntime { get; set; }
#endregion Private Properties
#region Private Methods
private async Task cancelUpdate()
{
await EC_DataReset.InvokeAsync(0);
}
private async Task saveUpdate()
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Sicuro di voler modificare la programmazione del parametro?"))
return;
if (_currItem != null)
{
await DataService.ParamSetUpdateAsync(_currItem);
await EC_DataUpdated.InvokeAsync(0);
}
else
{
Console.WriteLine("Record null!");
}
}
#endregion Private Methods
}
}
+1 -1
View File
@@ -94,7 +94,7 @@ namespace GWMS.UI.Components
{
if (_currItem != null)
{
await DataService.PlantUpdate(_currItem);
await DataService.PlantUpdateAsync(_currItem);
await DataUpdated.InvokeAsync(0);
}
else
+1 -1
View File
@@ -38,7 +38,7 @@ namespace GWMS.UI.Components
DateStart = DateTime.Today.AddDays(-1),
ShowClosed = false
};
PlantLevelDto = await DataService.PlantsAnalisysByFilt(plantLevFilt);
PlantLevelDto = await DataService.PlantsAnalisysByFiltAsync(plantLevFilt);
// aggiunta delay o non riesce a disegnare
int ChartWaitDelay = 150;
+5 -5
View File
@@ -195,7 +195,7 @@
{
if (_currItem != null)
{
DataService.WeekPlanUpdate(_currItem);
DataService.WeekPlanUpdateAsync(_currItem);
await DataUpdated.InvokeAsync(1);
}
else
@@ -211,7 +211,7 @@
if (_currItem != null)
{
DataService.WeekPlanDelete(_currItem);
DataService.WeekPlanDeleteAsync(_currItem);
await DataUpdated.InvokeAsync(1);
}
else
@@ -232,9 +232,9 @@
protected async Task ReloadAllData()
{
PlantsList = await DataService.PlantsList();
SuppliersList = await DataService.SuppliersGetAll();
TransportersList = await DataService.TransportersGetAll();
PlantsList = await DataService.PlantsListAsync();
SuppliersList = await DataService.SuppliersGetAllAsync();
TransportersList = await DataService.TransportersGetAllAsync();
}
}
+67 -51
View File
@@ -8,6 +8,7 @@ using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using static GWMS.Data.IobObjects;
@@ -42,7 +43,7 @@ namespace GWMS.UI.Controllers
public IOBController(GWMSDataService DataService)
{
_DataService = DataService;
//Log.Debug("Avviata classe IOBController");
Log.Debug("Avvio classe IOBController");
}
#endregion Public Constructors
@@ -87,6 +88,7 @@ namespace GWMS.UI.Controllers
[HttpGet("addTask2Exe/{id}")]
public async Task<string> addTask2Exe(string id, string taskName, string taskVal)
{
Log.Info($"addTask2Exe | {id} | {taskName} | {taskVal}");
string answ = "";
// converto stringa in tipo task...
taskType tName = taskType.nihil;
@@ -113,7 +115,7 @@ namespace GWMS.UI.Controllers
/// <summary>
/// Controllo status Alive
///
/// GET: IOB/alive
/// GET: IOB/version
/// </summary>
/// <returns></returns>
[HttpGet("alive")]
@@ -123,6 +125,17 @@ namespace GWMS.UI.Controllers
return $"OK";
}
[HttpGet("version")]
public string version()
{
var version = Assembly
.GetExecutingAssembly()
.GetName()
.Version?
.ToString() ?? "unknown";
return version;
}
/// <summary>
/// Esegue verifica livelli ed eventuale creazione ordini refill
///
@@ -133,6 +146,7 @@ namespace GWMS.UI.Controllers
[HttpGet("checkLevels/{id}")]
public async Task<string> checkLevels(string id)
{
Log.Info($"checkLevels | {id}");
//Log.Debug($"Chiamata checkLevels | {id}");
bool fatto = false;
// ...verifica per ricalcolo ordini...
@@ -164,7 +178,7 @@ namespace GWMS.UI.Controllers
[HttpGet("enabled/{id}")]
public async Task<string> enabled(string id)
{
//Log.Debug($"Chiamata enabled | {id}");
Log.Debug($"Enabled | {id}");
string answ = "ND";
// se id nullo --> KO!
if (id == null)
@@ -173,7 +187,7 @@ namespace GWMS.UI.Controllers
}
else
{
var currPlant = await _DataService.PlantsGetByCode(id);
var currPlant = await _DataService.PlantsGetByCodeAsync(id);
answ = (currPlant != null && currPlant.PlantId > 0) ? "OK" : "NO";
}
return answ;
@@ -241,7 +255,7 @@ namespace GWMS.UI.Controllers
[HttpGet("flog/{id}")]
public async Task<string> flog(string id, string flux, string valore, string dtEve, string dtCurr, string cnt)
{
//Log.Debug($"Chiamata flog | {id} | {flux} | {valore} | {dtEve} | {dtCurr} | {cnt}");
Log.Debug($"flog | {id} | {flux} | {valore} | {dtEve} | {dtCurr} | {cnt}");
bool fatto = false;
// formato yyyymmddHHMMSSnnn ovvero da anno a millisecondi
if (cnt == null)
@@ -255,7 +269,7 @@ namespace GWMS.UI.Controllers
dtCurr = dtCurr.Length > 17 ? dtCurr.Substring(0, 17) : dtCurr;
DateTime dataOraEvento = DateTime.Now;
DateTime dtEvento, dtCorrente;
// controllo: se ho valori dt x evento e orario DIVERSI per acquisitore IOB calcolo dataOraEvento corretto
// controllo: se ho valori DtEvent x evento e orario DIVERSI per acquisitore IOB calcolo dataOraEvento corretto
if (dtEve != dtCurr)
{
Int64 delta = 0;
@@ -290,7 +304,7 @@ namespace GWMS.UI.Controllers
}
// recupero plant!
var currPlant = await _DataService.PlantsGetByCode(id);
var currPlant = await _DataService.PlantsGetByCodeAsync(id);
if (currPlant != null && currPlant.PlantId > 0)
{
// converto in plantLogModel...
@@ -306,7 +320,7 @@ namespace GWMS.UI.Controllers
List<PlantLogModel> newData = new List<PlantLogModel>();
newData.Add(newItem);
// insert!
fatto = await _DataService.PlantLogInsert(newData);
fatto = await _DataService.PlantLogInsertAsync(newData);
// effettuo SEMPRE verifica per ricalcolo ordini...
await _DataService.checkLevels();
@@ -337,21 +351,21 @@ namespace GWMS.UI.Controllers
[HttpPost("flogJson/{id}")]
public async Task<string> flogJson(string id, [FromBody] flogJsonPayload rawData)
{
//Log.Debug($"Chiamata flogJson | {id}");
Log.Debug($"flogJson | {id} | {rawData.fluxData.Count} logs");
bool fatto = false;
// verifico ci sia valore
if (rawData != null && !string.IsNullOrEmpty(id))
{
// recupero plant!
var currPlant = await _DataService.PlantsGetByCode(id);
var currPlant = await _DataService.PlantsGetByCodeAsync(id);
if (currPlant != null && currPlant.PlantId > 0)
{
// conversione dati
List<PlantLogModel> plData = rawData.fluxData.Select(jpl => _DataService.convertFluxToPL(currPlant.PlantId, jpl)).ToList();
Log.Debug($"flogJson | {id} | Convertiti {plData.Count} record");
// insert!
fatto = await _DataService.PlantLogInsert(plData);
Log.Debug($"flogJson | {id} | PlantLogInsert --> esito: {fatto}");
fatto = await _DataService.PlantLogInsertAsync(plData);
Log.Debug($"flogJson | {id} | PlantLogInsertAsync --> esito: {fatto}");
// effettuo SEMPRE verifica per ricalcolo ordini...
await _DataService.checkLevels();
@@ -376,7 +390,7 @@ namespace GWMS.UI.Controllers
if (trovato.writable && string.IsNullOrEmpty(item.valore))
{
taskType currTask = (taskType)Enum.Parse(typeof(taskType), trovato.uid);
await _DataService.addCheckTask4Machine(id, currTask, item.valore);
await _DataService.AddCheckTask4MachineAsync(id, currTask, item.valore);
}
}
// altrimenti AGGIUNGO (READ ONLY)...
@@ -396,10 +410,10 @@ namespace GWMS.UI.Controllers
fatto = true;
}
// faccio upsert innovations!
await _DataService.upsertCurrObjItems(id, innovazioni);
await _DataService.UpsertCurrObjItemsAsync(id, innovazioni);
// ultimo step: controllo invio quotidiano parametri gestiti (compreso validità parametri setup)
await _DataService.ParamsSendCheck();
await _DataService.ParamsSendCheckAsync();
}
catch (Exception exc)
{
@@ -429,7 +443,7 @@ namespace GWMS.UI.Controllers
[HttpPost("forceSplitOdl/{id}")]
public string forceSplitOdl(string id)
{
//Log.Debug($"Chiamata forceSplitOdl | {id}");
Log.Debug($"Chiamata forceSplitOdl | {id}");
return "OK";
}
@@ -448,7 +462,7 @@ namespace GWMS.UI.Controllers
[HttpPost("forceSplitOdlFull/{id}")]
public string forceSplitOdlFull(string id, bool doConfirm, bool qtyFromLast, int? roundStep, string keyRichiesta = "")
{
//Log.Debug($"Chiamata forceSplitOdlFull | {id}");
Log.Debug($"Chiamata forceSplitOdlFull | {id}");
return "OK";
}
@@ -461,7 +475,7 @@ namespace GWMS.UI.Controllers
[HttpGet]
public string Get()
{
//Log.Debug("Chiamata Get");
Log.Debug("Chiamata Get");
return "OK";
}
@@ -475,7 +489,7 @@ namespace GWMS.UI.Controllers
[HttpGet("{id}")]
public string Get(int id)
{
//Log.Debug($"Chiamata Get | {id}");
Log.Debug($"Chiamata Get | {id}");
return "OK";
}
@@ -490,7 +504,7 @@ namespace GWMS.UI.Controllers
[HttpGet("getCounter/{id}")]
public string getCounter(string id)
{
//Log.Debug($"Chiamata getCounter | {id}");
Log.Debug($"Chiamata getCounter | {id}");
return "0";
}
@@ -505,7 +519,7 @@ namespace GWMS.UI.Controllers
[HttpGet("getCounterTCRec/{id}")]
public string getCounterTCRec(string id)
{
//Log.Debug($"Chiamata getCounterTCRec | {id}");
Log.Debug($"Chiamata getCounterTCRec | {id}");
return "0";
}
@@ -520,7 +534,7 @@ namespace GWMS.UI.Controllers
[HttpGet("getCurrData/{id}")]
public string getCurrData(string id)
{
//Log.Debug($"Chiamata getCurrData | {id}");
Log.Debug($"Chiamata getCurrData | {id}");
return $"{id}";
}
@@ -535,7 +549,7 @@ namespace GWMS.UI.Controllers
[HttpGet("getCurrODL/{id}")]
public string getCurrODL(string id)
{
//Log.Debug($"Chiamata getCurrODL | {id}");
Log.Debug($"Chiamata getCurrODL | {id}");
return "1";
}
@@ -548,7 +562,7 @@ namespace GWMS.UI.Controllers
[HttpGet("getCurrOdlRow/{id}")]
public string getCurrOdlRow(string id)
{
//Log.Debug($"Chiamata getCurrOdlRow | {id}");
Log.Debug($"Chiamata getCurrOdlRow | {id}");
return "";
}
@@ -561,7 +575,7 @@ namespace GWMS.UI.Controllers
[HttpGet("getCurrOdlStart/{id}")]
public string getCurrOdlStart(string id)
{
//Log.Debug($"Chiamata getCurrOdlStart | {id}");
Log.Debug($"Chiamata getCurrOdlStart | {id}");
return $"{DateTime.Now}";
}
@@ -574,7 +588,7 @@ namespace GWMS.UI.Controllers
[HttpGet("getCurrStatoRow/{id}")]
public string getCurrStatoRow(string id)
{
//Log.Debug($"Chiamata getCurrStatoRow | {id}");
Log.Debug($"Chiamata getCurrStatoRow | {id}");
return "";
}
@@ -587,7 +601,7 @@ namespace GWMS.UI.Controllers
[HttpGet("getFiles/{id}")]
public string getFiles(string id)
{
//Log.Debug($"Chiamata getFiles | {id}");
Log.Debug($"Chiamata getFiles | {id}");
return "";
}
@@ -600,7 +614,7 @@ namespace GWMS.UI.Controllers
[HttpGet("getIdlePeriod/{id}")]
public int getIdlePeriod(string id)
{
//Log.Debug($"Chiamata getIdlePeriod | {id}");
Log.Debug($"Chiamata getIdlePeriod | {id}");
return 0;
}
@@ -612,7 +626,7 @@ namespace GWMS.UI.Controllers
[HttpGet("getIob2call/{id}")]
public string getIob2call(string id)
{
//Log.Debug($"Chiamata getIob2call | {id}");
Log.Debug($"Chiamata getIob2call | {id}");
return "";
}
@@ -624,7 +638,7 @@ namespace GWMS.UI.Controllers
[HttpGet("getM2IOB/{id}")]
public string getM2IOB(string id)
{
//Log.Debug($"Chiamata getM2IOB | {id}");
Log.Debug($"Chiamata getM2IOB | {id}");
return "";
}
@@ -637,6 +651,7 @@ namespace GWMS.UI.Controllers
[HttpGet("getObjItems/{id}")]
public async Task<string> getObjItems(string id)
{
Log.Info($"getObjItems | {id}");
string answ = "";
if (string.IsNullOrWhiteSpace(id))
{
@@ -674,6 +689,7 @@ namespace GWMS.UI.Controllers
[HttpGet("getObjItems2Write/{id}")]
public async Task<string> getObjItems2Write(string id)
{
Log.Info($"getObjItems2Write | {id}");
string answ = "";
if (string.IsNullOrWhiteSpace(id))
{
@@ -713,6 +729,7 @@ namespace GWMS.UI.Controllers
[HttpGet("getTask2Exe/{id}")]
public async Task<string> getTask2Exe(string id)
{
Log.Info($"getTask2Exe | {id}");
string answ = "";
try
{
@@ -738,7 +755,7 @@ namespace GWMS.UI.Controllers
[HttpGet("input/{id}")]
public string input(string id, string valore, string dtEve, string dtCurr, string cnt)
{
//Log.Debug($"Chiamata input | {id} | {valore} | {dtEve} | {dtCurr} | {cnt}");
Log.Debug($"Chiamata input | {id} | {valore} | {dtEve} | {dtCurr} | {cnt}");
string answ = "OK";
#if false
// formato yyyymmddHHMMSSnnn ovvero da anno a millisecondi
@@ -770,14 +787,14 @@ namespace GWMS.UI.Controllers
[HttpPost]
public void Post([FromBody] string value)
{
//Log.Debug("Chiamata Post");
Log.Debug("Chiamata Post");
}
// PUT api/IOB/5
[HttpPut("{id}")]
public void Put(int id, [FromBody] string value)
{
//Log.Debug($"Chiamata Put | {id}");
Log.Debug($"Chiamata Put | {id}");
}
/// <summary>
@@ -791,6 +808,7 @@ namespace GWMS.UI.Controllers
[HttpGet("remTask2Exe/{id}")]
public async Task<string> remTask2Exe(string id, string taskName)
{
Log.Info($"remTask2Exe | {id} | {taskName}");
string answ = "";
try
{
@@ -799,7 +817,7 @@ namespace GWMS.UI.Controllers
bool fatto = Enum.TryParse(taskName, out tName);
if (fatto)
{
await _DataService.remTask4Machine(id, tName);
await _DataService.RemTask4MachineAsync(id, tName);
}
else
{
@@ -826,28 +844,23 @@ namespace GWMS.UI.Controllers
[HttpPost("saveConf/{id}")]
public async Task<string> saveConf(string id, [FromBody] System.Text.Json.JsonElement rawQuery)
{
Log.Info($"saveConf | {id}");
// problema deserializzaizone ENUM con classe nuova dotnet 5:
// https://github.com/graphql-dotnet/graphql-dotnet/issues/1439
string answ = "";
// recupero come stringa il json ricevuto
string rawJson = rawQuery.ToString();
if (!string.IsNullOrEmpty(rawJson))
string rawData = rawQuery.ToString();
if (!string.IsNullOrEmpty(rawData))
{
var currMemMap = JsonConvert.DeserializeObject<plcMemMap>(rawJson);
if (string.IsNullOrWhiteSpace(id))
{
answ = "Missing IOB";
}
else
{
// se != null --> salvo!
if (currMemMap != null)
{
await _DataService.saveMemMap(id, currMemMap);
answ = "OK";
}
bool done = await _DataService.SaveMemMapAsync(id, rawData);
answ = done ? "OK" : "ERROR";
}
}
return answ;
@@ -863,6 +876,7 @@ namespace GWMS.UI.Controllers
[HttpPost("sendAlarmBankUpdate/{id}")]
public async Task<string> sendAlarmBankUpdate(string id, string memAddr, int index, uint currStatus, [FromBody] List<string> ActiveAlarms)
{
Log.Info($"sendAlarmBankUpdate | {id}");
string answ = "ND";
// se id nullo --> KO!
if (id == null)
@@ -872,7 +886,7 @@ namespace GWMS.UI.Controllers
else
{
// recupero plant...
var currPlant = await _DataService.PlantsGetByCode(id);
var currPlant = await _DataService.PlantsGetByCodeAsync(id);
string alarmDecoded = "-";
if (ActiveAlarms != null && ActiveAlarms.Count > 0)
{
@@ -899,9 +913,9 @@ namespace GWMS.UI.Controllers
/// <param name="GWIP">IP del Gateway</param>
/// <returns></returns>
[HttpGet("sendReboot")]
public string sendReboot(string idxMacchina, string mac)
public async Task<string> sendReboot(string idxMacchina, string mac)
{
//Log.Debug($"Chiamata sendReboot | {idxMacchina} | {mac}");
Log.Warn($"sendReboot | {idxMacchina} | {mac}");
string answ = "";
try
{
@@ -912,7 +926,7 @@ namespace GWMS.UI.Controllers
Item = idxMacchina,
Payload = mac
};
_DataService.RebootLogInsert(newItem);
await _DataService.RebootLogInsertAsync(newItem);
answ = "OK";
}
catch
@@ -929,6 +943,7 @@ namespace GWMS.UI.Controllers
[HttpPost("setObjItems/{id}")]
public async Task<string> setObjItems(string id, [FromBody] List<objItem> currParams)
{
Log.Info($"setObjItems | {id}");
string answ = "";
if (string.IsNullOrWhiteSpace(id))
{
@@ -939,7 +954,7 @@ namespace GWMS.UI.Controllers
// se != null --> salvo!
if (currParams != null)
{
await _DataService.setCurrObjItems(id, currParams);
await _DataService.SetCurrObjItemsAsync(id, currParams);
answ = "OK";
}
}
@@ -955,7 +970,7 @@ namespace GWMS.UI.Controllers
[HttpPost("uploadFile/{id}")]
public string uploadFile(string id)
{
//Log.Debug($"Chiamata uploadFile | {id}");
Log.Debug($"Chiamata uploadFile | {id}");
string answ = "";
#if false
// questa classe è derivata da Controller.Response... x cui recupero lo stream in altro modo...
@@ -1002,6 +1017,7 @@ namespace GWMS.UI.Controllers
[HttpPost("upsertObjItems/{id}")]
public async Task<string> upsertObjItems(string id, [FromBody] List<objItem> innovazioni)
{
Log.Info($"upsertObjItems | {id}");
string answ = "";
if (string.IsNullOrWhiteSpace(id))
{
@@ -1013,7 +1029,7 @@ namespace GWMS.UI.Controllers
if (innovazioni != null)
{
// salvo
await _DataService.upsertCurrObjItems(id, innovazioni);
await _DataService.UpsertCurrObjItemsAsync(id, innovazioni);
answ = "OK";
}
}
+2 -2
View File
@@ -56,7 +56,7 @@ namespace GWMS.UI.Controllers
{
Log.Debug("PlantData: Chiamata Get");
// serializzo i dati di PlantDTO dell'impianto richiesto
List<PlantDTO> ListRecords = await _DataService.PlantDtoGetAll();
List<PlantDTO> ListRecords = await _DataService.PlantDtoGetAllAsync();
return ListRecords;
}
@@ -66,7 +66,7 @@ namespace GWMS.UI.Controllers
{
Log.Debug($"PlantData: Chiamata Get | id: {id}");
// serializzo i dati di PlantDTO dell'impianto richiesto
var ListRecords = await _DataService.PlantDtoGetAll();
var ListRecords = await _DataService.PlantDtoGetAllAsync();
//seleziono plant...
var SelRecords = ListRecords.Where(X => X.PlantId == id).FirstOrDefault();
return SelRecords;
+3 -3
View File
@@ -62,7 +62,7 @@ namespace GWMS.UI.Controllers
DateTime limite = DateTime.Today.AddHours(dayHour).AddMinutes(dayMin);
// serializzo i dati di PlantDTO dell'impianto richiesto
var ListRecords = await _DataService.PlantLogGetFilt(0, limite, 100);
var ListRecords = await _DataService.PlantLogGetFiltAsync(0, limite, 100);
return ListRecords;
}
@@ -78,7 +78,7 @@ namespace GWMS.UI.Controllers
DateTime limite = DateTime.Today.AddHours(dayHour).AddMinutes(dayMin);
// serializzo i dati di PlantDTO dell'impianto richiesto
var ListRecords = await _DataService.PlantLogGetFilt(id, limite, 100);
var ListRecords = await _DataService.PlantLogGetFiltAsync(id, limite, 100);
return ListRecords;
}
@@ -91,7 +91,7 @@ namespace GWMS.UI.Controllers
// verifico ci sia valore
if (newItems != null)
{
fatto = await _DataService.PlantLogInsert(newItems);
fatto = await _DataService.PlantLogInsertAsync(newItems);
}
if (fatto)
{
File diff suppressed because it is too large Load Diff
+15
View File
@@ -13,6 +13,7 @@ namespace GWMS.UI.Data
private string _pageIcon;
private string _pageName;
private string _searchVal;
private string _userName;
private bool _showSearch;
#endregion Private Fields
@@ -68,6 +69,20 @@ namespace GWMS.UI.Data
}
}
public string UserName
{
get => _userName;
set
{
if (_userName != value)
{
_userName = value;
ReportPageUpd();
}
}
}
public string PageName
{
get => _pageName;
+11 -2
View File
@@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Version>1.0.2407.3013</Version>
<Version>1.2.2603.1310</Version>
<UserSecretsId>95c9f021-52d1-4390-a670-5810b7b777b0</UserSecretsId>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
@@ -68,7 +68,16 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.2" ExcludeAssets="All" />
<PackageReference Include="NLog" Version="5.3.2" />
<PackageReference Include="NLog" Version="6.1.1" />
<PackageReference Include="NLog.Targets.OpenTelemetryProtocol" Version="1.2.6" />
<PackageReference Include="NLog.Web.AspNetCore" Version="6.1.2" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.15.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.15.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.15.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.15.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" Version="1.15.0-beta.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.15.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.StackExchangeRedis" Version="1.15.0-beta.1" />
<PackageReference Include="StackExchange.Redis" Version="2.7.33" />
<PackageReference Include="ZXingBlazor" Version="0.1.6" />
</ItemGroup>
+2 -2
View File
@@ -229,11 +229,11 @@ namespace GWMS.UI.Pages
// se ho un plantId valido --> altrimenti non abilitato
if (ClaimPlantId == 0)
{
PlantsList = await DataService.PlantDtoGetAll();
PlantsList = await DataService.PlantDtoGetAllAsync();
}
else if (ClaimPlantId > 0)
{
var rawData = await DataService.PlantDtoGetAll();
var rawData = await DataService.PlantDtoGetAllAsync();
PlantsList = rawData.Where(x => x.PlantId == ClaimPlantId).ToList();
SelPlantId = ClaimPlantId;
}
+3 -25
View File
@@ -175,28 +175,6 @@ namespace GWMS.UI.Pages
protected DateTime vetoScan = DateTime.Now;
#if false
private async Task LocalReceivedBarcodeText(BarcodeReceivedEventArgs args)
{
DateTime adesso = DateTime.Now;
// input
string ordCode = args.BarcodeText;
// non nullo
if (!string.IsNullOrEmpty(ordCode))
{
// non veto...
if (adesso.Subtract(vetoScan).TotalMinutes > 0)
{
vetoScan = adesso.AddSeconds(4);
//NavManager.NavigateTo($"CodeProcess/{ordCode}");
OrderCode = ordCode;
var result = ProcessBarcode(ordCode);
}
}
}
#endif
protected void ScanDoneHandler(string value)
{
DateTime adesso = DateTime.Now;
@@ -225,7 +203,7 @@ namespace GWMS.UI.Pages
{
OrderCode = Barcode;
});
var ordine = await DataService.OrderGetByCode(Barcode);
var ordine = await DataService.OrderGetByCodeAsync(Barcode);
if (ordine != null)
{
if (ordine.DtExecEnd > ordine.DtOrder)
@@ -279,11 +257,11 @@ namespace GWMS.UI.Pages
// se ho un plantId valido --> altrimenti non abilitato
if (ClaimPlantId == 0)
{
PlantsList = await DataService.PlantsList();
PlantsList = await DataService.PlantsListAsync();
}
else if (ClaimPlantId > 0)
{
var rawData = await DataService.PlantsList();
var rawData = await DataService.PlantsListAsync();
PlantsList = rawData.Where(x => x.PlantId == ClaimPlantId).ToList();
SelPlantId = ClaimPlantId;
}
+2 -2
View File
@@ -179,11 +179,11 @@ namespace GWMS.UI.Pages
// se ho un plantId valido --> altrimenti non abilitato
if (ClaimPlantId == 0)
{
PlantsList = await DataService.PlantsList();
PlantsList = await DataService.PlantsListAsync();
}
else if (ClaimPlantId > 0)
{
var rawData = await DataService.PlantsList();
var rawData = await DataService.PlantsListAsync();
PlantsList = rawData.Where(x => x.PlantId == ClaimPlantId).ToList();
SelPlantId = ClaimPlantId;
}
+6 -14
View File
@@ -3,7 +3,7 @@
@using GWMS.UI.Components
<div class="card">
<div class="card-header table-primary">
<div class="card-header table-primary px-1">
<div class="row">
<div class="col-6 col-lg-2 h3">
Elenco Ordini
@@ -12,7 +12,7 @@
<div class="d-flex justify-content-between">
<div class="p-2">
<div class="form-group mb-0">
<Button id="btnReset" class="btn btn-info btn-sm btn-block" Clicked="ResetFilter" title="Reset Filter"><span class="oi oi-loop-circular"></span></Button>
<button id="btnReset" class="btn btn-info btn-sm btn-block" @onclick="@ResetFilter" title="Reset Filter"><span class="oi oi-loop-circular"></span></button>
</div>
</div>
<div class="p-2">
@@ -37,16 +37,12 @@
<div class="d-flex justify-content-between">
<div class="p-2">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">inizio:</span>
</div>
<span class="input-group-text">
<span class="fas fa-calendar"></span>
</span>
<input class="form-control form-control-sm" type="date" @bind="@DateStart"></input>
</div>
</div>
<div class="p-2">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">fine:</span>
<span class="input-group-text">&rarr;</span>
</div>
<input class="form-control form-control-sm" type="date" @bind="@DateEnd"></input>
</div>
@@ -72,10 +68,6 @@
}
}
</select>
</div>
</div>
<div class="p-2">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<span class="fas fa-industry" aria-hidden="true"></span>
+7 -6
View File
@@ -268,7 +268,7 @@ namespace GWMS.UI.Pages
private async Task ReloadData()
{
isLoading = true;
SearchRecords = await DataService.OrdersGetFilt(AppMService.Order_Filter);
SearchRecords = await DataService.OrdersGetFiltAsync(AppMService.Order_Filter);
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
isLoading = false;
}
@@ -291,9 +291,10 @@ namespace GWMS.UI.Pages
currRecord = new OrderModel()
{
DtOrder = adesso,
DtETA = adesso.AddDays(1),
PlantId = SelPlantId,
SupplierId = SelSupplierId,
OrderDesc = $"Ord Man {currPlant.PlantDesc} - {adesso}",
OrderDesc = $"Ord Man {currPlant.PlantDesc} - {adesso} | Orders",
OrderQty = 1000,
TransporterId = 1,
OrderCode = $"O{currPlant.PlantCode}{adesso:yyMMddHHmm}",
@@ -306,7 +307,7 @@ namespace GWMS.UI.Pages
protected void Edit(OrderModel selRecord)
{
// rileggo dal DB il record corrente...
var pUpd = Task.Run(async () => currRecord = await DataService.OrderGetByCode(selRecord.OrderCode));
var pUpd = Task.Run(async () => currRecord = await DataService.OrderGetByCodeAsync(selRecord.OrderCode));
pUpd.Wait();
}
@@ -333,17 +334,17 @@ namespace GWMS.UI.Pages
protected async Task ReloadAllData()
{
isLoading = true;
SuppliersList = await DataService.SuppliersGetAll();
SuppliersList = await DataService.SuppliersGetAllAsync();
PlantsList = null;
await GetClaimsData();
// se ho un plantId valido --> altrimenti non abilitato
if (ClaimPlantId == 0)
{
PlantsList = await DataService.PlantsList();
PlantsList = await DataService.PlantsListAsync();
}
else if (ClaimPlantId > 0)
{
var rawData = await DataService.PlantsList();
var rawData = await DataService.PlantsListAsync();
PlantsList = rawData.Where(x => x.PlantId == ClaimPlantId).ToList();
SelPlantId = ClaimPlantId;
}
+24 -17
View File
@@ -28,24 +28,24 @@
</div>
</div>
<div class="col-12 col-lg-4 text-right">
<div class="d-flex justify-content-between">
<div class="p-2">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">inizio:</span>
</div>
<input class="form-control form-control-sm" type="date" @bind="@DateStart"></input>
</div>
</div>
<div class="p-2">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">fine:</span>
</div>
<input class="form-control form-control-sm" type="date" @bind="@DateEnd"></input>
<div class="d-flex justify-content-between">
<div class="p-2">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">inizio:</span>
</div>
<input class="form-control form-control-sm" type="date" @bind="@DateStart"></input>
</div>
</div>
<div class="p-2">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">fine:</span>
</div>
<input class="form-control form-control-sm" type="date" @bind="@DateEnd"></input>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-4 text-right">
<div class="d-flex justify-content-between">
@@ -180,9 +180,16 @@
</button>
}
}
else if (ShowAddNew && record.HasRefill)
else if (record.HasRefill)
{
<button class="btn btn-sm btn-success" @onclick="() => CreateNew(record)" title="Aggiunta nuovo Ordine"><i class="far fa-calendar-plus"></i></button>
if (ShowAddNew)
{
<button class="btn btn-sm btn-success" @onclick="() => CreateNew(record)" title="Aggiunta nuovo Ordine"><i class="far fa-calendar-plus"></i></button>
}
else
{
<div class="bg-warning text-center p-1 small text-danger" title="Selezionare Fornitore"><i class="fas fa-industry"></i> <i class="fas fa-arrow-up"></i></div>
}
}
</td>
</tr>
+10 -21
View File
@@ -251,25 +251,13 @@ namespace GWMS.UI.Pages
}
}
#if false
private void OnDateEndChanged(DateTime? date)
{
DateEnd = (DateTime)date;
}
private void OnDateStartChanged(DateTime? date)
{
DateStart = (DateTime)date;
}
#endif
private async Task ReloadData()
{
isLoading = true;
ListRecords = null;
try
{
SearchRecords = await DataService.PlantsAnalisysByFilt(AppMService.Order_Filter);
SearchRecords = await DataService.PlantsAnalisysByFiltAsync(AppMService.Order_Filter);
SearchRecords = SearchRecords.Where(x => x.HasRefill || !_ShowOnlyRefill).ToList();
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
}
@@ -293,7 +281,7 @@ namespace GWMS.UI.Pages
var currSuppl = SuppliersList.Where(x => x.SupplierId == SelSupplierId).FirstOrDefault();
if (currPlant != null && currSuppl != null)
{
DateTime ordDate = currItem.DataRif.AddDays(-1);
DateTime ordDate = currItem.DataRif.AddDays(-1).AddHours(1);
// calcolo il delta crescita come il delta min * num ore durata fillup...
var minIncr = currItem.DeltaMin * (currItem.FillEnd.Subtract(currItem.FillStart).TotalHours);
// creo un nuovo record
@@ -302,12 +290,13 @@ namespace GWMS.UI.Pages
DtOrder = ordDate,
PlantId = SelPlantId,
SupplierId = SelSupplierId,
OrderDesc = $"Ord Man {currPlant.PlantDesc} - {ordDate}",
OrderDesc = $"Ord Man {currPlant.PlantDesc} - {ordDate} | PlantAnalisys",
TransporterId = 1,
OrderCode = $"O{currPlant.PlantCode}{ordDate:yyMMddHHmm}",
LevelStart = Math.Floor(currItem.LevelMin),
LevelEnd = Math.Ceiling(currItem.LevelMax),
DtExecStart = currItem.FillStart.AddMinutes(-1),
DtETA = currItem.FillStart.AddSeconds(10),
DtExecEnd = currItem.FillEnd.AddMinutes(1),
ExecutionQty = Math.Ceiling((currItem.LevelMax - currItem.LevelMin + minIncr) / currItem.DeltaMin) * currItem.DeltaMin,
OrderQty = Math.Ceiling((currItem.LevelMax - currItem.LevelMin + minIncr) / 2000) * 2000
@@ -320,7 +309,7 @@ namespace GWMS.UI.Pages
// rileggo dal DB il record corrente...
var pUpd = Task.Run(async () =>
{
currRecord = await DataService.OrderGetById(selRecord.OrdersIds.FirstOrDefault());
currRecord = await DataService.OrderGetByIdAsync(selRecord.OrdersIds.FirstOrDefault());
});
pUpd.Wait();
}
@@ -347,17 +336,17 @@ namespace GWMS.UI.Pages
protected async Task ReloadAllData()
{
isLoading = true;
SuppliersList = await DataService.SuppliersGetAll();
SuppliersList = await DataService.SuppliersGetAllAsync();
PlantsList = null;
await GetClaimsData();
// se ho un plantId valido --> altrimenti non abilitato
if (ClaimPlantId == 0)
{
PlantsList = await DataService.PlantDtoGetAll();
PlantsList = await DataService.PlantDtoGetAllAsync();
}
else if (ClaimPlantId > 0)
{
var rawData = await DataService.PlantDtoGetAll();
var rawData = await DataService.PlantDtoGetAllAsync();
PlantsList = rawData.Where(x => x.PlantId == ClaimPlantId).ToList();
SelPlantId = ClaimPlantId;
}
@@ -382,7 +371,7 @@ namespace GWMS.UI.Pages
SearchRecords = null;
ListRecords = null;
AppMService.Order_Filter = SelectOrderData.Init(5, 10);
await DataService.PlantsAnalisysReset(AppMService.Order_Filter);
await DataService.PlantsAnalisysResetAsync(AppMService.Order_Filter);
await ReloadAllData();
}
@@ -395,7 +384,7 @@ namespace GWMS.UI.Pages
protected async Task UpdateData()
{
currRecord = null;
await DataService.PlantsAnalisysReset(AppMService.Order_Filter);
await DataService.PlantsAnalisysResetAsync(AppMService.Order_Filter);
await ReloadData();
}
+1 -1
View File
@@ -74,7 +74,7 @@
{
<tr class="@checkSelect(@record.uid)">
<td class="text-nowrap">
@if (record.writable)
@if (record.writable || editAll)
{
if (currRecord == null)
{
+211 -215
View File
@@ -1,5 +1,4 @@
using GWMS.Data.DatabaseModels;
using GWMS.Data.DTO;
using GWMS.UI.Data;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components;
@@ -18,30 +17,168 @@ namespace GWMS.UI.Pages
[Authorize(Roles = "SuperAdmin, Admin, User")]
public partial class PlantParameters : ComponentBase, IDisposable
{
#region Public Methods
public void Dispose()
{
aTimer.Stop();
aTimer.Dispose();
AppMService.EA_SearchUpdated -= OnSeachUpdated;
}
public async void OnSeachUpdated()
{
await UpdateData();
StateHasChanged();
}
#endregion Public Methods
#region Protected Properties
[Inject]
protected IJSRuntime JSRuntime { get; set; }
[Inject]
protected NavigationManager NavManager { get; set; }
protected int totalCount
{
get
{
int answ = 0;
if (ListRecords != null)
{
answ = ListRecords.Count;
}
return answ;
}
}
#endregion Protected Properties
#region Protected Methods
protected void ElapsedTimer(Object source, System.Timers.ElapsedEventArgs e)
{
var pUpd = Task.Run(async () =>
{
await ReloadData();
await InvokeAsync(StateHasChanged);
});
pUpd.Wait();
}
protected override void OnInitialized()
{
var currMode = GetQueryParm("currMode");
if (!string.IsNullOrWhiteSpace(currMode))
{
editAll = currMode.Equals("debug");
}
}
protected override async Task OnInitializedAsync()
{
AppMService.ShowSearch = false;
AppMService.PageName = "Parametri Impianto";
AppMService.PageIcon = "fas fa-folder-open pr-2";
AppMService.EA_SearchUpdated += OnSeachUpdated;
StartTimer();
await ReloadAllData();
}
protected void StartTimer()
{
int tOutPeriod = 3000;
int.TryParse(Configuration["ReloadParamTimer"], out tOutPeriod);
aTimer = new System.Timers.Timer(tOutPeriod);
aTimer.Elapsed += ElapsedTimer;
aTimer.Enabled = true;
aTimer.Start();
}
#endregion Protected Methods
#region Private Fields
private static System.Timers.Timer aTimer;
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
private objItem currRecord = null;
private List<objItem> ListRecords;
private List<PlantDetailModel> PlantsList;
#endregion Private Fields
#region Protected Fields
/// <summary>
/// Valore PlantId filtrato da claim
/// </summary>
protected int ClaimPlantId = -1;
private int ClaimPlantId = -1;
#endregion Protected Fields
private objItem currRecord = null;
private bool editAll = false;
private List<objItem> ListRecords;
private List<PlantDetailModel> PlantsList;
#endregion Private Fields
#region Private Properties
[Inject]
private MessageService AppMService { get; set; }
[Inject]
private AuthenticationStateProvider AuthenticationStateProvider { get; set; }
[Inject]
private IConfiguration Configuration { get; set; }
[Inject]
private GWMSDataService DataService { get; set; }
private DateTime DateEnd
{
get
{
DateTime answ = DateTime.Today.AddDays(1);
if (AppMService.Order_Filter != null)
{
answ = AppMService.Order_Filter.DateEnd;
}
return answ;
}
set
{
if (!AppMService.Order_Filter.DateEnd.Equals(value))
{
AppMService.Order_Filter.DateEnd = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
}
private DateTime DateStart
{
get
{
DateTime answ = DateTime.Today.AddDays(-1);
if (AppMService.Order_Filter != null)
{
answ = AppMService.Order_Filter.DateStart;
}
return answ;
}
set
{
if (!AppMService.Order_Filter.DateStart.Equals(value))
{
AppMService.Order_Filter.DateStart = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
}
private bool isLoading { get; set; } = false;
private string SelPlantCode
@@ -85,98 +222,33 @@ namespace GWMS.UI.Pages
#endregion Private Properties
#region Protected Properties
[Inject]
protected MessageService AppMService { get; set; }
[Inject]
protected AuthenticationStateProvider AuthenticationStateProvider { get; set; }
[Inject]
protected GWMSDataService DataService { get; set; }
protected DateTime DateEnd
{
get
{
DateTime answ = DateTime.Today.AddDays(1);
if (AppMService.Order_Filter != null)
{
answ = AppMService.Order_Filter.DateEnd;
}
return answ;
}
set
{
if (!AppMService.Order_Filter.DateEnd.Equals(value))
{
AppMService.Order_Filter.DateEnd = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
}
protected DateTime DateStart
{
get
{
DateTime answ = DateTime.Today.AddDays(-1);
if (AppMService.Order_Filter != null)
{
answ = AppMService.Order_Filter.DateStart;
}
return answ;
}
set
{
if (!AppMService.Order_Filter.DateStart.Equals(value))
{
AppMService.Order_Filter.DateStart = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
}
protected bool editAll
{
get
{
bool answ = false;
var currMode = GetQueryParm("currMode");
if (!string.IsNullOrEmpty(currMode))
{
answ = currMode.Equals("debug");
}
return answ;
}
}
[Inject]
protected IJSRuntime JSRuntime { get; set; }
[Inject]
protected NavigationManager NavManager { get; set; }
protected int totalCount
{
get
{
int answ = 0;
if (ListRecords != null)
{
answ = ListRecords.Count;
}
return answ;
}
}
#endregion Protected Properties
#region Private Methods
private string checkSelect(string uid)
{
string answ = "";
if (currRecord != null)
{
try
{
answ = (currRecord.uid == uid) ? "table-info" : "";
}
catch
{ }
}
return answ;
}
private void Edit(objItem selRecord)
{
currRecord = selRecord;
}
private async Task ForceReload()
{
await ReloadData();
}
/// <summary>
/// Recupero Claims dell'utente...
///
@@ -201,6 +273,38 @@ namespace GWMS.UI.Pages
}
}
// Blazor: get query parm from the URL
private string GetQueryParm(string parmName)
{
var uriBuilder = new UriBuilder(NavManager.Uri);
var q = System.Web.HttpUtility.ParseQueryString(uriBuilder.Query);
return q[parmName] ?? "";
}
private async Task ReloadAllData()
{
isLoading = true;
PlantsList = null;
await GetClaimsData();
// se ho un plantId valido --> altrimenti non abilitato
if (ClaimPlantId == 0)
{
PlantsList = await DataService.PlantsListAsync();
}
else if (ClaimPlantId > 0)
{
var rawData = await DataService.PlantsListAsync();
PlantsList = rawData.Where(x => x.PlantId == ClaimPlantId).ToList();
SelPlantId = ClaimPlantId;
}
else
{
PlantsList = new List<PlantDetailModel>();
}
isLoading = false;
await ReloadData();
}
private async Task ReloadData()
{
isLoading = true;
@@ -216,145 +320,37 @@ namespace GWMS.UI.Pages
isLoading = false;
}
#endregion Private Methods
#region Protected Methods
protected void Edit(objItem selRecord)
{
currRecord = selRecord;
}
protected async Task ForceReload()
{
await ReloadData();
}
// Blazor: get query parm from the URL
protected string GetQueryParm(string parmName)
{
var uriBuilder = new UriBuilder(NavManager.Uri);
var q = System.Web.HttpUtility.ParseQueryString(uriBuilder.Query);
return q[parmName] ?? "";
}
protected override async Task OnInitializedAsync()
{
AppMService.ShowSearch = false;
AppMService.PageName = "Parametri Impianto";
AppMService.PageIcon = "fas fa-folder-open pr-2";
AppMService.EA_SearchUpdated += OnSeachUpdated;
StartTimer();
await ReloadAllData();
}
protected async Task ReloadAllData()
{
isLoading = true;
PlantsList = null;
await GetClaimsData();
// se ho un plantId valido --> altrimenti non abilitato
if (ClaimPlantId == 0)
{
PlantsList = await DataService.PlantsList();
}
else if (ClaimPlantId > 0)
{
var rawData = await DataService.PlantsList();
PlantsList = rawData.Where(x => x.PlantId == ClaimPlantId).ToList();
SelPlantId = ClaimPlantId;
}
else
{
PlantsList = new List<PlantDetailModel>();
}
isLoading = false;
await ReloadData();
}
protected async Task RemoveItem(objItem selRecord)
private async Task RemoveItem(objItem selRecord)
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Sicuro di voler rimuovere il parametro {selRecord.uid} ({selRecord.name})?"))
return;
if (selRecord != null)
{
await DataService.remObjItem(SelPlantCode, selRecord);
await DataService.RemObjItemAsync(SelPlantCode, selRecord);
}
await ReloadAllData();
}
protected void ResetData()
private void ResetData()
{
DataService.rollBackEdit(currRecord);
currRecord = null;
}
protected void Select(objItem selRecord)
private void Select(objItem selRecord)
{
// applico filtro da selezione
currRecord = selRecord;
}
protected async Task UpdateData()
private async Task UpdateData()
{
currRecord = null;
await DataService.PlantsAnalisysReset(AppMService.Order_Filter);
await DataService.PlantsAnalisysResetAsync(AppMService.Order_Filter);
await ReloadData();
}
#endregion Protected Methods
#region Public Methods
public string checkSelect(string uid)
{
string answ = "";
if (currRecord != null)
{
try
{
answ = (currRecord.uid == uid) ? "table-info" : "";
}
catch
{ }
}
return answ;
}
public void Dispose()
{
aTimer.Stop();
aTimer.Dispose();
AppMService.EA_SearchUpdated -= OnSeachUpdated;
}
public void ElapsedTimer(Object source, System.Timers.ElapsedEventArgs e)
{
var pUpd = Task.Run(async () =>
{
await ReloadData();
await InvokeAsync(StateHasChanged);
});
pUpd.Wait();
}
public async void OnSeachUpdated()
{
await UpdateData();
StateHasChanged();
}
public void StartTimer()
{
int tOutPeriod = 3000;
int.TryParse(Configuration["ReloadParamTimer"], out tOutPeriod);
aTimer = new System.Timers.Timer(tOutPeriod);
aTimer.Elapsed += ElapsedTimer;
aTimer.Enabled = true;
aTimer.Start();
}
#endregion Public Methods
#endregion Private Methods
}
}
+3 -3
View File
@@ -84,7 +84,7 @@ namespace GWMS.UI.Pages
protected void Edit(PlantDTO selRecord)
{
// rileggo dal DB il record corrente...
var pUpd = Task.Run(async () => currRecord = await DataService.PlantDtoGetByCode(selRecord.PlantCode));
var pUpd = Task.Run(async () => currRecord = await DataService.PlantDtoGetByCodeAsync(selRecord.PlantCode));
pUpd.Wait();
}
@@ -152,11 +152,11 @@ namespace GWMS.UI.Pages
// se ho un plantId valido --> altrimenti non abilitato
if (ClaimPlantId == 0)
{
ListRecords = await DataService.PlantDtoGetAll();
ListRecords = await DataService.PlantDtoGetAllAsync();
}
else if (ClaimPlantId > 0)
{
var rawData = await DataService.PlantDtoGetAll();
var rawData = await DataService.PlantDtoGetAllAsync();
ListRecords = rawData.Where(x => x.PlantId == ClaimPlantId).ToList();
}
else
+2 -2
View File
@@ -110,11 +110,11 @@ namespace GWMS.UI.Pages
// se ho un plantId valido --> altrimenti non abilitato
if (ClaimPlantId == 0)
{
ListRecords = await DataService.PlantDtoGetAll();
ListRecords = await DataService.PlantDtoGetAllAsync();
}
else if (ClaimPlantId > 0)
{
var rawData = await DataService.PlantDtoGetAll();
var rawData = await DataService.PlantDtoGetAllAsync();
ListRecords = rawData.Where(x => x.PlantId == ClaimPlantId).ToList();
}
else
+5 -10
View File
@@ -10,19 +10,18 @@
Ordini Fornitore
</div>
<div class="col-12 col-lg-4 text-right">
<div class="d-flex justify-content-between">
<div class="p-2">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">inizio:</span>
<span class="input-group-text">
<span class="fas fa-calendar"></span>
</span>
</div>
<input class="form-control form-control-sm" type="date" @bind="@DateStart"></input>
</div>
</div>
<div class="p-2">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">fine:</span>
<span class="input-group-text">&rarr;</span>
</div>
<input class="form-control form-control-sm" type="date" @bind="@DateEnd"></input>
</div>
@@ -48,10 +47,6 @@
}
}
</select>
</div>
</div>
<div class="p-2">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<span class="fas fa-industry" aria-hidden="true"></span>
+233 -206
View File
@@ -15,6 +15,216 @@ namespace GWMS.UI.Pages
[Authorize(Roles = "SuperAdmin, Admin, ExtUser")]
public partial class Suppliers : ComponentBase, IDisposable
{
#region Public Properties
[Parameter]
public string SupplierIdReq { get; set; } = "";
#endregion Public Properties
#region Public Methods
public string checkSelect(int OrderId)
{
string answ = "";
if (currRecord != null)
{
try
{
answ = (currRecord.OrderId == OrderId) ? "table-info" : "";
}
catch
{ }
}
return answ;
}
public void Dispose()
{
AppMService.EA_SearchUpdated -= OnSeachUpdated;
}
public async void OnSeachUpdated()
{
await UpdateData();
StateHasChanged();
}
#endregion Public Methods
#region Protected Fields
/// <summary>
/// Valore SupplierId filtrato da claim
/// </summary>
protected int ClaimSupplierId = -1;
#endregion Protected Fields
#region Protected Properties
[Inject]
protected MessageService AppMService { get; set; }
[Inject]
protected AuthenticationStateProvider AuthenticationStateProvider { get; set; }
[Inject]
protected GWMSDataService DataService { get; set; }
protected DateTime DateEnd
{
get
{
DateTime answ = DateTime.Today.AddDays(1);
if (AppMService.Order_Filter != null)
{
answ = AppMService.Order_Filter.DateEnd;
}
return answ;
}
set
{
if (!AppMService.Order_Filter.DateEnd.Equals(value))
{
AppMService.Order_Filter.DateEnd = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
}
protected DateTime DateStart
{
get
{
DateTime answ = DateTime.Today.AddDays(-1);
if (AppMService.Order_Filter != null)
{
answ = AppMService.Order_Filter.DateStart;
}
return answ;
}
set
{
if (!AppMService.Order_Filter.DateStart.Equals(value))
{
AppMService.Order_Filter.DateStart = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
}
[Inject]
protected IJSRuntime JSRuntime { get; set; }
[Inject]
protected NavigationManager NavManager { get; set; }
protected int totalCount
{
get
{
int answ = 0;
if (SearchRecords != null)
{
answ = SearchRecords.Count;
}
return answ;
}
}
#endregion Protected Properties
#region Protected Methods
protected void Edit(OrderModel selRecord)
{
// rileggo dal DB il record corrente...
var pUpd = Task.Run(async () => currRecord = await DataService.OrderGetByCodeAsync(selRecord.OrderCode));
pUpd.Wait();
}
protected void ForceReload(int newNum)
{
numRecord = newNum;
}
protected void ForceReloadPage(int newNum)
{
currPage = newNum;
}
protected override void OnInitialized()
{
AppMService.ShowSearch = false;
AppMService.PageName = "Fornitore";
AppMService.PageIcon = "fas fa-industry pr-2";
AppMService.EA_SearchUpdated += OnSeachUpdated;
}
protected override async Task OnParametersSetAsync()
{
ShowClosed = false;
await ReloadAllData();
}
protected async Task ReloadAllData()
{
isLoading = true;
PlantsList = await DataService.PlantsListAsync();
SelSupplierId = 0;
SuppliersList = null;
await GetClaimsData();
// se ho un plantId valido --> altrimenti non abilitato
if (ClaimSupplierId == 0)
{
SuppliersList = await DataService.SuppliersGetAllAsync();
}
else if (ClaimSupplierId > 0)
{
var rawData = await DataService.SuppliersGetAllAsync();
SuppliersList = rawData.Where(x => x.SupplierId == ClaimSupplierId).ToList();
SelSupplierId = ClaimSupplierId;
}
else
{
PlantsList = new List<PlantDetailModel>();
}
isLoading = false;
await ReloadData();
}
protected void ResetData()
{
DataService.rollBackEdit(currRecord);
currRecord = null;
}
protected async Task ResetFilter(SelectOrderData newFilter)
{
currRecord = null;
SearchRecords = null;
ListRecords = null;
AppMService.Order_Filter = SelectOrderData.Init(5, 7);
await ReloadAllData();
}
protected void Select(OrderModel selRecord)
{
// applico filtro da selezione
currRecord = selRecord;
}
protected async Task UpdateData()
{
currRecord = null;
await ReloadData();
}
#endregion Protected Methods
#region Private Fields
private OrderModel currRecord = null;
@@ -26,15 +236,6 @@ namespace GWMS.UI.Pages
#endregion Private Fields
#region Protected Fields
/// <summary>
/// Valore SupplierId filtrato da claim
/// </summary>
protected int ClaimSupplierId = -1;
#endregion Protected Fields
#region Private Properties
private int _currPage { get; set; } = 1;
@@ -115,91 +316,30 @@ namespace GWMS.UI.Pages
}
}
private bool ShowClosed
{
get
{
bool answ = true;
if (AppMService.Order_Filter != null)
{
answ = AppMService.Order_Filter.ShowClosed;
}
return answ;
}
set
{
if (!AppMService.Order_Filter.ShowClosed.Equals(value))
{
AppMService.Order_Filter.ShowClosed = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
}
#endregion Private Properties
#region Protected Properties
[Inject]
protected MessageService AppMService { get; set; }
[Inject]
protected AuthenticationStateProvider AuthenticationStateProvider { get; set; }
[Inject]
protected GWMSDataService DataService { get; set; }
protected DateTime DateEnd
{
get
{
DateTime answ = DateTime.Today.AddDays(1);
if (AppMService.Order_Filter != null)
{
answ = AppMService.Order_Filter.DateEnd;
}
return answ;
}
set
{
if (!AppMService.Order_Filter.DateEnd.Equals(value))
{
AppMService.Order_Filter.DateEnd = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
}
protected DateTime DateStart
{
get
{
DateTime answ = DateTime.Today.AddDays(-1);
if (AppMService.Order_Filter != null)
{
answ = AppMService.Order_Filter.DateStart;
}
return answ;
}
set
{
if (!AppMService.Order_Filter.DateStart.Equals(value))
{
AppMService.Order_Filter.DateStart = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
}
[Inject]
protected IJSRuntime JSRuntime { get; set; }
[Inject]
protected NavigationManager NavManager { get; set; }
protected int totalCount
{
get
{
int answ = 0;
if (SearchRecords != null)
{
answ = SearchRecords.Count;
}
return answ;
}
}
#endregion Protected Properties
#region Public Properties
[Parameter]
public string SupplierIdReq { get; set; } = "";
#endregion Public Properties
#region Private Methods
/// <summary>
@@ -239,124 +379,11 @@ namespace GWMS.UI.Pages
private async Task ReloadData()
{
isLoading = true;
SearchRecords = await DataService.OrdersGetFilt(AppMService.Order_Filter);
SearchRecords = await DataService.OrdersGetFiltAsync(AppMService.Order_Filter);
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
isLoading = false;
}
#endregion Private Methods
#region Protected Methods
protected void Edit(OrderModel selRecord)
{
// rileggo dal DB il record corrente...
var pUpd = Task.Run(async () => currRecord = await DataService.OrderGetByCode(selRecord.OrderCode));
pUpd.Wait();
}
protected void ForceReload(int newNum)
{
numRecord = newNum;
}
protected void ForceReloadPage(int newNum)
{
currPage = newNum;
}
protected override async Task OnInitializedAsync()
{
AppMService.ShowSearch = false;
AppMService.PageName = "Fornitore";
AppMService.PageIcon = "fas fa-industry pr-2";
AppMService.EA_SearchUpdated += OnSeachUpdated;
await ReloadAllData();
}
protected async Task ReloadAllData()
{
isLoading = true;
PlantsList = await DataService.PlantsList();
SelSupplierId = 0;
SuppliersList = null;
await GetClaimsData();
// se ho un plantId valido --> altrimenti non abilitato
if (ClaimSupplierId == 0)
{
SuppliersList = await DataService.SuppliersGetAll();
}
else if (ClaimSupplierId > 0)
{
var rawData = await DataService.SuppliersGetAll();
SuppliersList = rawData.Where(x => x.SupplierId == ClaimSupplierId).ToList();
SelSupplierId = ClaimSupplierId;
}
else
{
PlantsList = new List<PlantDetailModel>();
}
isLoading = false;
await ReloadData();
}
protected void ResetData()
{
DataService.rollBackEdit(currRecord);
currRecord = null;
}
protected async Task ResetFilter(SelectOrderData newFilter)
{
currRecord = null;
SearchRecords = null;
ListRecords = null;
AppMService.Order_Filter = SelectOrderData.Init(5, 7);
await ReloadAllData();
}
protected void Select(OrderModel selRecord)
{
// applico filtro da selezione
currRecord = selRecord;
}
protected async Task UpdateData()
{
currRecord = null;
await ReloadData();
}
#endregion Protected Methods
#region Public Methods
public string checkSelect(int OrderId)
{
string answ = "";
if (currRecord != null)
{
try
{
answ = (currRecord.OrderId == OrderId) ? "table-info" : "";
}
catch
{ }
}
return answ;
}
public void Dispose()
{
AppMService.EA_SearchUpdated -= OnSeachUpdated;
}
public async void OnSeachUpdated()
{
await UpdateData();
StateHasChanged();
}
#endregion Public Methods
}
}
+1 -1
View File
@@ -90,7 +90,7 @@ namespace GWMS.UI.Pages
protected async Task SendEmail()
{
await DataService.TestSendEmail(emailDest, emailOggetto, emailCorpo);
await DataService.TestSendEmailAsync(emailDest, emailOggetto, emailCorpo);
}
#endregion Protected Methods
+55 -49
View File
@@ -3,86 +3,92 @@
@using GWMS.UI.Components
<div class="card">
<div class="card-header table-primary pb-0 mb-0">
<div class="card-header table-primary pb-0 mb-0 px-1">
<div class="row">
<div class="col-12">
<div class="row">
<div class="col-6 pr-0 col-lg-8 h3 mb-0">
<div class="d-flex justify-content-between">
<div class="px-1 h3">
Consegne
</div>
<div class="col-6 col-lg-4">
<div class="row">
<div class="col-6">
<button class="btn btn-sm btn-block btn-secondary" @onclick="() => ToggleFiltPeriod()"><i class="far fa-calendar-alt"></i> <i class="@icnFiltTime"></i></button>
</div>
<div class="col-6">
<button class="btn btn-sm btn-block btn-secondary" @onclick="() => ToggleFiltDest()"><i class="fas fa-gas-pump"></i> <i class="@icnFiltDest"></i></button>
</div>
<div class="px-1">
<div class="d-flex">
@if (!showFiltTime)
{
<div class="px-1">
<button class="btn btn-sm btn-primary px-4" @onclick="() => ToggleFiltPeriod()"><i class="far fa-calendar-alt"></i> <i class="fas fas fa-chevron-down"></i></button>
</div>
}
@if (!showFiltDest)
{
<div class="px-1">
<button class="btn btn-sm btn-primary px-4" @onclick="() => ToggleFiltDest()"><i class="fas fa-gas-pump"></i> <i class="fas fas fa-chevron-down"></i></button>
</div>
}
</div>
</div>
</div>
</div>
<div class="col-12 text-right">
<div class="d-flex small mb-1">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<span class="fas fa-truck-moving" aria-hidden="true"></span>
</span>
</div>
<select @bind="SelTranspId" class="form-control form-control-sm" title="Trasportatore">
<option value="0">--- Tutti ---</option>
@if (TransportersList != null)
{
foreach (var item in TransportersList)
{
<option value="@item.TransporterId">@item.TransporterCode | @item.TransporterDesc</option>
}
}
</select>
</div>
</div>
@if (showFiltTime)
{
<div class="row small">
<div class="col-6">
<div class="input-group input-group-sm">
<input class="form-control form-control-sm" type="date" @bind="@DateStart"></input>
<div class="d-flex small mb-1">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">
<span class="fas fa-calendar"></span>
</span>
</div>
</div>
<div class="col-6">
<div class="input-group input-group-sm">
<input class="form-control form-control-sm" type="date" @bind="@DateEnd"></input>
<input class="form-control form-control-sm" type="date" @bind="@DateStart"></input>
<div class="input-group-prepend">
<span class="input-group-text">&rarr;</span>
</div>
<input class="form-control form-control-sm" type="date" @bind="@DateEnd"></input>
<button class="btn btn-sm btn-info" @onclick="() => ToggleFiltPeriod()"><i class="far fa-calendar-alt"></i> <i class="fas fa-chevron-up"></i></button>
</div>
</div>
}
@if (showFiltDest)
{
<div class="row">
<div class="col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<span class="fas fa-gas-pump" aria-hidden="true"></span>
</span>
</div>
<select @bind="@SelPlantId" class="form-control form-control-sm">
<option value="0">--- Tutti ---</option>
@if (PlantsList != null)
{
foreach (var item in PlantsList)
{
<option value="@item.PlantId">@item.PlantCode | @item.PlantDesc</option>
}
}
</select>
</div>
</div>
</div>
}
<div class="row">
<div class="col">
<div class="d-flex small mb-1">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<span class="fas fa-truck-moving" aria-hidden="true"></span>
<span class="fas fa-gas-pump"></span>
</span>
</div>
<select @bind="SelTranspId" class="form-control form-control-sm" title="Trasportatore">
<select @bind="@SelPlantId" class="form-control form-control-sm">
<option value="0">--- Tutti ---</option>
@if (TransportersList != null)
@if (PlantsList != null)
{
foreach (var item in TransportersList)
foreach (var item in PlantsList)
{
<option value="@item.TransporterId">@item.TransporterCode | @item.TransporterDesc</option>
<option value="@item.PlantId">@item.PlantCode | @item.PlantDesc</option>
}
}
</select>
<button class="btn btn-sm btn-info" @onclick="() => ToggleFiltDest()"><i class="fas fa-gas-pump"></i> <i class="fas fas fa-chevron-up"></i></button>
</div>
</div>
</div>
}
</div>
</div>
</div>
+252 -233
View File
@@ -15,6 +15,233 @@ namespace GWMS.UI.Pages
[Authorize(Roles = "SuperAdmin, Admin, ExtTransp")]
public partial class Transporters : ComponentBase, IDisposable
{
#region Public Methods
public string checkSelect(int OrderId)
{
string answ = "";
if (currRecord != null)
{
try
{
answ = (currRecord.OrderId == OrderId) ? "table-info" : "";
}
catch
{ }
}
return answ;
}
public void Dispose()
{
AppMService.EA_SearchUpdated -= OnSeachUpdated;
}
public async void OnSeachUpdated()
{
await UpdateData();
StateHasChanged();
}
#endregion Public Methods
#region Protected Fields
/// Valore TransporterId filtrato da claim
/// </summary>
protected int ClaimTransporterId = -1;
#endregion Protected Fields
#region Protected Properties
[Inject]
protected MessageService AppMService { get; set; }
[Inject]
protected AuthenticationStateProvider AuthenticationStateProvider { get; set; }
[Inject]
protected GWMSDataService DataService { get; set; }
protected DateTime DateEnd
{
get
{
DateTime answ = DateTime.Today.AddDays(1);
if (AppMService.Order_Filter != null)
{
answ = AppMService.Order_Filter.DateEnd;
}
return answ;
}
set
{
if (!AppMService.Order_Filter.DateEnd.Equals(value))
{
AppMService.Order_Filter.DateEnd = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
}
protected DateTime DateStart
{
get
{
DateTime answ = DateTime.Today.AddDays(-1);
if (AppMService.Order_Filter != null)
{
answ = AppMService.Order_Filter.DateStart;
}
return answ;
}
set
{
if (!AppMService.Order_Filter.DateStart.Equals(value))
{
AppMService.Order_Filter.DateStart = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
}
[Inject]
protected IJSRuntime JSRuntime { get; set; }
[Inject]
protected NavigationManager NavManager { get; set; }
protected bool showFiltDest { get; set; } = false;
protected bool showFiltTime { get; set; } = false;
protected bool showFiltTrasp { get; set; } = false;
protected int totalCount
{
get
{
int answ = 0;
if (ListRecords != null)
{
answ = ListRecords.Count;
}
return answ;
}
}
#endregion Protected Properties
#region Protected Methods
protected void Edit(OrderModel selRecord)
{
// rileggo dal DB il record corrente...
var pUpd = Task.Run(async () => currRecord = await DataService.OrderGetByCodeAsync(selRecord.OrderCode));
pUpd.Wait();
}
protected void ForceReload(int newNum)
{
numRecord = newNum;
}
protected void ForceReloadPage(int newNum)
{
currPage = newNum;
}
protected override void OnInitialized()
{
SelPlantId = 0;
SelTranspId = 0;
AppMService.ShowSearch = false;
AppMService.PageName = "Fornitore";
AppMService.PageIcon = "fas fa-industry pr-2";
AppMService.EA_SearchUpdated += OnSeachUpdated;
}
protected override async Task OnParametersSetAsync()
{
ShowClosed = false;
await ReloadAllData();
}
protected async Task ReloadAllData()
{
isLoading = true;
PlantsList = await DataService.PlantsListAsync();
SelTranspId = 0;
TransportersList = null;
await GetClaimsData();
// se ho un plantId valido --> altrimenti non abilitato
if (ClaimTransporterId == 0)
{
TransportersList = await DataService.TransportersGetAllAsync();
}
else if (ClaimTransporterId > 0)
{
var rawData = await DataService.TransportersGetAllAsync();
TransportersList = rawData.Where(x => x.TransporterId == ClaimTransporterId).ToList();
SelTranspId = ClaimTransporterId;
}
else
{
PlantsList = new List<PlantDetailModel>();
}
isLoading = false;
await ReloadData();
}
protected void ResetData()
{
DataService.rollBackEdit(currRecord);
currRecord = null;
}
protected async Task ResetFilter(SelectOrderData newFilter)
{
currRecord = null;
SearchRecords = null;
ListRecords = null;
AppMService.Order_Filter = SelectOrderData.Init(5, 7);
await ReloadAllData();
}
protected void Select(OrderModel selRecord)
{
// applico filtro da selezione
currRecord = selRecord;
}
protected void ToggleFiltDest()
{
showFiltDest = !showFiltDest;
if (!showFiltDest)
{
SelPlantId = 0;
}
}
protected void ToggleFiltPeriod()
{
showFiltTime = !showFiltTime;
}
protected void ToggleFiltTransp()
{
showFiltTrasp = !showFiltTrasp;
}
protected async Task UpdateData()
{
currRecord = null;
await ReloadData();
}
#endregion Protected Methods
#region Private Fields
private OrderModel currRecord = null;
@@ -26,14 +253,6 @@ namespace GWMS.UI.Pages
#endregion Private Fields
#region Protected Fields
/// Valore TransporterId filtrato da claim
/// </summary>
protected int ClaimTransporterId = -1;
#endregion Protected Fields
#region Private Properties
private int _currPage { get; set; } = 1;
@@ -56,18 +275,12 @@ namespace GWMS.UI.Pages
private string icnFiltDest
{
get
{
return showFiltDest ? "fas fa-chevron-up" : "fas fa-chevron-down";
}
get => showFiltDest ? "fas fa-chevron-up" : "fas fa-chevron-down";
}
private string icnFiltTime
{
get
{
return showFiltTime ? "fas fa-chevron-up" : "fas fa-chevron-down";
}
get => showFiltTime ? "fas fa-chevron-up" : "fas fa-chevron-down";
}
private string icnFiltTran
@@ -140,90 +353,30 @@ namespace GWMS.UI.Pages
}
}
private bool ShowClosed
{
get
{
bool answ = true;
if (AppMService.Order_Filter != null)
{
answ = AppMService.Order_Filter.ShowClosed;
}
return answ;
}
set
{
if (!AppMService.Order_Filter.ShowClosed.Equals(value))
{
AppMService.Order_Filter.ShowClosed = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
}
#endregion Private Properties
#region Protected Properties
[Inject]
protected MessageService AppMService { get; set; }
[Inject]
protected AuthenticationStateProvider AuthenticationStateProvider { get; set; }
[Inject]
protected GWMSDataService DataService { get; set; }
protected DateTime DateEnd
{
get
{
DateTime answ = DateTime.Today.AddDays(1);
if (AppMService.Order_Filter != null)
{
answ = AppMService.Order_Filter.DateEnd;
}
return answ;
}
set
{
if (!AppMService.Order_Filter.DateEnd.Equals(value))
{
AppMService.Order_Filter.DateEnd = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
}
protected DateTime DateStart
{
get
{
DateTime answ = DateTime.Today.AddDays(-1);
if (AppMService.Order_Filter != null)
{
answ = AppMService.Order_Filter.DateStart;
}
return answ;
}
set
{
if (!AppMService.Order_Filter.DateStart.Equals(value))
{
AppMService.Order_Filter.DateStart = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
}
[Inject]
protected IJSRuntime JSRuntime { get; set; }
[Inject]
protected NavigationManager NavManager { get; set; }
protected bool showFiltDest { get; set; } = false;
protected bool showFiltTime { get; set; } = false;
protected bool showFiltTrasp { get; set; } = false;
protected int totalCount
{
get
{
int answ = 0;
if (ListRecords != null)
{
answ = ListRecords.Count;
}
return answ;
}
}
#endregion Protected Properties
#region Private Methods
/// <summary>
@@ -266,145 +419,11 @@ namespace GWMS.UI.Pages
private async Task ReloadData()
{
isLoading = true;
SearchRecords = await DataService.OrdersGetFilt(AppMService.Order_Filter);
SearchRecords = await DataService.OrdersGetFiltAsync(AppMService.Order_Filter);
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
isLoading = false;
}
#endregion Private Methods
#region Protected Methods
protected void Edit(OrderModel selRecord)
{
// rileggo dal DB il record corrente...
var pUpd = Task.Run(async () => currRecord = await DataService.OrderGetByCode(selRecord.OrderCode));
pUpd.Wait();
}
protected void ForceReload(int newNum)
{
numRecord = newNum;
}
protected void ForceReloadPage(int newNum)
{
currPage = newNum;
}
protected override async Task OnInitializedAsync()
{
SelPlantId = 0;
SelTranspId = 0;
AppMService.ShowSearch = false;
AppMService.PageName = "Fornitore";
AppMService.PageIcon = "fas fa-industry pr-2";
AppMService.EA_SearchUpdated += OnSeachUpdated;
await ReloadAllData();
}
protected async Task ReloadAllData()
{
isLoading = true;
PlantsList = await DataService.PlantsList();
SelTranspId = 0;
TransportersList = null;
await GetClaimsData();
// se ho un plantId valido --> altrimenti non abilitato
if (ClaimTransporterId == 0)
{
TransportersList = await DataService.TransportersGetAll();
}
else if (ClaimTransporterId > 0)
{
var rawData = await DataService.TransportersGetAll();
TransportersList = rawData.Where(x => x.TransporterId == ClaimTransporterId).ToList();
SelTranspId = ClaimTransporterId;
}
else
{
PlantsList = new List<PlantDetailModel>();
}
isLoading = false;
await ReloadData();
}
protected void ResetData()
{
DataService.rollBackEdit(currRecord);
currRecord = null;
}
protected async Task ResetFilter(SelectOrderData newFilter)
{
currRecord = null;
SearchRecords = null;
ListRecords = null;
AppMService.Order_Filter = SelectOrderData.Init(5, 7);
await ReloadAllData();
}
protected void Select(OrderModel selRecord)
{
// applico filtro da selezione
currRecord = selRecord;
}
protected void ToggleFiltDest()
{
showFiltDest = !showFiltDest;
if (!showFiltDest)
{
SelPlantId = 0;
}
}
protected void ToggleFiltPeriod()
{
showFiltTime = !showFiltTime;
}
protected void ToggleFiltTransp()
{
showFiltTrasp = !showFiltTrasp;
}
protected async Task UpdateData()
{
currRecord = null;
await ReloadData();
}
#endregion Protected Methods
#region Public Methods
public string checkSelect(int OrderId)
{
string answ = "";
if (currRecord != null)
{
try
{
answ = (currRecord.OrderId == OrderId) ? "table-info" : "";
}
catch
{ }
}
return answ;
}
public void Dispose()
{
AppMService.EA_SearchUpdated -= OnSeachUpdated;
}
public async void OnSeachUpdated()
{
await UpdateData();
StateHasChanged();
}
#endregion Public Methods
}
}
+7 -7
View File
@@ -137,7 +137,7 @@ namespace GWMS.UI.Pages
// clear any error messages
strError = "";
UsersAll = await DataService.UserDataGetFilt(searchVal);
UsersAll = await DataService.UserDataGetFiltAsync(searchVal);
// filtro visualizzazione x tipo SE richeisto
if (FiltUserRole != "0")
@@ -524,7 +524,7 @@ namespace GWMS.UI.Pages
{
case "PlantId":
// elenco plant --> to dictionary!
var plantList = await DataService.PlantsList();
var plantList = await DataService.PlantsListAsync();
if (plantList != null)
{
ClaimValList = plantList
@@ -534,7 +534,7 @@ namespace GWMS.UI.Pages
case "SupplierId":
// elenco plant --> to dictionary!
var suppList = await DataService.SuppliersGetAll();
var suppList = await DataService.SuppliersGetAllAsync();
if (suppList != null)
{
ClaimValList = suppList
@@ -544,7 +544,7 @@ namespace GWMS.UI.Pages
case "TransporterId":
// elenco plant --> to dictionary!
var transpList = await DataService.TransportersGetAll();
var transpList = await DataService.TransportersGetAllAsync();
if (transpList != null)
{
ClaimValList = transpList
@@ -563,15 +563,15 @@ namespace GWMS.UI.Pages
// effettuo refresh valori cache plants/suppliers/transp
if (plantList == null)
{
plantList = await DataService.PlantsList();
plantList = await DataService.PlantsListAsync();
}
if (suppList == null)
{
suppList = await DataService.SuppliersGetAll();
suppList = await DataService.SuppliersGetAllAsync();
}
if (transpList == null)
{
transpList = await DataService.TransportersGetAll();
transpList = await DataService.TransportersGetAllAsync();
}
}
+4 -4
View File
@@ -206,7 +206,7 @@ namespace GWMS.UI.Pages
private async Task ReloadData()
{
isLoading = true;
ListRecords = await DataService.WeekPlanGet();
ListRecords = await DataService.WeekPlanGetAsync();
// calcolo min/max...
checkHourRange();
isLoading = false;
@@ -252,9 +252,9 @@ namespace GWMS.UI.Pages
protected async Task ReloadAllData()
{
PlantsList = await DataService.PlantsList();
SuppliersList = await DataService.SuppliersGetAll();
TransportersList = await DataService.TransportersGetAll();
PlantsList = await DataService.PlantsListAsync();
SuppliersList = await DataService.SuppliersGetAllAsync();
TransportersList = await DataService.TransportersGetAllAsync();
await ReloadData();
}
+286 -40
View File
@@ -1,55 +1,301 @@
using Microsoft.AspNetCore.Hosting;
using GWMS.Data;
using GWMS.UI.Areas.Identity;
using GWMS.UI.Data;
using HealthChecks.UI.Client;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.UI.Services;
using Microsoft.AspNetCore.Localization;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using NLog;
using NLog.Targets;
using NLog.Web;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Globalization;
namespace GWMS.UI
// ====================================================================
// 1. IL "FIX" CRITICO PER HTTP/2 (OTLP GRPC)
// Deve essere la prima riga eseguita.
// ====================================================================
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger();
logger.Info("GMWS.UI Application Starting Up");
try
{
public class Program
var builder = WebApplication.CreateBuilder(args);
// Setup NLog come provider di logging
builder.Logging.ClearProviders();
builder.Host.UseNLog();
// ====================================================================
// 2. CONFIGURAZIONE SERVIZI (ex ConfigureServices)
// ====================================================================
var Configuration = builder.Configuration;
// REDIS setup
string connStringRedis = Configuration.GetConnectionString("Redis");
string redisSrvAddr = connStringRedis.Contains(":")
? connStringRedis.Substring(0, connStringRedis.IndexOf(":"))
: "127.0.0.1";
var redisMultiplexer = ConnectionMultiplexer.Connect(connStringRedis);
builder.Services.AddSingleton<IConnectionMultiplexer>(redisMultiplexer);
// --- SETUP OPENTELEMETRY ---
var otelEnabled = Configuration.GetValue<bool>("Otel:EnableTracing", false);
var otelEndpoint = Configuration["Otel:Endpoint"];
var otelDsn = Configuration["Otel:Dsn"];
if (otelEnabled)
{
#region Public Methods
var appVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "1.0.0";
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.ConfigureLogging(logging =>
{
logging.ClearProviders();
#if DEBUG
//logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Debug);
logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Information);
#else
logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Warning);
#endif
});
builder.Services.AddOpenTelemetry()
.WithTracing(tracerProviderBuilder =>
{
tracerProviderBuilder
.SetResourceBuilder(ResourceBuilder.CreateDefault()
.AddService(serviceName: "GWMS", serviceVersion: appVersion))
.AddSource("GWMS.Data")
.AddSource("GWMS.UI")
.AddAspNetCoreInstrumentation(options =>
{
options.Filter = ctx => !ctx.Request.Path.StartsWithSegments("/health");
})
//.AddHttpClientInstrumentation()
.AddHttpClientInstrumentation(options =>
{
// Questo evita di tracciare le chiamate in USCITA verso l'endpoint health
options.FilterHttpRequestMessage = (httpRequestMessage) =>
{
var uri = httpRequestMessage.RequestUri?.ToString() ?? "";
// Escludi chiamate che contengono /health o che puntano a localhost/loopback
return !uri.Contains("/health") && !uri.Contains("[::]") && !uri.Contains("127.0.0.1");
};
})
.AddEntityFrameworkCoreInstrumentation()
.AddRedisInstrumentation(redisMultiplexer);
public static void Main(string[] args)
if (!string.IsNullOrWhiteSpace(otelEndpoint))
{
tracerProviderBuilder.AddOtlpExporter(options =>
{
options.Endpoint = new Uri(otelEndpoint);
// --- LOGICA ADATTIVA PROTOCOLLO ---
if (otelEndpoint.Contains(":4318"))
{
options.Protocol = OpenTelemetry.Exporter.OtlpExportProtocol.HttpProtobuf;
// L'SDK aggiunge automaticamente /v1/traces se non presente
}
else
{
options.Protocol = OpenTelemetry.Exporter.OtlpExportProtocol.Grpc;
}
if (!string.IsNullOrWhiteSpace(otelDsn))
{
options.Headers = $"uptrace-dsn={otelDsn}";
}
});
}
});
// Configurazione NLog OTLP Target
if (!string.IsNullOrWhiteSpace(otelEndpoint))
{
var Log = LogManager.GetCurrentClassLogger();
try
var otlpTarget = new OtlpTarget
{
Log.Info("GMWS.UI Application Starting Up");
CreateHostBuilder(args).Build().Run();
}
catch (Exception exception)
{
Log.Error(exception, "Stopped GMWS.UI program because of exception");
throw;
}
finally
{
LogManager.Shutdown();
}
}
Name = "UptraceRealtime",
Endpoint = otelEndpoint,
ServiceName = "GWMS.Data"
};
#endregion Public Methods
// --- LOGICA ADATTIVA PER NLOG ---
if (otelEndpoint.Contains(":4318"))
{
otlpTarget.UseHttp = true;
// NLog richiede l'URL completo per i log se usi HTTP
if (!otelEndpoint.EndsWith("/v1/logs"))
{
otlpTarget.Endpoint = otelEndpoint.TrimEnd('/') + "/v1/logs";
}
}
if (!string.IsNullOrWhiteSpace(otelDsn))
{
otlpTarget.Headers = $"uptrace-dsn={otelDsn}";
}
var nlogConfig = LogManager.Configuration ?? new NLog.Config.LoggingConfiguration();
nlogConfig.AddTarget(otlpTarget);
nlogConfig.AddRule(NLog.LogLevel.Info, NLog.LogLevel.Fatal, otlpTarget);
LogManager.Configuration = nlogConfig;
LogManager.ReconfigExistingLoggers();
}
}
// Init DB Logic
string dbServerAddr = Configuration["DbConfig:Server"];
string nKey = Configuration["DbConfig:nKey"];
string sKey = Configuration["DbConfig:sKey"];
DbConfig.InitDb(dbServerAddr, nKey, sKey);
DbConfig.CheckUser(nKey, sKey);
DbConfig.ExecMigrationMain();
string connStringDB = DbConfig.CONNECTION_STRING;
// HealthChecks
builder.Services.AddHealthChecks()
.AddMySql(connStringDB, "MySql instance")
.AddAsyncCheck($"DB PING ({dbServerAddr})", () => GWMS.UI.Health.Checks.PingCheck(dbServerAddr))
.AddAsyncCheck($"Redis PING ({redisSrvAddr})", () => GWMS.UI.Health.Checks.PingCheck(redisSrvAddr))
.AddProcessAllocatedMemoryHealthCheck(512, "Max Process memory (<512MB)", failureStatus: HealthStatus.Degraded)
.AddRedis(connStringRedis, "Redis", failureStatus: HealthStatus.Degraded)
.AddAsyncCheck("MySql Root User", () => GWMS.UI.Health.Checks.DbUserRoot("MySql"))
.AddAsyncCheck("MySql Identity", () => GWMS.UI.Health.Checks.DbIdentity(DbConfig.DATABASE_NAME))
.AddAsyncCheck("MySql PlantLog", () => GWMS.UI.Health.Checks.DbPlantTable(DbConfig.DATABASE_NAME));
builder.Services.AddHealthChecksUI(s =>
{
s.AddHealthCheckEndpoint("GWMS_Services", "health");
s.SetEvaluationTimeInSeconds(60);
s.SetHeaderText("GWMS Health Check Status");
}).AddInMemoryStorage();
// Identity & DB
var serverVersion = DbConfig.MysqlServerVersion(connStringDB);
builder.Services.AddDbContext<UserIdentityDbContext>(options =>
options.UseMySql(connStringDB, serverVersion));
builder.Services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
.AddRoles<IdentityRole>()
.AddEntityFrameworkStores<UserIdentityDbContext>();
// Auth & Cookies
builder.Services.ConfigureApplicationCookie(o =>
{
o.ExpireTimeSpan = TimeSpan.FromDays(30);
o.SlidingExpiration = true;
});
builder.Services.Configure<DataProtectionTokenProviderOptions>(o => o.TokenLifespan = TimeSpan.FromHours(3));
// Email
builder.Services.AddTransient<IEmailSender, MailKitEmailSender>();
builder.Services.Configure<MailKitEmailSenderOptions>(options =>
{
options.Host_Address = Configuration["ExternalProviders:MailKit:SMTP:Address"];
options.Host_Port = Convert.ToInt32(Configuration["ExternalProviders:MailKit:SMTP:Port"]);
options.Host_Username = Configuration["ExternalProviders:MailKit:SMTP:Account"];
options.Host_Password = Configuration["ExternalProviders:MailKit:SMTP:Password"];
options.Sender_EMail = Configuration["ExternalProviders:MailKit:SMTP:SenderEmail"];
options.Sender_Name = Configuration["ExternalProviders:MailKit:SMTP:SenderName"];
});
builder.Services.AddLocalization();
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
builder.Services.AddDatabaseDeveloperPageExceptionFilter();
// Services
builder.Services.AddScoped<AuthenticationStateProvider, RevalidatingIdentityAuthenticationStateProvider<IdentityUser>>();
builder.Services.AddScoped<GWMSDataService>();
builder.Services.AddScoped<MessageService>();
var app = builder.Build();
// ====================================================================
// 3. CONFIGURAZIONE PIPELINE (ex Configure)
// ====================================================================
app.UsePathBase(Configuration["RuntimeOpt:BaseAppPath"]);
if (app.Environment.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseMigrationsEndPoint();
}
else
{
app.UseExceptionHandler("/Error");
app.UseHsts();
}
// ====================================================================
// Imposta cultura globale
// ====================================================================
#if true
var supportedCultures = new[] { new CultureInfo("it-IT") };
app.UseRequestLocalization(new RequestLocalizationOptions
{
DefaultRequestCulture = new RequestCulture("it-IT"),
SupportedCultures = supportedCultures,
FallBackToParentCultures = false
});
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.CreateSpecificCulture("it-IT");
#else
var culture = new CultureInfo("en-US");
var localizationOptions = new RequestLocalizationOptions
{
DefaultRequestCulture = new Microsoft.AspNetCore.Localization.RequestCulture(culture),
SupportedCultures = new List<CultureInfo> { culture },
SupportedUICultures = new List<CultureInfo> { culture }
};
// ⚠️ IMPORTANTE: questo deve venire PRIMA di MapBlazorHub
app.UseRequestLocalization(localizationOptions);
CultureInfo.DefaultThreadCurrentCulture = culture;
CultureInfo.DefaultThreadCurrentUICulture = culture;
#endif
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
});
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.MapControllers();
app.MapBlazorHub();
app.MapHealthChecksUI();
app.MapHealthChecks("/health", new HealthCheckOptions
{
Predicate = _ => true,
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
});
app.MapFallbackToPage("/_Host");
app.Run();
}
catch (Exception exception)
{
logger.Error(exception, "Stopped GMWS.UI program because of exception");
throw;
}
finally
{
LogManager.Shutdown();
}
-223
View File
@@ -1,223 +0,0 @@
using GWMS.Data;
using GWMS.UI.Areas.Identity;
using GWMS.UI.Data;
using HealthChecks.UI.Client;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.UI.Services;
using Microsoft.AspNetCore.Localization;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Hosting;
using StackExchange.Redis;
using System;
using System.Globalization;
using System.Linq;
namespace GWMS.UI
{
public class Startup
{
#region Public Constructors
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
#endregion Public Constructors
#region Public Properties
public IConfiguration Configuration { get; }
#endregion Public Properties
#region Public Methods
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// aggiunt base URL x routing corretto
app.UsePathBase(Configuration["RuntimeOpt:BaseAppPath"]);
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseMigrationsEndPoint();
}
else
{
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
// cultura IT...
var supportedCultures = new[]{
new CultureInfo("it-IT")
};
app.UseRequestLocalization(new RequestLocalizationOptions
{
DefaultRequestCulture = new RequestCulture("it-IT"),
SupportedCultures = supportedCultures,
FallBackToParentCultures = false
});
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.CreateSpecificCulture("it-IT");
//// Registrazione Elmah:
//// https://github.com/ElmahCore/ElmahCore
//app.UseElmah();
// fix forwarders
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
});
app.UsePathBase(Configuration["BaseAppPath"]);
app.UseAuthentication();
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
endpoints.MapBlazorHub();
endpoints.MapHealthChecksUI();
endpoints.MapHealthChecks("/health", new HealthCheckOptions
{
Predicate = _ => true,
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
});
endpoints.MapFallbackToPage("/_Host");
});
}
// This method gets called by the runtime. Use this method to add services to the container.
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
// REDIS setup
string connStringRedis = Configuration.GetConnectionString("Redis");
string redisSrvAddr = "127.0.0.1";
if (connStringRedis.Contains(":"))
{
redisSrvAddr = connStringRedis.Substring(0, connStringRedis.IndexOf(":"));
}
// avvio oggetto shared x redis...
var redisMultiplexer = ConnectionMultiplexer.Connect(connStringRedis);
// Add services x accesso dati
services.AddSingleton<IConnectionMultiplexer>(redisMultiplexer);
// init info x DB
string dbServerAddr = Configuration["DbConfig:Server"];
string nKey = Configuration["DbConfig:nKey"];
string sKey = Configuration["DbConfig:sKey"];
DbConfig.InitDb(dbServerAddr, nKey, sKey);
// inizializzo il DB e creo (se necessario) l'utente
DbConfig.CheckUser(nKey, sKey);
// verifico se serve applicazione migrazioni
DbConfig.ExecMigrationMain();
//DbConfig.ExecMigrationIdentity();
// altri parametri per check vari
string connStringDB = DbConfig.CONNECTION_STRING;
// healthchecks
services.AddHealthChecks()
.AddMySql(connStringDB, "MySql instance")
.AddAsyncCheck($"DB PING ({dbServerAddr})", () => Health.Checks.PingCheck(dbServerAddr))
.AddAsyncCheck($"Redis PING ({redisSrvAddr})", () => Health.Checks.PingCheck(redisSrvAddr))
.AddProcessAllocatedMemoryHealthCheck(512, "Max Process memory (<512MB)", failureStatus: HealthStatus.Degraded) // 512 MB max allocated memory
.AddRedis(Configuration.GetConnectionString("Redis"), "Redis", failureStatus: HealthStatus.Degraded)
.AddAsyncCheck($"MySql Root User", () => Health.Checks.DbUserRoot("MySql"))
.AddAsyncCheck($"MySql Identity", () => Health.Checks.DbIdentity(DbConfig.DATABASE_NAME))
.AddAsyncCheck($"MySql PlantLog", () => Health.Checks.DbPlantTable(DbConfig.DATABASE_NAME))
;
services
.AddHealthChecksUI(s =>
{
s.AddHealthCheckEndpoint("GWMS_Services", "health");
s.SetEvaluationTimeInSeconds(60);
s.SetMinimumSecondsBetweenFailureNotifications(120);
s.SetApiMaxActiveRequests(5);
s.SetHeaderText("GWMS Health Check Status");
})
.AddInMemoryStorage();
// cookie applicazione da 14 gg (defaul) a 30
services.ConfigureApplicationCookie(o =>
{
o.ExpireTimeSpan = TimeSpan.FromDays(30);
o.SlidingExpiration = true;
});
// token di sicurezza dati a 3h
services.Configure<DataProtectionTokenProviderOptions>(o =>
o.TokenLifespan = TimeSpan.FromHours(3));
// abilitazione x email management con MailKit
services.AddTransient<IEmailSender, MailKitEmailSender>();
services.Configure<MailKitEmailSenderOptions>(options =>
{
options.Host_Address = Configuration["ExternalProviders:MailKit:SMTP:Address"];
options.Host_Port = Convert.ToInt32(Configuration["ExternalProviders:MailKit:SMTP:Port"]);
options.Host_Username = Configuration["ExternalProviders:MailKit:SMTP:Account"];
options.Host_Password = Configuration["ExternalProviders:MailKit:SMTP:Password"];
options.Sender_EMail = Configuration["ExternalProviders:MailKit:SMTP:SenderEmail"];
options.Sender_Name = Configuration["ExternalProviders:MailKit:SMTP:SenderName"];
});
// setup MySql
var serverVersion = DbConfig.MysqlServerVersion(connStringDB);
services.AddDbContext<UserIdentityDbContext>(options =>
options.UseMySql(connStringDB, serverVersion));
// identity management
services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
.AddRoles<IdentityRole>()
.AddEntityFrameworkStores<UserIdentityDbContext>();
//// Elmah
//services.AddElmah();
//string elmaConn = "Data Source=SQL2016DEV;Initial Catalog=Elmah;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=SHERPA.BBM;";
//services.AddElmah<SqlErrorLog>(options =>
//{
// options.ConnectionString = elmaConn;
//});
services.AddLocalization();
services.AddRazorPages();
services.AddServerSideBlazor();
services.AddScoped<AuthenticationStateProvider, RevalidatingIdentityAuthenticationStateProvider<IdentityUser>>();
services.AddDatabaseDeveloperPageExceptionFilter();
services.AddSingleton<IConfiguration>(Configuration);
services.AddScoped<GWMSDataService>();
services.AddScoped<MessageService>();
}
#endregion Public Methods
}
}
+5
View File
@@ -7,5 +7,10 @@
"Microsoft.Hosting.Lifetime": "Information"
}
},
"Otel": {
"EnableTracing": true,
"Endpoint": "https://uptrace.egalware.com:14317",
"Dsn": "https://DC_iX71mEzg7KA7atQEBdQ@uptrace.egalware.com?grpc=14317"
},
"ZCodeUrl": "http://10.74.82.218/zcode/"
}
+18
View File
@@ -6,6 +6,12 @@
"Microsoft.Hosting.Lifetime": "Information"
}
},
"Otel": {
"EnableTracing": true,
//"Endpoint": "http://localhost:4317",
"Endpoint": "http://127.0.0.1:4318/v1/traces",
"Dsn": ""
},
"ConnectionStrings": {
"Redis": "localhost:26379, serviceName=prod-ovh, DefaultDatabase=13, connectTimeout=5000, syncTimeout=5000, asyncTimeout=5000, abortConnect=false, ssl=false, allowAdmin=true",
"AuthConnection": "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
@@ -18,6 +24,18 @@
"nKey": "PZZFRR",
"sKey": "M3T@n0"
},
"ExternalProviders": {
"MailKit": {
"SMTP": {
"Address": "smtp.gmail.com",
"Port": "587",
"Account": "services@steamware.net",
"Password": "vpsad24068",
"SenderEmail": "services@steamware.net",
"SenderName": "GWMS Notification"
}
}
},
"ZCodeUrl": "https://qrcode.steamware.net/",
"RuntimeOpt": {
"BaseUrl": "https://gwms.egalware.com",
+5
View File
@@ -6,6 +6,11 @@
"Microsoft.Hosting.Lifetime": "Information"
}
},
"Otel": {
"EnableTracing": true,
"Endpoint": "http://localhost:4317",
"Dsn": ""
},
"ZCodeUrl": "https://qrcode.steamware.net/",
"RuntimeOpt": {
"BaseUrl": "https://corelocal.egalware.com",
+10 -2
View File
@@ -6,16 +6,23 @@
"Microsoft.Hosting.Lifetime": "Information"
}
},
"Otel": {
"EnableTracing": true,
"Endpoint": "https://uptrace.egalware.com:14317",
"Dsn": "https://DC_iX71mEzg7KA7atQEBdQ@uptrace.egalware.com?grpc=14317"
},
"AllowedHosts": "*",
"ConnectionStrings": {
"Redis": "localhost:26379, serviceName=devel, DefaultDatabase=13, connectTimeout=3000, syncTimeout=3000, asyncTimeout=3000, abortConnect=false, ssl=false, allowAdmin=true",
"Redis": "redis.ufficio:26379, serviceName=devel, DefaultDatabase=13, connectTimeout=3000, syncTimeout=3000, asyncTimeout=3000, abortConnect=false, ssl=false, allowAdmin=true",
"AuthConnection": "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
"DefaultConnection": "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
"AdminConnection": "Server=localhost;port=3306;database=GWMS;user=root;pwd=Egalware_24068!;sslmode=None;",
"GWMS.Data": "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;"
},
"DbConfig": {
"Server": "localhost",
//"Server": "localhost",
"Server": "mdb.ufficio",
//"Server": "mdb.ovh",
"nKey": "PZZFRR",
"sKey": "M3T@n0"
},
@@ -29,6 +36,7 @@
"ReloadStatusTimer": 20000,
"RuntimeOpt": {
"CodApp": "GWMS",
"RoundFact": 1000,
"NumPar": 4,
"BaseUrl": "https://localhost:5003",
"BaseAppPath": "/pizzaferri/",
+1 -1
View File
@@ -8,7 +8,7 @@ $FileManIn="..\Resources\manifest-original.xml"
$FileManOut="..\Resources\manifest.xml"
$FileCLogIn="..\Resources\ChangeLog-original.html"
$FileCLogOut="..\Resources\ChangeLog.html"
$MajMin="1.0."
$MajMin="1.2."
$currentDate = get-date -format yyMM;
$currentTime = get-date -format ddHH;
$find = "<Version>(.|\n)*?</Version>";
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>GWMS - Gas Warehouse Management System</i>
<h4>Versione: 1.0.2407.3013</h4>
<h4>Versione: 1.2.2603.1310</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
1.0.2407.3013
1.2.2603.1310
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.0.2407.3013</version>
<version>1.2.2603.1310</version>
<url>http://nexus.steamware.net/repository/SWS/GWMS/stable/0/GWMS.UI.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/GWMS/stable/0/ChangeLog.html</changelog>
<mandatory>false</mandatory>