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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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; }
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(); }
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(); }
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); } }
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(); }