Update modello dati x gestione conf ricette
This commit is contained in:
@@ -699,31 +699,38 @@ namespace MP.Data.Controllers
|
||||
public List<Macchine> MacchineGetFilt(string codGruppo)
|
||||
{
|
||||
List<Macchine> dbResult = new List<Macchine>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
try
|
||||
{
|
||||
if (codGruppo == "*")
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetMacchine
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.IdxMacchina)
|
||||
.ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetGrp2Macc
|
||||
.Where(g => g.CodGruppo == codGruppo)
|
||||
.Join(dbCtx.DbSetMacchine,
|
||||
g => g.IdxMacchina,
|
||||
m => m.IdxMacchina,
|
||||
(g, m) => m
|
||||
)
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.IdxMacchina)
|
||||
.ToList();
|
||||
if (codGruppo == "*")
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetMacchine
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.IdxMacchina)
|
||||
.ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetGrp2Macc
|
||||
.Where(g => g.CodGruppo == codGruppo)
|
||||
.Join(dbCtx.DbSetMacchine,
|
||||
g => g.IdxMacchina,
|
||||
m => m.IdxMacchina,
|
||||
(g, m) => m
|
||||
)
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.IdxMacchina)
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione in MacchineGetFilt{Environment.NewLine}{exc}");
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@ namespace MP.Data.DatabaseModels
|
||||
public string CodMacchina { get; set; } = "";
|
||||
public string Nome { get; set; } = "";
|
||||
public string Descrizione { get; set; } = "";
|
||||
public string RecipePath { get; set; } = "";
|
||||
|
||||
//public string Note { get; set; } = "";
|
||||
//public string url { get; set; } = "";
|
||||
//public string locazione { get; set; } = "";
|
||||
|
||||
Reference in New Issue
Block a user