Exemple #1
0
        public static List <Payment> GetIncomingPaymentsForAccount(BankAccount account)
        {
            List <Payment> IncomingPaymentsList = new List <Payment>();

            if (BankAccountServices.IsNotNull(account))
            {
                List <WaitingTicket> AccountTickets = TicketServices.GetTicketsForAccount(account);
                if (AccountTickets.Count() > 0)
                {
                    foreach (WaitingTicket t in AccountTickets)
                    {
                        if (t.Donations != null)
                        {
                            foreach (Donation d in t.Donations)
                            {
                                Payment p = GetPaymentForDonation(d);
                                if (IsNotNull(p))
                                {
                                    IncomingPaymentsList.Add(p);
                                }
                            }
                        }
                    }
                }
            }
            return(IncomingPaymentsList);
        }
Exemple #2
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);
        }