예제 #1
0
 private void InitMemberFilterViewModel(ref MemberFilterViewModel filterViewModel, bool isList)
 {
     if (isList)
     {
         InitBaseFilterViewModel(filterViewModel);
     }
 }
예제 #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));
        }
예제 #3
0
        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);
        }