Beispiel #1
0
        static public List <Donation> GetIncomingAccountDonations(BankAccount Account)
        {
            List <Donation> IncomingDonations = new List <Donation>();

            if (BankAccountServices.IsNotNull(Account))
            {
                if (BankAccountServices.ExistInRecord(Account))
                {
                    List <WaitingTicket> AccountTickets = TicketServices.GetTicketsForAccount(Account);
                    foreach (WaitingTicket t in AccountTickets)// loop through the list of ticket options
                    {
                        if (t.Donations.Count() != 0)
                        {
                            foreach (Donation d in t.Donations)    // loop through the donations list of each ticket
                            {
                                if (DonationServices.IsNotNull(d)) // add non null donations to the list of donations.
                                {
                                    IncomingDonations.Add(d);
                                }
                            }
                        }
                    }
                }
            }
            return(IncomingDonations);
        }
Beispiel #2
0
        public static List <WaitingTicket> GetTicketsForAccount(BankAccount Account)
        {
            List <WaitingTicket> TicketList = null;

            if (BankAccountServices.IsNotNull(Account))
            {
                if (BankAccountServices.ExistInRecord(Account))
                {
                    TicketList = (from t in DbAccessHandler.DbContext.WaitingList where t.TicketHolder.Id == Account.Id select t).ToList();
                }
            }
            return(TicketList);
        }
Beispiel #3
0
        static public List <Donation> GetOutgoingAccountDonations(BankAccount Account)
        {
            List <Donation> OutgoingDonations = null;

            if (BankAccountServices.IsNotNull(Account))
            {
                if (BankAccountServices.ExistInRecord(Account))
                {
                    OutgoingDonations = (from d in DbAccessHandler.DbContext.Donations where d.DonorId == Account.Id select d).ToList();
                }
            }
            return(OutgoingDonations);
        }