Update modello dati x gestione conf ricette

This commit is contained in:
Samuele Locatelli
2023-02-07 17:17:43 +01:00
parent 586340a0f7
commit 68c7004828
2 changed files with 30 additions and 21 deletions
+28 -21
View File
@@ -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;
}
+2
View File
@@ -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; } = "";