Esempio n. 1
0
        //Returns a list of all payments created, with dataAccessFacade as parameter to access ReadAllPayments
        //through dataAccessFacade, to get a list of paymentEntities.
        internal static List <Payment> ReadAll(IDataAccessFacade dataAccessFacade)
        {
            List <IPayment> paymentEntities = dataAccessFacade.ReadAllPayments();
            List <Payment>  payments        = new List <Payment>();

            //foreach converts each paymentEntity from paymentEntities to a payment, and adds it to a list of payments.
            foreach (IPayment paymentEntity in paymentEntities)
            {
                Payment payment = new Payment(paymentEntity, dataAccessFacade);
                payments.Add(payment);
            }
            return(payments);
        }
Esempio n. 2
0
        //Returns a list of all payments created, with dataAccessFacade as parameter to access ReadAllPayments
        //through dataAccessFacade, to get a list of paymentEntities.
        internal static List<Payment> ReadAll(IDataAccessFacade dataAccessFacade)
        {
            List<IPayment> paymentEntities = dataAccessFacade.ReadAllPayments();
            List<Payment> payments = new List<Payment>();

            //foreach converts each paymentEntity from paymentEntities to a payment, and adds it to a list of payments.
            foreach (IPayment paymentEntity in paymentEntities)
            {
                Payment payment = new Payment(paymentEntity, dataAccessFacade);
                payments.Add(payment);
            }
            return payments;
        }