Beispiel #1
0
 private void InitListViewModel(PigeonItemsViewModel viewModel, PigeonItems list)
 {
     foreach (var item in viewModel.Items)
     {
         InitBaseItemViewModel(item);
         item.Sex = GetSexName(item.SexId);
     }
 }
Beispiel #2
0
        public ActionResult List(PigeonFilterViewModel filterViewModel)
        {
            InitPigeonFilterViewModel(ref filterViewModel, true);
            var                  filter    = Mapper.Map <PigeonFilter>(filterViewModel);
            PigeonItems          list      = _pigeonRepository.GetPigeonItems(UserContext.User.Id, UserContext.User.OrganizationId, filter);
            PigeonItemsViewModel viewModel = Mapper.Map <PigeonItemsViewModel>(list);

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

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