private void PopulateDropDowns(SystemDocumentViewModel model)
 {
     model.FinYears      = _finYearBL.GetSelectListItem(includeUpcomingYear: true);
     model.DocumentTypes = _context.DocumentType
                           .Where(a => a.Discriminator == DocumentTypeDiscriminator.ASALicenseForm || a.Discriminator == DocumentTypeDiscriminator.Constitution)
                           .ToSelectListItem(a => a.Name, x => x.Id.ToString());
 }
Beispiel #2
0
        private void PopulateDropDowns(RaceViewModel model)
        {
            var selectListItem = IQueryableExtensions.Default_SelectListItem();

            model.FinYears = _finYearBL.GetSelectListItem(true, true);


            model.OrganisationTypes = _context.OrganisationType
                                      .Include(a => a.Organisations)
                                      .Where(a => a.Organisations.Any())
                                      .ToSelectListItem(a => a.Name, x => x.Id.ToString());

            model.Countries = _context.Country
                              .Include(a => a.Provinces)
                              .Where(a => a.Provinces.Any())
                              .ToSelectListItem(a => a.Name, x => x.Id.ToString());

            model.Distances = _context.Distance
                              .ToSelectListItem(a => a.Name, x => x.Id.ToString(), true);
            model.Organisations           = selectListItem;
            model.RaceDefinitions         = selectListItem;
            model.Provinces               = selectListItem;
            model.RaceDistances           = new List <RaceDistanceViewModel>();
            model.RaceDistancesSelectList = selectListItem;
            model.Genders = selectListItem;
        }