public IActionResult Dashboard(int classId)
        {
            ClassStudentVM dashboardNeeds = new ClassStudentVM();
            var            instructorList = _classDataAccess.GetInstructorsConnectedToClass(classId, GetCurrentStudioId());
            var            studentsIdList = _classDataAccess.GetStudentsConnectedToClass(classId, GetCurrentStudioId());
            var            _class         = _classDataAccess.SearchClass(classId, GetCurrentStudioId());

            foreach (var idsIns in instructorList)
            {
                var instructor = _instructorDataAccess.GetInstructorById(idsIns);
                dashboardNeeds.InstructorsList.Add(instructor);
            }

            foreach (var idsStu in studentsIdList)
            {
                var student = _studentDataAccess.GetStudentById(idsStu);
                dashboardNeeds.StudentsList.Add(student);
            }

            dashboardNeeds.PricePerHour = _class.PricePerHour;
            dashboardNeeds.Level        = _class.Level;
            dashboardNeeds.ClassId      = classId;
            var shedule = _classDataAccess.GetClassShedule(classId);

            foreach (var s in shedule)
            {
                dashboardNeeds.SheduleDays.Add($" {s.Day} - {s.Hour} ");
            }

            return(Json(dashboardNeeds));
        }
        public IActionResult SearchStudent(string genre, string level, string type)
        {
            var students = new List <ClassStudentVM>();
            var classes  = new List <Class>();

            if (genre != null && level != null && type != null)
            {
                classes = _classDataAccess.SearchClass(genre, level, type, GetCurrentStudioId());
            }
            else
            {
                classes = _classDataAccess.GetAllClasses(GetCurrentStudioId());
            }

            foreach (var _class in classes)
            {
                foreach (var id in _classDataAccess.GetStudentsConnectedToClass(_class.Id, GetCurrentStudioId()))
                {
                    var            s       = _studentDataAccess.GetStudentById(id);
                    ClassStudentVM student = new ClassStudentVM();

                    student.Firstname = s.Firstname;
                    student.Lastname  = s.Lastname;
                    student.Email     = s.Email;
                    student.Genre     = _class.Genre;
                    student.Level     = _class.Level;
                    students.Add(student);
                }
            }
            return(Json(students));
        }