public string GetStatusReport() { // log faults string faultString = ""; if (lightManager.GetStatus().Contains("FAULT")) { faultString = faultString + "Lights,"; } if (doorManager.GetStatus().Contains("FAULT")) { faultString = faultString + "Doors,"; } if (fireAlarmManager.GetStatus().Contains("FAULT")) { faultString = faultString + "FireAlarm,"; } if (lightManager.GetStatus().Contains("FAULT") || doorManager.GetStatus().Contains("FAULT") || fireAlarmManager.GetStatus().Contains("FAULT")) { webservice.LogEngineerRequired(faultString); } // methods all three manager classes return(lightManager.GetStatus() + doorManager.GetStatus() + fireAlarmManager.GetStatus()); }
public string GetStatusReport() { char f = 'F'; string errors = ""; for (int i = 0; i < lightManager.GetStatus().Length; i++) { if (lightManager.GetStatus()[i] == f) { errors = errors + "Lights,"; break; } } for (int i = 1; i < fireAlarm.GetStatus().Length; i++) { if (fireAlarm.GetStatus()[i] == f) { errors = errors + "Fire Alarm,"; break; } } for (int i = 0; i < doorManager.GetStatus().Length; i++) { if (doorManager.GetStatus()[i] == f) { errors = errors + "Doors,"; break; } } if (errors != "") { webService.LogEngineerRequired(errors); } return(lightManager.GetStatus() + doorManager.GetStatus() + fireAlarm.GetStatus()); }
//(L3R2) public string GetStatusReport() { checkForFaultyReports(); //(L4R3) return(_lightManager.GetStatus() + _doorManager.GetStatus() + _fireAlarmManager.GetStatus()); //(L3R3) }