private static bool NeedsSheet(AutomationCondition autoCond, long patNum) { List <Sheet> sheetList = Sheets.GetForPatientForToday(patNum); switch (autoCond.Comparison) //Find out what operand to use. { case AutoCondComparison.Equals: //Loop through every sheet to find one that matches the condition. for (int i = 0; i < sheetList.Count; i++) { if (sheetList[i].Description == autoCond.CompareString) //Operand based on AutoCondComparison. { return(true); } } break; case AutoCondComparison.Contains: for (int i = 0; i < sheetList.Count; i++) { if (sheetList[i].Description.ToLower().Contains(autoCond.CompareString.ToLower())) { return(true); } } break; } return(false); }