Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    MembershipUser user = Helpers.LoggedUser;

                    if (user != null)
                    {
                        CurrentCart = hccCart.GetCurrentCart(user);
                    }
                    else
                    {
                        CurrentCart = hccCart.GetCurrentCart();
                    }

                    if (CurrentCart != null)
                    {
                        CartDisplay1.CurrentCartId = CurrentCart.CartID;
                        CartDisplay1.Bind();
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
        protected override void LoadForm()
        {
            try
            {
                if (this.PrimaryKeyIndex > 0 && CurrentCart == null)
                {
                    hccUserProfile profile = hccUserProfile.GetById(this.PrimaryKeyIndex);
                    CurrentCart = hccCart.GetCurrentCart(profile.ASPUser);
                }

                if (CurrentCart != null)
                {
                    CartDisplay1.CurrentCartId = CurrentCart.CartID;
                    CartDisplay1.Bind();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }