public static ProgressRecordDto GetNullProgressRecord(int ClassEntityId, int StudentId, int TrackedItemId, int WeekId) { ProgressRecordDto nullProgressRecord = new ProgressRecordDto(); nullProgressRecord.ClassEntityId = ClassEntityId; nullProgressRecord.StudentId = StudentId; nullProgressRecord.WeekId = WeekId; nullProgressRecord.TrackedItemId = TrackedItemId; nullProgressRecord.Progress = 0; return(nullProgressRecord); }
private List <ProgressRecordDto> AddNullProgress(ClassEntityDto pickedClassEntity, WeekWithoutProgressDto pickedWeek, IEnumerable <ProgressRecordDto> reportsWithoutNullProgress) { List <ProgressRecordDto> reportsWithNullProgress = reportsWithoutNullProgress.ToList(); foreach (var student in pickedClassEntity.Students) { foreach (var trackedItem in pickedClassEntity.TrackedItems) { if (!reportsWithNullProgress.Any(r => r.StudentId == student.Id && r.TrackedItemId == trackedItem.Id)) { reportsWithNullProgress.Add(ProgressRecordDto.GetNullProgressRecord(pickedClassEntity.Id, student.Id, trackedItem.Id, pickedWeek.Id)); } } } return(reportsWithNullProgress); }