Ejemplo n.º 1
0
        public async Task <ActionResult> Index(SortingEnum sortState = SortingEnum.LastNameAsc)
        {
            StudentViewModel st = SortStudents.Sort(await _studentService.GetAllStudentsByArchive(), sortState);

            st.branches = await _branchService.GetAllBranch();

            return(View(st));
        }
Ejemplo n.º 2
0
        public async Task <StudentViewModel> GetStudingStudentsByBranchIdAsync(int BranchId, SortingEnum sortState)
        {
            var groups = await _unitOfWork.Groups.GetIncludeStudentsByBranchIdAsync(BranchId);

            var students = new List <Student>();

            foreach (var g in groups)
            {
                students.AddRange(g.Students);
            }
            students = students.Where(x => x.Status == StudentStatusEnum.studying).ToList();
            return(SortStudents.Sort(students, sortState));
        }
Ejemplo n.º 3
0
        public async Task <StudentViewModel> SearchAsync(
            string value,
            SortingEnum sortState = SortingEnum.LastNameAsc)
        {
            var students = await _unitOfWork.Student.GetAllAsync();

            if (!string.IsNullOrWhiteSpace(value))
            {
                students = students.Where(x => (x.Name?.ToUpper() ?? string.Empty).Contains(value.ToUpper()) ||
                                          (x.PhoneNumber?.ToUpper() ?? string.Empty).Contains(value.ToUpper()) ||
                                          (x.LastName?.ToUpper() ?? string.Empty).Contains(value.ToUpper()) ||
                                          (x.ParentLastName?.ToUpper() ?? string.Empty).Contains(value.ToUpper())).ToList();

                return(SortStudents.Sort(students, sortState));
            }

            return(new StudentViewModel()
            {
                Student = new List <Student>()
            });
        }
Ejemplo n.º 4
0
        internal async Task <StudentViewModel> SelectTrialStudentsAsync(SortingEnum sortState = SortingEnum.LastNameAsc)
        {
            var students = await _unitOfWork.Student.SelectTrialStudentsAsync();

            return(SortStudents.Sort(students, sortState));
        }