예제 #1
0
        public EvaluateMemberAvatarModel(Evaluate.Models.Evaluate model)
        {
            var fileService = HostConstObject.Container.Resolve <IStorageFileService>();
            var avatar      = fileService.GetFiles(model.MemberId.ToGuid(), MemberBaseModule.Key, "Avatar").FirstOrDefault();

            Avatar = avatar?.Simplified();
        }
예제 #2
0
        public OneLevelCategoryModel(GoodsCategory model)
        {
            Id   = model.Id;
            Name = model.Name;
            var fileService = HostConstObject.Container.Resolve <IStorageFileService>();
            var mainImage   = fileService.GetFiles(model.Id, MallModule.Key, "CategoryImage").FirstOrDefault();

            CategoryImage = mainImage?.Simplified();
        }
예제 #3
0
        public DiscoveryModel(Models.Discovery model)
        {
            Id         = model.Id;
            Title      = model.Title;
            Content    = model.Content;
            CreateTime = model.CreateTime;
            ReadNum    = model.ReadNum;
            var fileService = HostConstObject.Container.Resolve <IStorageFileService>();
            var mainImage   = fileService.GetFiles(model.Id, DiscoveryModule.Key, "DiscoveryImages").FirstOrDefault();

            MainImage = mainImage?.Simplified();
        }
예제 #4
0
        public DiscoveryRelationGoodsModel(Models.DiscoveryGoodsRelation model)
        {
            GoodsId       = model.Goods.Id;
            GoodsName     = model.Goods.Name;
            OriginalPrice = model.Goods.OriginalPrice;
            PaymentAmount = model.Goods.PaymentAmount;

            var fileService = HostConstObject.Container.Resolve <IStorageFileService>();
            var mainImage   = fileService.GetFiles(model.Id, MallModule.Key, "MainImage").FirstOrDefault();

            MainImage = mainImage?.Simplified();
        }
예제 #5
0
        public OrderCalculationGoodsModel(SingleGoods model, int quantity)
        {
            GoodsId        = model.GoodsId;
            SingleGoodsId  = model.Id;
            Quantity       = quantity;
            GoodsName      = model.Goods.Name;
            GoodsAttribute = string.Join(",", model.Attributes.Select(me => me.AttributeValue).ToList());
            Price          = model.Goods.IsGroupon ? ((model.Goods.GrouponStartTime <= DateTime.Now && DateTime.Now <= model.Goods.GrouponEndTime) ? model.GrouponPrice : model.Price) : model.Price;

            var fileService = HostConstObject.Container.Resolve <IStorageFileService>();

            var goodsImage = fileService.GetFiles(SingleGoodsId, MallModule.Instance.InnerKey, GoodsId.ToString()).FirstOrDefault() ??
                             fileService.GetFiles(GoodsId, MallModule.Key, "MainImage").FirstOrDefault();

            GoodsImage = goodsImage?.Simplified();
        }
예제 #6
0
        public OrderCalculationGoodsModel(Cart model)
        {
            GoodsId        = model.GoodsId;
            SingleGoodsId  = model.SingleGoodsId;
            Quantity       = model.Quantity;
            GoodsName      = model.GoodsName;
            GoodsAttribute = model.GoodsAttribute;
            Price          = model.Price;

            var fileService = HostConstObject.Container.Resolve <IStorageFileService>();

            var goodsImage = fileService.GetFiles(SingleGoodsId, MallModule.Instance.InnerKey, GoodsId.ToString()).FirstOrDefault() ??
                             fileService.GetFiles(GoodsId, MallModule.Key, "MainImage").FirstOrDefault();

            GoodsImage = goodsImage?.Simplified();
        }
예제 #7
0
        public OrdreGoodsSimple(OrderGoods goods)
        {
            Id             = goods.Id;
            GoodsId        = goods.GoodsId;
            SingleGoodsId  = goods.SingleGoodsId;
            Quantity       = goods.Quantity;
            GoodsName      = goods.GoodsName;
            GoodsAttribute = goods.GoodsAttribute;
            Unit           = goods.Unit;
            Price          = goods.Price;
            RefundStatus   = goods.RefundStatus;
            var fileService = HostConstObject.Container.Resolve <IStorageFileService>();
            var goodsImage  = fileService.GetFiles(goods.Id, OrderProcessModule.Key, "GoodsImage").FirstOrDefault();

            GoodsImage = goodsImage?.Simplified();

            MaxRefundAmount = Price * Quantity;
        }
예제 #8
0
        public ListEvaluateModel(Models.Evaluate model)
        {
            Id         = model.Id;
            Content    = model.Content;
            Score      = model.Score;
            MemberId   = model.MemberId;
            MemberName = model.MemberName;
            CreateTime = model.CreateTime;

            var storageFileService = HostConstObject.Container.Resolve <IStorageFileService>();

            Images = storageFileService.GetFiles(model.Id, EvaluateModule.Key).Select(me => me.Simplified()).ToList();

            var memberService = HostConstObject.Container.Resolve <IMemberService>();

            var file = memberService.GetAvatarFile(model.MemberId);

            Avatar = file?.Simplified();
        }
예제 #9
0
        public ListCartModel(Cart model)
        {
            Id             = model.Id;
            GoodsId        = model.GoodsId;
            SingleGoodsId  = model.SingleGoodsId;
            GoodsAttribute = model.GoodsAttribute;
            Quantity       = model.Quantity;
            GoodsName      = model.GoodsName;
            Price          = model.Price;
            FreeShipping   = model.FreeShipping;
            var  goodsService = HostConstObject.Container.Resolve <IGoodsService>();
            bool isInvalid    = goodsService.CheckSingleGoodsIsInvalid(model.SingleGoodsId, model.Price);

            Status = isInvalid ? CartStatus.Invalid : CartStatus.Normal;
            var fileService = HostConstObject.Container.Resolve <IStorageFileService>();
            var mainImage   = fileService.GetFiles(model.GoodsId, MallModule.Key, "MainImage").FirstOrDefault();

            GoodsImage = mainImage?.Simplified();
        }
예제 #10
0
        public SimpleOrderGoods(OrderGoods goods, Order order)
        {
            GoodsId        = goods.GoodsId;
            SingleGoodsId  = goods.SingleGoodsId;
            Quantity       = goods.Quantity;
            GoodsName      = goods.GoodsName;
            GoodsAttribute = goods.GoodsAttribute;
            Unit           = goods.Unit;
            Price          = goods.Price;
            RefundStatus   = goods.RefundStatus;
            var fileService = HostConstObject.Container.Resolve <IStorageFileService>();
            var goodsImage  = fileService.GetFiles(goods.Id, OrderProcessModule.Key, "GoodsImage").FirstOrDefault();

            GoodsImage = goodsImage?.Simplified();

            MaxRefundAmount = Price * Quantity;
            if (order.IntegralMoney > 0)
            {
                MaxRefundAmount -= order.IntegralMoney * (Price * Quantity / order.GoodsAmount);
            }
        }
예제 #11
0
파일: Goods.cs 프로젝트: git-martin/yilehao
        public ListShortGoodsModel(Goods model)
        {
            Id               = model.Id;
            Name             = model.Name;
            GoodsNo          = model.GoodsNo;
            OriginalPrice    = model.OriginalPrice;
            ShopPrice        = model.ShopPrice;
            IsNew            = model.IsNew;
            IsHot            = model.IsHot;
            IsBest           = model.IsBest;
            SalesVolume      = model.SalesVolume;
            PaymentAmount    = model.PaymentAmount;
            Status           = model.Status;
            Stock            = model.Stock;
            IsGroupon        = model.IsGroupon;
            GrouponStartTime = model.GrouponStartTime;
            GrouponEndTime   = model.GrouponEndTime;
            var fileService = HostConstObject.Container.Resolve <IStorageFileService>();
            var mainImage   = fileService.GetFiles(model.Id, MallModule.Key, "MainImage").FirstOrDefault();

            MainImage = mainImage?.Simplified();
        }