Esempio n. 1
0
    public void Refresh(CartRefreshMethod type)
    {
        CartDB db = new CartDB();
        DataSet cart_data = null;

        switch(type)
        {
            case CartRefreshMethod.UniqueID:
                cart_data = db.GetCartFromGuid(this._UniqueId);
                break;
            case CartRefreshMethod.CartID:
                if (this._CartId > 0)
                {
                    cart_data = db.GetCartFromCartID(this._CartId);
                }
                break;
            case CartRefreshMethod.UserID:
                if (this._SiteId > 0 && this._UserId != null)
                {
                    cart_data = db.GetCartFromUserID(this._SiteId, this._UserId);
                }
                break;
        }

        this._populate_cart_from_dataset(cart_data);
    }