diff --git a/MagMan.Data.Tenant/Controllers/TenantController.cs b/MagMan.Data.Tenant/Controllers/TenantController.cs
index dc25df5..9c83fc1 100644
--- a/MagMan.Data.Tenant/Controllers/TenantController.cs
+++ b/MagMan.Data.Tenant/Controllers/TenantController.cs
@@ -1020,6 +1020,31 @@ namespace MagMan.Data.Tenant.Controllers
}
return dbResult;
}
+ ///
+ /// Elenco progetti modificati dopo data
+ ///
+ /// Stringa connessione (variabile x cliente)
+ /// Data rispetto cui cercare modifiche successive
+ /// Elenco records progetti
+ public List ProjectGetModAfter(string connString, DateTime DtRif)
+ {
+ List dbResult = new List();
+ using (MagManContext dbCtx = new MagManContext(connString))
+ {
+ dbResult = dbCtx
+ .DbSetProjects
+ .Where(x => x.DtLastAction >= DtRif)
+ .ToList();
+ if (dbResult == null)
+ {
+ dbResult = new List();
+ }
+ }
+ return dbResult;
+ }
+
+
+
///
/// Elenco progetti dato cliente e macchina
diff --git a/MagMan.Data.Tenant/Services/TenantService.cs b/MagMan.Data.Tenant/Services/TenantService.cs
index 4e9a273..02b378f 100644
--- a/MagMan.Data.Tenant/Services/TenantService.cs
+++ b/MagMan.Data.Tenant/Services/TenantService.cs
@@ -1214,6 +1214,35 @@ namespace MagMan.Data.Tenant.Services
return dbResult;
}
+ ///
+ /// Elenco record progetti dato Key + data ultima modifica registrata
+ ///
+ /// Key di riferimento
+ /// Data rispetto cui cercare modifiche successive
+ ///
+ public List ProjectGetModAfter(int nKey, DateTime DtRif)
+ {
+ string source = "DB";
+ string cString = ConnString(nKey);
+ List dbResult = new List();
+ try
+ {
+ // NON Usa la cache poiché voglio sync DB-DB in realtime
+ Stopwatch stopWatch = new Stopwatch();
+ stopWatch.Start();
+ dbResult = dbController.ProjectGetModAfter(cString, DtRif);
+ stopWatch.Stop();
+ TimeSpan ts = stopWatch.Elapsed;
+ Log.Debug($"ProjectGetModAfter | {source} in: {ts.TotalMilliseconds} ms");
+ }
+ catch (Exception exc)
+ {
+ Log.Error($"Error during ProjectGetModAfter:{Environment.NewLine}{exc}");
+ }
+ return dbResult;
+ }
+
+
///
/// Lista progetti x macchina
///
diff --git a/MagMan.UI/Controllers/ProjectsController.cs b/MagMan.UI/Controllers/ProjectsController.cs
index b8b3fbf..5c50485 100644
--- a/MagMan.UI/Controllers/ProjectsController.cs
+++ b/MagMan.UI/Controllers/ProjectsController.cs
@@ -12,6 +12,7 @@ using Newtonsoft.Json;
using NLog;
using Org.BouncyCastle.Asn1.Pkcs;
using System.Diagnostics;
+using System.Globalization;
namespace MagMan.UI.Controllers
{
@@ -102,26 +103,38 @@ namespace MagMan.UI.Controllers
}
///
- /// Elenco Progetti dato RestToken
+ /// Elenco dizionario stato Progetti dato RestToken
/// GET api/Projects/proj-arch/2cba60c7-7be4-40b1-aa0d-52e7c71fc1a7
///
/// Rest Token cliente
/// DateTime di riferimento nel formato yyyyMMddHHmmss
- ///
+ /// Dizionario nel formato CloudId / isArchived
[HttpGet("proj-arch-get/{id}")]
- public async Task> ProjArchivedGet(string id, int DtIso)
+ public async Task> ProjArchivedGet(string id, string DtIso)
{
- Dictionary CurrRec = new Dictionary();
+ Dictionary listRec = new Dictionary();
if (!string.IsNullOrEmpty(id))
{
// in primis recupero codice chiave da token...
int nKey = await MTAdmService.MainKeyByToken(id);
-#if false
- var rawResult = await TService.ProjectGetById(nKey, ProjCloudId);
- CurrRec = rawResult != null ? TService.ProjectToDto(rawResult) : new ProjectDTO();
-#endif
+ // formato decodifica stringa DateTime
+ string format = "yyyyMMddHHmmss";
+ CultureInfo provider = CultureInfo.InvariantCulture;
+ DateTime dtRif = DateTime.Now;
+ try
+ {
+ dtRif = DateTime.ParseExact(DtIso, format, provider);
+ }
+ catch (Exception exc)
+ {
+ Log.Error($"Eccezione in gestione parse stringa DateTime: IN: {DtIso} | format: {format}{Environment.NewLine}{exc}");
+ }
+ var rawResult = TService.ProjectGetModAfter(nKey, dtRif);
+ await Task.Delay(1);
+ // converto in dizionario x uscita...
+ listRec = rawResult.ToDictionary(x => x.ProjDbId, x => x.IsArchived);
}
- return CurrRec;
+ return listRec;
}
diff --git a/MagMan.UI/MagMan.UI.csproj b/MagMan.UI/MagMan.UI.csproj
index cd815a4..62f7720 100644
--- a/MagMan.UI/MagMan.UI.csproj
+++ b/MagMan.UI/MagMan.UI.csproj
@@ -2,7 +2,7 @@
net6.0
- 1.0.2407.1620
+ 1.0.2407.1709
enable
enable
true
diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html
index 528e641..a5b15d8 100644
--- a/Resources/ChangeLog.html
+++ b/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
MagMan - Wood Warehouse Management System
- Versione: 1.0.2407.1620
+ Versione: 1.0.2407.1709
Note di rilascio:
-
diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt
index c513ac2..908e4a6 100644
--- a/Resources/VersNum.txt
+++ b/Resources/VersNum.txt
@@ -1 +1 @@
-1.0.2407.1620
+1.0.2407.1709
diff --git a/Resources/manifest.xml b/Resources/manifest.xml
index 02d4271..483588c 100644
--- a/Resources/manifest.xml
+++ b/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 1.0.2407.1620
+ 1.0.2407.1709
http://nexus.steamware.net/repository/SWS/MagMan/stable/0/MagMan.UI.zip
http://nexus.steamware.net/repository/SWS/MagMan/stable/0/ChangeLog.html
false