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)); }
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)); }
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>() }); }
internal async Task <StudentViewModel> SelectTrialStudentsAsync(SortingEnum sortState = SortingEnum.LastNameAsc) { var students = await _unitOfWork.Student.SelectTrialStudentsAsync(); return(SortStudents.Sort(students, sortState)); }