/// <summary> /// 套餐模板商品SKU项映射 /// </summary> /// <param name="packSku">套餐模板商品SKU项领域模型</param> /// <param name="packs"></param> /// <returns>套餐模板商品SKU项数据传输对象</returns> public static DecorationPackSkuInfo ToDTO(this DecorationPackSku packSku, IDictionary <Guid, DecorationPack> packs) { DecorationPackSkuInfo packSkuInfo = Transform <DecorationPackSku, DecorationPackSkuInfo> .Map(packSku); packSkuInfo.PackItemInfo = packSku.PackItem.ToDTO(packs); return(packSkuInfo); }
/// <summary> /// 套餐模板商品映射 /// </summary> /// <param name="packSku">套餐模板商品领域模型</param> /// <param name="productSkuInfo">商品信息</param> /// <param name="decorationPackSpaces">空间集</param> /// <returns>套餐模板商品数据传输对象</returns> public static App_DecorationPackSkuInfo ToAppDTO(this DecorationPackSku packSku, ProductSkuInfo productSkuInfo, IEnumerable <DecorationPackSpace> decorationPackSpaces) { App_DecorationPackSkuInfo packSkuInfo = Transform <DecorationPackSku, App_DecorationPackSkuInfo> .Map(packSku); packSkuInfo.PackItemName = packSku.PackItem.Name; packSkuInfo.SpaceName = decorationPackSpaces.Single(s => s.Id == packSku.PackItem.PackSpaceId).Name; packSkuInfo.SpaceId = packSku.PackItem.PackSpaceId; packSkuInfo.Sort = decorationPackSpaces.Single(s => s.Id == packSku.PackItem.PackSpaceId).Sort; packSkuInfo.Name = productSkuInfo.Name; packSkuInfo.ProductType = productSkuInfo.ProductType; packSkuInfo.Brand = productSkuInfo.BrandName; packSkuInfo.Category = productSkuInfo.CategoryName; return(packSkuInfo); }
public void ReOnShelfDecorationPackSku(Guid skuId) { IEnumerable <Guid> packItemIds = this._repMediator.DecorationPackSkuRep.FindPackItemIds(skuId); foreach (Guid packItemId in packItemIds) { DecorationPackItem currentPackItem = this._unitOfWork.Resolve <DecorationPackItem>(packItemId); DecorationPackSku currentPackSku = currentPackItem.GetPackSku(skuId); currentPackSku.ReOnShelf(); this._unitOfWork.RegisterSave(currentPackItem); } this._unitOfWork.UnitedCommit(); }