Ejemplo n.º 1
0
        public List <Owner> GetOwners(dsHvk.HVK_OWNERDataTable data)
        {
            List <Owner> list = new List <Owner>();

            //data.ToList().ForEach(row => list.Add(new Owner(row.OWNER_NUMBER, row.OWNER_FIRST_NAME,
            //                row.OWNER_LAST_NAME, row.OWNER_STREET, row.OWNER_CITY,
            //                row.OWNER_PROVINCE, row.OWNER_POSTAL_CODE, row.OWNER_EMAIL,
            //                row.EMERGENCY_CONTACT_PHONE, row.EMERGENCY_CONTACT_FIRST_NAME,
            //                row.EMERGENCY_CONTACT_LAST_NAME, row.EMERGENCY_CONTACT_PHONE,
            //                row.VET_VET_NUMBER))));

            if (data != null)
            {
                foreach (var row in data.ToList())
                {
                    try {
                        list.Add(new Owner(row.OWNER_NUMBER, row.OWNER_FIRST_NAME,
                                           row.OWNER_LAST_NAME, row.OWNER_STREET, row.OWNER_CITY,
                                           row.OWNER_PROVINCE, row.OWNER_POSTAL_CODE, row.OWNER_EMAIL,
                                           row.EMERGENCY_CONTACT_PHONE, row.EMERGENCY_CONTACT_FIRST_NAME,
                                           row.EMERGENCY_CONTACT_LAST_NAME, row.EMERGENCY_CONTACT_PHONE,
                                           row.VET_VET_NUMBER));
                    }
                    catch {
                    }
                }
            }
            else
            {
                list = null;
            }
            return(list);
        }
Ejemplo n.º 2
0
        public List <Owner> ListOwners()
        {
            OwnerDB ownDB = new OwnerDB();

            dsHvk.HVK_OWNERDataTable data = ownDB.GetFullOwnerInfo();
            return(GetOwners(data));
        }