Esempio n. 1
0
 private void InitMemberFilterViewModel(ref MemberFilterViewModel filterViewModel, bool isList)
 {
     if (isList)
     {
         InitBaseFilterViewModel(filterViewModel);
     }
 }
Esempio n. 2
0
        public ActionResult List(MemberFilterViewModel filterViewModel)
        {
            InitMemberFilterViewModel(ref filterViewModel, true);
            var                  filter    = Mapper.Map <MemberFilter>(filterViewModel);
            MemberItems          list      = _memberRepository.GetMemberItems(UserContext.User.Id, UserContext.User.OrganizationId, filter);
            MemberItemsViewModel viewModel = Mapper.Map <MemberItemsViewModel>(list);

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

            return(View(Mvc.View.Member.List, viewModel));
        }
        public async Task<ActionResult<IEnumerable<Member>>> Index(int? pageNumber, int? pageSize, string memberFilter)
        {
            var memberParams = new MemberParams
            {
                PageNumber = pageNumber ?? 1,
                PageSize = pageSize ?? Convert.ToInt32(_config.GetValue<string>("MemberPagination:PageSize")),
                Filter = memberFilter ?? "none"
            };

            var memberFilterViewModel = new MemberFilterViewModel
            {
                Members = await _unitOfWork.Members.GetMembersWithMembershipTypeAsync(memberParams),
                MemberFilters = Utility.MemberFilters.GetMemberFilters()
            };

            return View(memberFilterViewModel);
        }