Exemplo n.º 1
0
        public Collection <ListItem> GetAddressByPartyCode(string partyCode)
        {
            Collection <ListItem> values = new Collection <ListItem>();

            foreach (ShippingAddressView view in ShippingAddresses.GetShippingAddressView(AppUsers.GetCurrentUserDB(), partyCode))
            {
                string address = string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}{1}{3}{4}{5}{1}{6}{4}{7}", view.AddressLine1, Environment.NewLine, view.AddressLine2, view.Street, ", ", view.City, view.StateName, view.CountryName);

                values.Add(new ListItem(view.ShippingAddressCode, address));
            }

            return(values);
        }
Exemplo n.º 2
0
        public Collection <ListItem> GetAddressByPartyCode(string partyCode)
        {
            Collection <ListItem> values = new Collection <ListItem>();

            using (DataTable table = ShippingAddresses.GetShippingAddressView(partyCode))
            {
                string displayField = ConfigurationHelper.GetDbParameter("ShippingAddressDisplayField");
                table.Columns.Add("shipping_address", typeof(string), displayField);

                foreach (DataRow dr in table.Rows)
                {
                    values.Add(new ListItem(dr["shipping_address_code"].ToString(), dr["shipping_address"].ToString()));
                }
            }

            return(values);
        }