SPEC:
- aggiunta pagina operatori - completato fix
This commit is contained in:
@@ -106,6 +106,7 @@ namespace MP.Data.Repository.Production
|
||||
Task<List<AnagGiacenzeModel>> ListGiacenzeAsync(int IdxOdl);
|
||||
|
||||
Task<List<AnagOperatoriModel>> OperatoriGetFiltAsync(string codGruppo);
|
||||
Task<bool> OperatoriUpsertAsync(AnagOperatoriModel updRec);
|
||||
|
||||
Task<List<string>> ParametriGetFiltAsync(string IdxMacchina);
|
||||
|
||||
|
||||
@@ -19,10 +19,15 @@ namespace MP.Data.Repository.Production
|
||||
#endregion
|
||||
|
||||
#region Public Constructors
|
||||
protected readonly IDbContextFactory<MoonPro_FluxContext> _ctxFactoryFL;
|
||||
|
||||
public ProductionRepository(IDbContextFactory<MoonProContext> ctxFactory, IConfiguration configuration)
|
||||
public ProductionRepository(
|
||||
IConfiguration configuration,
|
||||
IDbContextFactory<MoonProContext> ctxFactory,
|
||||
IDbContextFactory<MoonPro_FluxContext> ctxFactoryFL)
|
||||
{
|
||||
_ctxFactory = ctxFactory;
|
||||
_ctxFactoryFL = ctxFactoryFL;
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
@@ -686,7 +691,7 @@ namespace MP.Data.Repository.Production
|
||||
/// <inheritdoc />
|
||||
public async Task<List<string>> MacchineWithFluxAsync(DateTime dtStart, DateTime dtEnd)
|
||||
{
|
||||
await using var dbCtx = new MoonPro_FluxContext(_configuration);
|
||||
await using var dbCtx = await _ctxFactoryFL.CreateDbContextAsync();
|
||||
return await dbCtx
|
||||
.DbSetFluxLog
|
||||
.AsNoTracking()
|
||||
@@ -841,10 +846,23 @@ namespace MP.Data.Repository.Production
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public async Task<bool> OperatoriUpsertAsync(AnagOperatoriModel updRec)
|
||||
{
|
||||
await using var dbCtx = await GetMoonProContextAsync();
|
||||
var dbRec = await dbCtx
|
||||
.DbOperatori
|
||||
.FindAsync(updRec.MatrOpr);
|
||||
if (dbRec != null)
|
||||
{
|
||||
dbCtx.Entry(dbRec).CurrentValues.SetValues(updRec);
|
||||
}
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<List<string>> ParametriGetFiltAsync(string IdxMacchina)
|
||||
{
|
||||
await using var dbCtx = new MoonPro_FluxContext(_configuration);
|
||||
await using var dbCtx = await _ctxFactoryFL.CreateDbContextAsync();
|
||||
return await dbCtx
|
||||
.DbSetFluxLog
|
||||
.AsNoTracking()
|
||||
|
||||
Reference in New Issue
Block a user