public ListTeachersView(ListTeachersViewModel viewModel) { this.InitializeComponent(); ViewModel = viewModel; DataContext = ViewModel; Loaded += ListTeachersView_Loaded; }
public async Task InitialLoad() { var getSchools = await _httpClientService.GetListTAsync <School>("school/getall"); var getSchoolsForCoordinator = _userEditDto.ConnectedUser.Role == "Admin" ? getSchools : getSchools.Where(s => s.CoordinatorId == _userEditDto.ConnectedUser.UserId).ToList(); _listSchoolsViewModel = new ListSchoolsViewModel(_httpClientService, _navigationService, _connectedUser, getSchoolsForCoordinator); _listTeachersViewModel = new ListTeachersViewModel(_httpClientService, _navigationService, _userEditDto.ConnectedUser, getSchoolsForCoordinator); CanNavigate = true; }
public IActionResult AllTeachers(int page = 1) { var viewModel = new ListTeachersViewModel() { Teachers = this.teachersService.GetAll <TeacherInfoViewModel>(ItemsPerPage, (page - 1) * ItemsPerPage), }; var count = this.teachersService.GetCount(); viewModel.PagesCount = (int)Math.Ceiling((double)count / ItemsPerPage); viewModel.CurrentPage = page; return(this.View(viewModel)); }