/// <summary> /// производит поиск задолжников /// и возвращает их фамилии группы и /// количество задолженностей /// </summary> /// <returns></returns> public List <StudentInfo> GetDebtorsList() { var allStudents = new GetStudents(); var studentsList = allStudents.GetAll(); var dabtors = new List <StudentInfo>(); foreach (Student student in studentsList) { int na = 0; for (int exem = 0; exem < 5; exem++) { if (student.Exems[exem].Equals('2')) { na++; } } for (int score = 0; score < 5; score++) { if (student.Scores[score].Equals('Н') || student.Scores[score].Equals('н')) { na++; } } if (na >= 1) { dabtors.Add(new StudentInfo(student.ID, student.Group, student.Surname, na)); } } return(dabtors); }
public void UpdateData() { StudentsDataGrid.Rows.Clear(); GetStudents students = new GetStudents(); foreach (Student student in students.GetAll()) { StudentsDataGrid.Rows.Add(student.ID, student.Group, student.Surname, student.Exems, student.Scores); } }