예제 #1
0
 public ActionResult ListMembers(bool showInactive)
 {
     MemberListViewModel viewModel = new MemberListViewModel();
     viewModel.ShowInactive = showInactive;
     viewModel.Members = GetMemberListItems(showInactive);
     return View(ViewNames.MemberList, viewModel);
 }
예제 #2
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;
        }
예제 #3
0
        //
        // GET: /Member/
        public ViewResult Index()
        {
            MemberListViewModel viewModel = new MemberListViewModel();
            viewModel.ShowInactive = false;

            //if (User.IsInRole(UserRoles.Admin.ToString()))
            //    members = _dataService.GetAllClubMembers();
            //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();

            viewModel.Members = GetMemberListItems(false);

            return View(ViewNames.MemberList, viewModel);
        }