Esempio n. 1
0
        public static List <AddressModel> GetAddressesByUserID(int id)
        {
            List <AddressModel> addresses = new List <AddressModel>();
            var reader = AddressDAL.SelectAddressByUserID(id);

            while (reader.Read())
            {
                AddressModel address = new AddressModel();
                address.id        = reader.GetInt32(0);
                address.tel       = reader.GetString(1);
                address.add       = reader.GetString(2);
                address.name      = reader.GetString(3);
                address.user_id   = reader.GetInt32(4);
                address.enabled   = reader.GetInt32(5);
                address.isdefault = reader.GetInt32(6);
                addresses.Add(address);
            }
            reader.Close();
            return(addresses);
        }