Fix selezione ODL quando disponibile....

This commit is contained in:
Samuele Locatelli
2023-11-06 19:57:46 +01:00
parent 705eeb56df
commit 6432bde3fa
8 changed files with 196 additions and 28 deletions
+30
View File
@@ -825,6 +825,36 @@ namespace MP.Data.Controllers
}
return fatto;
}
/// <summary>
/// Recupero PODL da chiave
/// </summary>
/// <param name="idxPODL"></param>
/// <returns></returns>
public PODLExpModel PODLExp_getByKey(int idxPODL)
{
PODLExpModel dbResult = new PODLExpModel();
using (var dbCtx = new MoonProContext(_configuration))
{
try
{
var IdxPromessa = new SqlParameter("@IdxPromessa", idxPODL);
var rawResult = dbCtx
.DbSetPODLExp
.FromSqlRaw("EXEC stp_PODL_getByIdx @IdxPromessa", IdxPromessa)
.AsNoTracking()
.ToList();
if (rawResult != null && rawResult.Count > 0)
{
dbResult = rawResult.FirstOrDefault();
}
}
catch (Exception exc)
{
Log.Error($"Eccezione durante PODL_getByKey{Environment.NewLine}{exc}");
}
}
return dbResult;
}
/// <summary>
/// Stato prod macchina