Example #1
0
        // GET: Student ---------------------------------------------------READ
        public async Task <ActionResult> IndexAsync(string search = null)
        {
            var students = await studentRepo.GetAllStudentsAsync(search);

            if (!String.IsNullOrEmpty(search))
            {
                students = await studentRepo.GetAllStudentsAsync(search);
            }
            return(View(students));
        }
Example #2
0
        public async Task <IActionResult> Index(string educationSearch = null)
        {
            ViewBag.ControllerName = this.ControllerContext.RouteData.Values["controller"].ToString();
            ViewBag.search         = educationSearch;

            List <Student> result = new List <Student>();

            if (string.IsNullOrEmpty(educationSearch))
            {
                result = (await studentRepo.GetAllStudentsAsync()).ToList();
            }
            else
            {
                var educations = await educationRepo.GetAllEducationsAsync(educationSearch);

                // Alle mogelijkheden Testen --> Zeker null dus!!!
                if (educations == null)
                {
                    return(View("_NotFound"));
                }

                foreach (Education education in educations)
                {
                    var resultStudents = await studentRepo.GetStudentsByEducationAsync(education.Id);

                    foreach (var student in resultStudents)
                    {
                        result.Add(student);
                    }
                }
            }
            return(View("Index", result));
        }
Example #3
0
        // GET: Student
        public async Task <IActionResult> Index()
        {
            var students = await studentRepo.GetAllStudentsAsync();

            return(View(students));
        }