Da completare che non compila...

This commit is contained in:
Samuele Locatelli
2026-04-15 19:35:31 +02:00
parent 7a4d5cbe2f
commit b0e960be84
3 changed files with 69 additions and 4 deletions
+39
View File
@@ -153,6 +153,23 @@ namespace MP.Data.Controllers
}
return dbResult;
}
/// <summary>
/// Intera tab dati macchina
/// </summary>
/// <returns></returns>
public async Task<List<DatiMacchineModel>> DatiMacchineGetAllAsync()
{
List<DatiMacchineModel> dbResult = new List<DatiMacchineModel>();
using (var dbCtx = new MoonProContext(_configuration))
{
dbResult = await dbCtx
.DbSetDatiMacchine
.AsNoTracking()
.OrderBy(x => x.IdxMacchina)
.ToListAsync();
}
return dbResult;
}
/// <summary>
/// Inserimento record in DDB
@@ -318,6 +335,28 @@ namespace MP.Data.Controllers
return fatto;
}
/// <summary>
/// Record ConfFlux dato macchina (oppure tutti se vuoto)
/// </summary>
/// <param name="idxMacc"></param>
/// <returns></returns>
public async Task<List<ConfFluxModel>> ConfFluxFiltAsync(string idxMacc)
{
List<ConfFluxModel> dbResult = new();
using (var dbCtx = new MoonPro_FluxContext(_configuration))
{
var query = dbCtx.DbSetConfFlux
.AsNoTracking()
.AsQueryable();
if (!string.IsNullOrEmpty(idxMacc))
query = query.Where(x => x.IdxMacchina == idxMacc);
dbResult = await query.ToListAsync();
}
return dbResult;
}
public bool KeepAliveUpsert(string IdxMacc, DateTime OraServer, DateTime OraMacc)
{
bool fatto = false;
+26
View File
@@ -0,0 +1,26 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace MP.Data.DbModels
{
[Table("ConfFlux")]
public partial class ConfFluxModel
{
#region Public Properties
[MaxLength(50)]
public string IdxMacchina { get; set; }
[MaxLength(50)]
public string CodFlux { get; set; }
public bool EnabDoss { get; set; }
#endregion Public Properties
}
}
+4 -4
View File
@@ -1,11 +1,9 @@
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using MP.Core.DTO;
using MP.Data.DbModels;
using MP.Data.DTO;
using NLog;
using System;
#nullable disable
// <Auto-Generated>
@@ -54,6 +52,8 @@ namespace MP.Data
public virtual DbSet<FluxLogModel> DbSetFluxLog { get; set; }
public virtual DbSet<DossierModel> DbSetDossiers { get; set; }
public virtual DbSet<ParetoFluxLogDTO> DbSetParetoFluxLog { get; set; }
public virtual DbSet<ConfFluxModel> DbSetConfFlux { get; set; }
#endregion Public Properties