Example #1
0
        public async Task <IActionResult> Index(ApplicationForAdmissionsFilterAndSortModel filterAndSortModel)
        {
            var applicationForAdmissions = _applicationForAdmissionRepository.GetApplicationForAdmissions(filterAndSortModel);

            ViewBag.FilterAndSortModel = filterAndSortModel;

            ViewBag.EduForms           = _selectListRepository.GetSelectListEduForms(filterAndSortModel.EduFormId);
            ViewBag.EducationDocuments = _selectListRepository.GetSelectListEducationDocumentsForAbiturients(filterAndSortModel.EducationDocumentFileDataTypeId);
            ViewBag.EduProfiles        = _selectListRepository.GetSelectListEduProfileFullNames(filterAndSortModel.EduProfileId);
            ViewBag.QuotaTypes         = _selectListRepository.GetSelectListQuotaTypes(filterAndSortModel.QuotaTypeId);
            ViewBag.Priorities         = _selectListRepository.GetSelectListPriorities(filterAndSortModel.PriorityId);
            ViewBag.RowStatuses        = _selectListRepository.GetSelectListRowStatuses(filterAndSortModel.RowStatusId);

            if (filterAndSortModel.IsRequestDataImmediately)
            {
                return(View(await applicationForAdmissions.ToListAsync()));
            }
            else
            {
                return(View(new List <ApplicationForAdmission>()));
            }
        }