ویومدل جست و جوی سابقه های پژوهشی
Inheritance: Decision.ViewModel.Common.BaseSearchRequest
        public virtual async Task<ActionResult> ListAjax(ResearchExperienceSearchRequest request)
        {
            var viewModel = await _researchExperienceService.GetPagedListAsync(request);
            if (viewModel.ResearchExperiences == null || !viewModel.ResearchExperiences.Any())
                return Content("no-more-info");

            return PartialView(MVC.ResearchExperience.Views._ListAjax, viewModel);
        }
        public virtual async Task<ActionResult> ListAjax(ResearchExperienceSearchRequest request)
        {
            if (!_referentialTeacherService.CanManageTeacher(request.TeacherId)) return HttpNotFound();
            var viewModel = await _researchExperienceService.GetPagedListAsync(request);
            if (viewModel.ResearchExperiences == null || !viewModel.ResearchExperiences.Any())
                return Content("no-more-info");

            return PartialView(MVC.ResearchExperience.Views._ListAjax, viewModel);
        }
Ejemplo n.º 3
0
        public async Task<ResearchExperienceListViewModel> GetPagedListAsync(ResearchExperienceSearchRequest request)
        {
            var researches =
                _researchExperiences.Include(a => a.CreatedBy)
                    .Include(a => a.ModifiedBy)
                    .Where(a => a.ApplicantId == request.ApplicantId)
                    .AsNoTracking().OrderByDescending(a=>a.CreatedOn)
                    .AsQueryable();

            var selectedCities = researches.ProjectTo<ResearchExperienceViewModel>(_mappingEngine);

            var resultsToSkip = (request.PageIndex - 1)*10;
            var query = await selectedCities
                .Skip(()=>resultsToSkip)
                .Take(10).ToListAsync();

            return new ResearchExperienceListViewModel { SearchRequest = request, ResearchExperiences = query };
        }
Ejemplo n.º 4
0
        public async Task<ResearchExperienceListViewModel> GetPagedListAsync(ResearchExperienceSearchRequest request)
        {
            var cities =
                _researchExperiences.Include(a => a.Creator)
                    .Include(a => a.LasModifier)
                    .Where(a => a.TeacherId == request.TeacherId)
                    .AsNoTracking()
                    .OrderByDescending(a => a.Title)
                    .AsQueryable();

            var selectedCities = cities.ProjectTo<ResearchExperienceViewModel>(_mappingEngine);


            var query = await selectedCities
                .Skip((request.PageIndex - 1) * 10)
                .Take(10).ToListAsync();

            return new ResearchExperienceListViewModel { SearchRequest = request, ResearchExperiences = query };
        }