Example #1
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;
        }
Example #2
0
        private void PopulateDropDowns(MemberViewModel model)
        {
            var selectListItem = IQueryableExtensions.Default_SelectListItem();
            var countries      = _context.Country.Include(a => a.Provinces).ThenInclude(a => a.Cities);

            model.Genders       = _context.Gender.ToSelectListItem(a => a.Name, x => x.Id.ToString());
            model.Titles        = _context.Title.ToSelectListItem(a => a.Name, x => x.Id.ToString());
            model.Nationalities = _context.Country.ToSelectListItem(a => a.Name, x => x.Id.ToString());
            model.IDTypes       = _context.IDType.ToSelectListItem(a => a.Name, x => x.Id.ToString());;
            model.Address       = new AddressViewModel
            {
                Countries = countries.Where(a => a.Provinces.Any()).ToSelectListItem(a => a.Name, x => x.Id.ToString()),
                Provinces = selectListItem,
                Cities    = selectListItem,
                Towns     = selectListItem,
                Suburbs   = selectListItem
            };

            if (model.Id != 0)
            {
                model.Members = _context.Member.Where(a => a.Id != model.Id)
                                .Include(a => a.Person.Gender)
                                .ToSelectListItem(a => a.Person.FullName, x => x.Id.ToString(), true);
            }
        }
        private void PopulateDropDowns(RaceResultImportViewModel model)
        {
            var selectListItem = IQueryableExtensions.Default_SelectListItem();

            model.People = _context.Person
                           .Where(a => a.Members.Any())
                           .ToSelectListItem(a => a.FullName, x => x.Id.ToString());
        }
Example #4
0
 private void PopulateDropDowns(OrganisationViewModel model)
 {
     model.Provinces = IQueryableExtensions.Default_SelectListItem();
     model.Countries = _context.Country
                       .Include(a => a.Provinces)
                       .Where(a => a.Provinces.Any())
                       .ToSelectListItem(a => a.Name, x => x.Id.ToString());
     model.OrganisationTypes = _context.OrganisationType.ToSelectListItem(a => a.Name, x => x.Id.ToString());
 }
Example #5
0
 private void PopulateDropDowns(WinnerViewModel model)
 {
     model.Frequencies = _context.Frequency
                         .ToSelectListItem(a => a.Name, x => x.Id.ToString());
     model.FinYears       = _finYearBL.GetLatestFinYearSelectItem();
     model.CalendarMonths = _context.CalendarMonth.OrderBy(a => a.Ordinal).ToSelectListItem(a => a.Name, x => x.Id.ToString(), excludeSort: true);
     model.Awards         = IQueryableExtensions.Default_SelectListItem();
     model.Members        = IQueryableExtensions.Default_SelectListItem();
 }
Example #6
0
        private void PopulateDropDowns(MemberStagingViewModel model)
        {
            var selectListItem = IQueryableExtensions.Default_SelectListItem();
            var countries      = _context.Country.Include(a => a.Provinces).ThenInclude(a => a.Cities);

            model.Genders       = _context.Gender.ToSelectListItem(a => a.Name, x => x.Id.ToString());
            model.Titles        = _context.Title.ToSelectListItem(a => a.Name, x => x.Id.ToString());
            model.Nationalities = countries.ToSelectListItem(a => a.Name, x => x.Id.ToString());
            model.IDTypes       = _context.IDType.ToSelectListItem(a => a.Name, x => x.Id.ToString(), true, excludeSort: true).OrderBy(a => a.Value);
            model.Address       = new AddressViewModel
            {
                Countries = countries.Where(a => a.Provinces.Any()).ToSelectListItem(a => a.Name, x => x.Id.ToString()),
                Provinces = selectListItem,
                Cities    = selectListItem,
                Towns     = selectListItem,
                Suburbs   = selectListItem
            };
        }
Example #7
0
        private void PopulateDropDowns(TrainingPlanViewModel model)
        {
            var selectListItem = IQueryableExtensions.Default_SelectListItem();

            model.FinYears = _finYearBL.GetLatestFinYearSelectItem();


            model.Events = _context.Event
                           .Include(a => a.EventType)
                           .Where(a => a.EventType.Discriminator == EventTypeDiscriminator.Training)
                           .ToSelectListItem(a => a.Name, x => x.Id.ToString(), true);

            model.Members = _context.Member
                            .Include(a => a.Person)
                            .ToSelectListItem(a => a.Person.FullName, x => x.Id.ToString(), true);

            model.Distances = _context.Distance
                              .ToSelectListItem(a => a.Name, x => x.Id.ToString(), true);
            model.RaceDefinitions = _context.RaceDefinition
                                    .ToSelectListItem(a => a.Name, x => x.Id.ToString(), true);;
        }
Example #8
0
        private void PopulateDropDowns(TimeTrialViewModel model)
        {
            var selectListItem = IQueryableExtensions.Default_SelectListItem();

            model.FinYears = _finYearBL.GetLatestFinYearSelectItem();


            model.CalendarMonths = _context.CalendarMonth
                                   .OrderBy(a => a.Ordinal)
                                   .ToSelectListItem(a => a.Name, x => x.Id.ToString(), excludeSort: true);


            model.Distances = _context.Distance
                              .ToSelectListItem(a => a.Name, x => x.Id.ToString(), true);

            model.RaceTypes = _context.RaceType
                              .ToSelectListItem(a => a.Name, x => x.Id.ToString(), true);

            model.TimeTrialDistances           = new List <TimeTrialDistanceViewModel>();
            model.TimeTrialDistancesSelectList = selectListItem;
            model.Genders = selectListItem;
        }
Example #9
0
 private void PopulateDropDowns(ItemViewModel model)
 {
     model.ProductCategories = _context.ProductCategory.ToSelectListItem(a => a.Name, x => x.Id.ToString());
     model.Products          = IQueryableExtensions.Default_SelectListItem();
     model.ProductSizes      = IQueryableExtensions.Default_SelectListItem();
 }