private List <int> GetClassGrades(int subjectClassId, int studentId = 0) { List <int> gradesList = new List <int>(); foreach (var grade in _gradesData.RetrieveObjects()) { if (studentId == 0) { if (grade.ClassId == subjectClassId) { gradesList.Add(grade.StudentGrade); } } else { if (grade.ClassId == subjectClassId && grade.StudentId == studentId) { gradesList.Add(grade.StudentGrade); } } } return(gradesList.Distinct().ToList()); }
public int GetClassSubjectById(string name) { var subjectId = _subjectsData.RetrieveObjects().Find(x => x.Name == name); return(subjectId.Id); }
public int GetStudentId(string name) { var studentId = _studentsData.RetrieveObjects().Find(x => x.Name == name); return(studentId.Id); }