Example #1
0
 private void InitListViewModel(RaceItemsViewModel viewModel, RaceItems list)
 {
     foreach (var item in viewModel.Items)
     {
         InitBaseItemViewModel(item);
         item.RaceTypeName   = GetRaceTypeName(item.RaceTypeId);
         item.SeasonTypeName = GetSeasonTypeName(item.SeasonTypeId);
         item.SeasonName     = $"{item.SeasonTypeName}-{item.Year}";
     }
 }
Example #2
0
        public ActionResult List(RaceFilterViewModel filterViewModel)
        {
            InitRaceFilterViewModel(ref filterViewModel, true);
            var                filter    = Mapper.Map <RaceFilter>(filterViewModel);
            RaceItems          list      = _raceRepository.GetRaceItems(UserContext.User.Id, UserContext.User.OrganizationId, filter);
            RaceItemsViewModel viewModel = Mapper.Map <RaceItemsViewModel>(list);

            viewModel.Filter = filterViewModel;
            InitListViewModel(viewModel, list);

            return(View(Mvc.View.Race.List, viewModel));
        }