Ejemplo n.º 1
0
 public IEnumerable <ScoutEmail> GetActiveEmails(ScoutType st)
 {
     return(_context.Scouts
            .Where(x => x.Section == st && x.Active)
            .Select(x => new ScoutEmail {
         Email = x.Email,
         ScoutId = x.ScoutId,
     })
            .ToList());
 }
Ejemplo n.º 2
0
        public IEnumerable <Transaction> GetList(ScoutType st, DateRange dates)
        {
            var query = _context.Transactions
                        .Where(x => x.TransactionDate >= dates.Start && x.TransactionDate <= dates.End);

            if (st != ScoutType.Unknown)
            {
                query = query.Where(x => x.Scout.Section == st);
            }

            return(query.ToList());
        }
Ejemplo n.º 3
0
 public IEnumerable <ScoutSummary> GetList(ScoutType st, bool includeDeleted)
 {
     return(_context.Scouts
            .Where(x => x.Section == st && (x.Active || includeDeleted))
            .Select(x => new ScoutSummary
     {
         Active = x.Active,
         Balance = x.Balance,
         First = x.FirstName,
         Last = x.LastName,
         MemberNumber = x.MemberNumber,
         ScoutId = x.ScoutId,
         Section = x.Section,
     })
            .OrderBy(x => x.First)
            .ThenBy(x => x.Last)
            .ToList());
 }
Ejemplo n.º 4
0
        public void Save(string strFile)
        {
            XDocument doc = new XDocument();

            XDeclaration declare = new XDeclaration("1.0", "utf-8", "true");

            doc.Declaration = declare;

            XElement rootElem = new XElement("Personnel");

            rootElem.Add(new XAttribute("Name", Name));
            rootElem.Add(new XAttribute("ScoutType", ScoutType.ToString()));

            foreach (Position pos in Positions)
            {
                pos.Save(rootElem);
            }

            doc.Add(rootElem);

            doc.Save(strFile);
        }
Ejemplo n.º 5
0
        public IEnumerable <ScoutEmail> Emails(ScoutType st)
        {
            var result = _data.GetActiveEmails(st);

            return(result);
        }
Ejemplo n.º 6
0
 public IEnumerable <ScoutSummary> Get(ScoutType st)
 {
     return(_data.GetList(st, false));
 }
Ejemplo n.º 7
0
 public IEnumerable <Transaction> Get(ScoutType st, DateTime start, DateTime end)
 {
     return(_data.GetList(st, new DateRange {
         Start = start, End = end
     }));
 }