inizio filtro macchina per Reparto
This commit is contained in:
@@ -696,16 +696,31 @@ namespace MP.Data.Controllers
|
||||
/// Elenco da tabella Macchine
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<Macchine> MacchineGetAll()
|
||||
public List<Gruppi2MaccModel> MacchineGetAll(string codGruppo = "*")
|
||||
{
|
||||
List<Macchine> dbResult = new List<Macchine>();
|
||||
List<Gruppi2MaccModel> dbResult = new List<Gruppi2MaccModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetMacchine
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.IdxMacchina)
|
||||
.ToList();
|
||||
if (codGruppo == "*")
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetGrp2Macc
|
||||
.AsNoTracking()
|
||||
.Include(m => m.MachineNav)
|
||||
.OrderBy(x => x.IdxMacchina)
|
||||
.ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
dbResult = dbCtx
|
||||
.DbSetGrp2Macc
|
||||
.Where(c => c.CodGruppo == codGruppo)
|
||||
.AsNoTracking()
|
||||
.Include(m => m.MachineNav)
|
||||
.OrderBy(x => x.IdxMacchina)
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user