Check right&left before loading a tool
This commit is contained in:
Lucio Maranta
2018-07-26 13:25:12 +02:00
parent 746ff140c5
commit e8c9c9104d
7 changed files with 150 additions and 55 deletions
@@ -77,6 +77,15 @@ namespace Step.Database.Controllers
return tools;
}
public List<DbNcToolModel> FindToolsByShankIdWithDependencies(int shankId)
{
List<DbNcToolModel> tools = FindToolsWithDependencies()
.Where(x => x.ShankId == shankId)
.ToList();
return tools;
}
public List<DbNcToolModel> FindTools()
{
List<DbNcToolModel> tools = dbCtx
@@ -105,6 +114,16 @@ namespace Step.Database.Controllers
return shanks;
}
public DbNcShankModel FindShanksByPositions(int magazineId, int positionId)
{
DbNcShankModel shank = FindShanks()
.Where(x => x.MagazineId == magazineId && x.PositionId == positionId)
.FirstOrDefault();
return shank;
}
public List<DTONcShankModel> GetShanks()
{
// Get shank from database
@@ -200,6 +219,15 @@ namespace Step.Database.Controllers
return dtoShanks;
}
public List<DbNcToolModel> GetMountedTools()
{
List<DbNcToolModel> tools = FindToolsWithDependencies()
.Where(x => x.Shank.MagazineId != null)
.ToList();
return tools;
}
public List<DTONcShankModel> GetAvailableShanks()
{
List<DTONcShankModel> dtoShanks = GetShanks()