private static bool MatchEngParamFailed(OldCmsEntities old, Alarm oldAlarm, out EngParameter matchedEngParam) { matchedEngParam = (from x in old.EngParameters where x.ElementId == oldAlarm.ElementId select x).FirstOrDefault(); if (matchedEngParam == null) { //Logger.Out(string.Format("MatchEngParamFailed on Alarm ID {0}:- could not match EngParameter using ElementId '{1}'. Step 1 in trying to determine 'Priority' property.", oldAlarm.Id, oldAlarm.ElementId)); return true; } return false; }
private static bool MatchAlarmTableRecordFailed(OldCmsEntities old, Alarm oldAlarm, EngParameter matchedEngParam, out AlarmTable matchedAlarmTable) { matchedAlarmTable = (from x in old.AlarmTables.Include("AlarmPriority") where x.AlarmTypeId == oldAlarm.AlarmTypeId && x.AlarmLevel == matchedEngParam.AlarmLevel select x).FirstOrDefault(); if (matchedAlarmTable == null) { //Logger.Out(string.Format("MatchAlarmTableRecordFailed on Alarm ID {0}:- could not match AlarmTable using AlarmTypeId '{1}' and Alarm Level {2}. Step 2 in trying to detemine 'Priority' property.", oldAlarm.Id, oldAlarm.ElementId, matchedEngParam.AlarmLevel)); return true; } return false; }