博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Duwamish7.0---(购物车实现)

Posted on 2006-03-15 09:44  HH  阅读(533)  评论(1编辑  收藏  举报
       /// <summary>
        ///     Add the item to the shopping cart and then display the contents
        ///     of the cart.
        ///     <param name="sender">The source of the event.</param>
        ///     <param name="e">An EventArgs that contains the event data.</param>
        /// </summary>
        public void AddToCartButton_Click(Object sender, EventArgs e)
        {
            //
            // Get the book information from the button's CommandArguments
            //
            string arguments = AddToCartButton.CommandArgument;
            char [] parsChar = {'|'};
            string[] addArgs = arguments.Split(parsChar);
            //
            // Add the item to the shoppingcart
            //       
            ShoppingCart().AddItem(Int32.Parse(addArgs[0]), addArgs[1] , Decimal.Parse(addArgs[2]));
       
            //
            // Go display it
            //
            Response.Redirect("shoppingcart.aspx", false);
        }