/// <summary> /// Get the testsheets for the given shift /// </summary> /// <returns>the testsheets for the given shift</returns> public ICollection <TestSheet> GetTestSheetForShifts(List <ShiftSchedule> shifts) { var sheets = new List <TestSheet>(); TestSheets.GetAll() .ToList() .ForEach(sheet => { if ((DateTime.Now.AddDays(-shifts.Count) <= sheet.CreatedDateTime) && ShiftHelper.DateExistsInShifts(sheet.CreatedDateTime, shifts)) { sheets.Add(sheet); } }); return(sheets); }
/// <summary> /// Get the testsheets for the last shift /// </summary> /// <returns>the testsheets for the last shift</returns> public ICollection <TestSheet> GetTestSheetForShiftPerMachineNr(ShiftSchedule shiftSchedule, String machineNr) { var sheets = new List <TestSheet>(); TestSheets.GetAll() .Where(sheet => sheet.MachineNr.Equals(machineNr)) .ToList() .ForEach(sheet => { if (ShiftHelper.DateExistsInShift(sheet.CreatedDateTime, shiftSchedule)) { sheets.Add(sheet); } }); return(sheets); }