Fix configuration

Fix Functionality and PLC id matching
This commit is contained in:
Lucio Maranta
2018-03-28 17:31:32 +02:00
parent 5187bd9d15
commit 63d2ce8f4a
17 changed files with 74 additions and 58 deletions
@@ -87,8 +87,13 @@ namespace Step.Database.Controllers
// If id is not mapped or function is false by database config return
if (id == -1 || !functionAccessIsEnabled)
return functionAccessIsEnabled;
// Return PLC data
return functionalityList[id].IsActive;
// Find and Return PLC data
FunctionalityModel plcFunc = functionalityList.Where(x => x.Id == id).SingleOrDefault();
if (plcFunc == null)
return false; // If not found
return plcFunc.IsActive;
}
}
}