Ejemplo n.º 1
0
        private void DeleteAddress(int addressId)
        {
            IList <Address> addresses = AbleContext.Current.User.Addresses;

            for (int i = 0; i < addresses.Count; i++)
            {
                if (addresses[i].Id == addressId)
                {
                    addresses.DeleteAt(i);
                    break;
                }
            }
            //BIND THE ADDRESSES TO THE DATALIST
            ShipToAddressList.DataSource = addresses;
            ShipToAddressList.DataBind();
        }
Ejemplo n.º 2
0
        protected void InitAddressBook()
        {
            //REARRANGE THE ADDRESSES SO THAT THE PRIMARY ADDRESS DISPLAYS FIRST
            //AND THE REMAINING ADDRESSES ARE IN ALPHABETICAL ORDER BY LAST NAME
            IList <Address> addresses = AbleContext.Current.User.Addresses;

            addresses.Sort("LastName");
            int defaultIndex = addresses.IndexOf(AlwaysConvert.ToInt(AbleContext.Current.User.PrimaryAddressId));

            if (defaultIndex > 0)
            {
                Address tempAddress = addresses[defaultIndex];
                addresses.RemoveAt(defaultIndex);
                addresses.Insert(0, tempAddress);
            }
            //BIND THE ADDRESSES TO THE DATALIST
            ShipToAddressList.DataSource = AbleContext.Current.User.Addresses;
            ShipToAddressList.DataBind();
            AddressValidationPanel.Visible = _addressValidator != null;
        }
Ejemplo n.º 3
0
 protected void BindUserAddresses()
 {
     ShipToAddressList.DataSource = AbleContext.Current.User.Addresses;
     ShipToAddressList.DataBind();
 }