Exemplo n.º 1
0
        public ActionResult CandidateReport()
        {
            //so in order to re-use code a bit I get a full (no where clause) list from this.memberSummaryItems()
            //then we filter using linq

            var memberList = this.memberSummaryItems();


            var candidates = (from m in memberList
                              where m.Capacity.ToLower() == "candidate"
                              select m).ToList();

            Models.Membership.MemberSummary ms = new Models.Membership.MemberSummary();
            ms.AddRange(candidates);


            return(View(ms));
        }
Exemplo n.º 2
0
        public ActionResult WinterReadyReport()
        {
            //so in order to re-use code a bit I get a full (no where clause) list from this.memberSummaryItems()
            //then we filter using linq

            var memberList = this.memberSummaryItems();


            var candidates = (from m in memberList
                              where m.IsWinterFieldReady == true
                              select m).ToList();

            Models.Membership.MemberSummary ms = new Models.Membership.MemberSummary();
            ms.AddRange(candidates);


            return(View(ms));
        }
Exemplo n.º 3
0
        private Models.Membership.MemberSummary memberSummaryItems()
        {
            Models.Membership.MemberSummary memberList = new Models.Membership.MemberSummary();

            var dbmems = (from m in _context.Member
                          orderby m.LastName, m.FirstName
                          select m).ToList();

            _context.Member.Include(x => x.MemberCertification).ThenInclude(y => y.Certification).Load();
            _context.Member.Include(x => x.MemberCpr).ThenInclude(y => y.Cpr).Load();
            _context.Member.Include(x => x.MemberMedical).ThenInclude(y => y.Medical).Load();
            _context.Member.Include(x => x.Capacity).Load();
            _context.Member.Include(x => x.TrainingClassStudent).ThenInclude(y => y.TrainingClass).ThenInclude(z => z.Training).Load();

            foreach (var x in dbmems)
            {
                memberList.Add(new Models.Membership.MemberSummaryItem(x, _applicationOptions, _config));
            }

            return(memberList);
        }