示例#1
0
        // CUSTOMER & PERSON methods

        // Method takes a customer list and populates it with person and address data
        public List <Customer> PopulateCustomers(List <Customer> customerList)
        {
            List <Customer> customers          = customerList;
            List <Customer> customerObjectList = new List <Customer>();

            foreach (Customer customer in customerList)
            {
                // Get person object that is associated with Customer object
                Person person = Translators.Person.ToBusinessObject(_dataAccessObjects.GetPersonByPersonId(customer.PersonId));
                // Get address objects that are associated with customer object
                List <Address> addressList = Translators.Address.ToBusinessObject(_dataAccessObjects.GetAddressByPersonId(customer.PersonId));

                customerObjectList.Add(PopulateCustomerWithPersonAndAddress(customer, person, addressList));
            }
            return(customerObjectList);
        }