示例#1
0
        private List <MemberListItemViewModel> GetMemberListItems(bool showInactive)
        {
            List <Member>       members   = null;
            MemberListViewModel viewModel = new MemberListViewModel();

            if (showInactive && User.IsInRole(UserRoles.Admin.ToString()))
            {
                members = _dataService.GetAllClubMembers().Where(m => m.Status != "Active").ToList();
            }
            else
            {
                members = _dataService.GetClubMembersByStatus(MemberStatus.Active);
            }

            List <MemberListItemViewModel> items = members.Select(m => new MemberListItemViewModel()
            {
                Id             = m.Id,
                AltPhone       = m.AltPhone,
                City           = m.City,
                FullName       = m.FullName,
                FirstName      = m.FirstName,
                LastName       = m.LastName,
                Phone          = m.Phone,
                PIN            = m.Login.MemberPIN,
                PrimaryEmail   = m.Login.Email,
                SecondaryEmail = m.Login.Email2,
                Status         = m.Status
            }).ToList();

            return(items);
        }