Aggiunta metodi recupero remnants

This commit is contained in:
Samuele Locatelli
2021-11-18 18:48:18 +01:00
parent 30034aea7c
commit e939a4b5bf
2 changed files with 34 additions and 1 deletions
@@ -37,6 +37,33 @@ namespace NKC.Data.Controllers
return dbResult;
}
public List<RemnantsModel> RemnantsGetAll()
{
List<RemnantsModel> dbResult = new List<RemnantsModel>();
using (NKCContext localDbCtx = new NKCContext(_configuration))
{
dbResult = localDbCtx
.DbSetRemnants
.ToList();
}
return dbResult;
}
public List<RemnantsModel> RemnantsGetFilt(int matId, int minQty)
{
List<RemnantsModel> dbResult = new List<RemnantsModel>();
using (NKCContext localDbCtx = new NKCContext(_configuration))
{
dbResult = localDbCtx
.DbSetRemnants
.Where(x => (x.MatID == matId || matId == 0) && (x.QtyAvail >= minQty || minQty == 0))
.OrderBy(o => o.Area)
.ToList();
}
return dbResult;
}
public bool DbForceMigrate()
{
bool answ = false;
+7 -1
View File
@@ -56,7 +56,13 @@ namespace NKC.Data.DbModels
/// Note (optional)
/// </summary>
public string Note { get; set; } = "";
[NotMapped]
public decimal Area
{
get => LMm * WMm;
}
/// <summary>
/// Navigation property to Material
/// </summary>