Continuo pagina setup x ricalcolo completo archivio
This commit is contained in:
@@ -9,6 +9,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using MP.FileData.DatabaseModels;
|
||||
using Newtonsoft.Json;
|
||||
using MP.FileData.DTO;
|
||||
|
||||
namespace MP.FileData.Controllers
|
||||
{
|
||||
@@ -535,6 +536,38 @@ namespace MP.FileData.Controllers
|
||||
return done;
|
||||
}
|
||||
|
||||
public List<ArchiveStatusDTO> GetArchiveStatus()
|
||||
{
|
||||
List<ArchiveStatusDTO> ArchiveList = new List<ArchiveStatusDTO>();
|
||||
using (MoonPro_ProgContext localDbCtx = new MoonPro_ProgContext(_configuration))
|
||||
{
|
||||
ArchiveList = localDbCtx
|
||||
.DbSetMacchine
|
||||
.Select(x => new ArchiveStatusDTO()
|
||||
{
|
||||
IdxMacchina = x.IdxMacchina,
|
||||
Nome = x.Nome,
|
||||
Descrizione = x.Descrizione,
|
||||
BasePath = x.BasePath
|
||||
})
|
||||
.ToList();
|
||||
// ora ciclo a cercare i file...
|
||||
foreach (var item in ArchiveList)
|
||||
{
|
||||
item.TotFile = localDbCtx
|
||||
.DbSetProgFile
|
||||
.Where(x => x.IdxMacchina == item.IdxMacchina && x.Active)
|
||||
.Count();
|
||||
|
||||
item.NumChanged = localDbCtx
|
||||
.DbSetProgFile
|
||||
.Where(x => x.IdxMacchina == item.IdxMacchina && x.Active && x.DiskStatus == FileState.Changed)
|
||||
.Count();
|
||||
}
|
||||
}
|
||||
return ArchiveList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco tabella Macchine
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user