// GET: Lessons/Create public IActionResult Create() { ViewData["StudentId"] = new SelectList(_studentService.GetList().Data, "Id", "LastName"); ViewData["TrainerId"] = new SelectList(_trainerService.GetList().Data, "Id", "LastName"); ViewData["Hours"] = new SelectList(_enumService.GetHoursList(), "Id", "Name"); ViewData["Minutes"] = new SelectList(_enumService.GetMinutesList(), "Id", "Name"); return(View()); }
// GET: Trainers public IActionResult Index(string searchString, int?page) { ResultHandler <PaginatedList <TrainerDto> > trainers; Pageable pageable = new Pageable() { Page = page != null ? (int)page : 1, PageSize = 10 }; if (!String.IsNullOrEmpty(searchString)) { trainers = _trainerService.GetList(searchString, pageable); } else { trainers = _trainerService.GetList(pageable); } ResultViewModel <PaginatedList <TrainerDto> > resultViewModel = AutoMapper.Mapper.Map <ResultHandler <PaginatedList <TrainerDto> >, ResultViewModel <PaginatedList <TrainerDto> > >(trainers); return(View(resultViewModel)); }