Aggiunta metodi recupero remnants
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user