public async Task <ActionResult> GetAllReportsToParentInGroup(int studentid, int groupid) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (studentid == 0 || groupid == 0) { return(NotFound()); } var studentgroups = await _studentsGroups.GetStudentGroups(studentid); if (studentgroups == null) { return(NotFound()); } foreach (var item in studentgroups) { if (item.EductionalCenterGroupId == groupid) { var getAllReports = await _reportRepository.GetAllReportsToParentInGroup(studentid, groupid); return(Ok(getAllReports)); } } return(NotFound()); }
public async Task <IActionResult> GetStudentGroups(int studentId) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } else { var studentGroups = await _studentsGroupsRepository.GetStudentGroups(studentId); if (studentGroups != null) { return(Ok(studentGroups)); } else { return(NoContent()); } } }