OK metodo get proj modificati
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Progetti dato RestToken
|
||||
/// Elenco dizionario stato Progetti dato RestToken
|
||||
/// GET api/Projects/proj-arch/2cba60c7-7be4-40b1-aa0d-52e7c71fc1a7
|
||||
/// </summary>
|
||||
/// <param name="id">Rest Token cliente</param>
|
||||
/// <param name="DtIso">DateTime di riferimento nel formato yyyyMMddHHmmss</param>
|
||||
/// <returns></returns>
|
||||
/// <returns>Dizionario nel formato CloudId / isArchived</returns>
|
||||
[HttpGet("proj-arch-get/{id}")]
|
||||
public async Task<Dictionary<int, bool>> ProjArchivedGet(string id, int DtIso)
|
||||
public async Task<Dictionary<int, bool>> ProjArchivedGet(string id, string DtIso)
|
||||
{
|
||||
Dictionary<int, bool> CurrRec = new Dictionary<int, bool>();
|
||||
Dictionary<int, bool> listRec = new Dictionary<int, bool>();
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user