public IActionResult StudentsSubjects(string id) { var model = new StudentStudents(); model.Students = _courseStudentData.FindAllByCourse(id); model.CourseID = id; model.Mod = new List <StudentStudentsMod>(); model.Mod.Add(new StudentStudentsMod("Passed", "0")); model.Mod.Add(new StudentStudentsMod("All students", "1")); model.Mod.Add(new StudentStudentsMod("Failed", "2")); model.Course = _courseData.Find(id); return(View(model)); }
public List <Student> StudentsForCB(string id) { IEnumerable <CourseStudent> courseStudents = new List <CourseStudent>(); courseStudents = _courseStudentData.FindAllByCourse(id); List <Student> students = new List <Student>(); foreach (CourseStudent courseStudent in courseStudents) { students.Add(courseStudent.Student); } return(students); }
public IActionResult ReturnStudentsForCB(string id) { IEnumerable <CourseStudent> courseStudents = new List <CourseStudent>(); courseStudents = _courseStudentData.FindAllByCourse(id).Where(s => s.FinalGrade == null); List <Student> students = new List <Student>(); foreach (CourseStudent courseStudent in courseStudents) { students.Add(courseStudent.Student); } SelectList studentsSel = new SelectList(students.Select(s => new { Text = s.FirstName + " " + s.LastName + "-" + s.TranscriptNumber, ID = s.ID }), "ID", "Text", 0); return(Json(studentsSel)); }