BookShop/Common/ShoppingCart.cs

(开头部分) 1KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using CTL.Common;

namespace BookShop
{
    public class ShoppingCart
    {
        public ShoppingCart(Model.User userInfo)
        {
            UserInfo = userInfo;
        }
        public Model.User UserInfo
        {
            set;
            get;
        } 

        public int Total
        {
            get
            {
                int num = 0;

                foreach (Model.ShoppingCartItemInfo model in UsableCartItemList)
                {
                    num +=  model.Quantity;
                }

                return num;
            }
        }

        public decimal TotalPrice
        {
            get
            {
                decimal num = 0;

                foreach (Model.ShoppingCartItemInfo model in UsableCartItemList)
                {
                    num += model.Price * model.Quantity;
                }

                return  Utils.GetPriceByRound(2, num);
            }

        }

        /// <summary>
        /// 购物车项
        /// </summary>
        public List<Model.ShoppingCartItemInfo> UsableCartItemList
        {
            get
            {
                return ShoppingCartItemInfoBLL.GetShoppingCartList("UserID=" + UserInfo.UserID);
后面还有 11 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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