App_Code/ShopCart.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/*******************************************************************************
             购物车类                                  
             本类主要实现购物车功能                    
 * *****************************************************************************/
using System;
using System.Collections;


    /// <summary>
    /// 购物车类
    /// </summary>
    public class ShopCart
    {
        private Hashtable ProductList = new Hashtable();

        public ShopCart() { }

        /// <summary>
        /// 所有商品信息
        /// </summary>
        public ICollection Orders
        {
            get { return ProductList.Values; }
        }

        /// <summary>
        /// 商品总价格
        /// </summary>
        public decimal TotalCounts
        {
            get
            {
                decimal totals = 0;
                foreach (DictionaryEntry Product in ProductList)
                {
                    totals += ((ProductItem)Product.Value).Totals;
                }
                return totals;
            }
        }

        /// <summary>
        /// 商品总数量
        /// </summary>
        public int Total
        {
            get
            {
                int totals = 0;
                foreach (DictionaryEntry Product in ProductList)
                {
                    totals += ((ProductItem)Product.Value).ProductCount;
                }
                return totals;
            }
        }

        /// <summary>
        /// 添加商品到购物车
        /// </summary>
后面还有 63 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。