Esempio n. 1
0
        /// <summary>
        /// 套餐空间效果图映射
        /// </summary>
        /// <param name="space"></param>
        /// <param name="packSchemeSpaces"></param>
        /// <returns></returns>
        public static App_DecorationPackSpaceImageInfo ToAppDTO(this DecorationPackSpace space, IEnumerable <DecorationPackSchemeSpace> packSchemeSpaces)
        {
            App_DecorationPackSpaceImageInfo spaceImageInfo = Transform <DecorationPackSpace, App_DecorationPackSpaceImageInfo> .Map(space);

            spaceImageInfo.PackSpaceId         = space.Id;
            spaceImageInfo.PackSpaceName       = space.Name;
            spaceImageInfo.PackSchemeSpaceInfo = packSchemeSpaces.Any() ? packSchemeSpaces.Where(x => x.PackSpaceId == space.Id).Select(x => x.ToDTO()) : new List <DecorationPackSchemeSpaceInfo>();
            return(spaceImageInfo);
        }
Esempio n. 2
0
        /// <summary>
        /// 套餐模板空间映射
        /// </summary>
        /// <param name="packSpace">套餐模板空间领域模型</param>
        /// <param name="offShelvedSkuDic">是否有下架商品</param>
        /// <param name="offShelvedCraftDic">是否有下架工艺</param>
        /// <param name="changedSkuDic">是否有变价商品</param>
        /// <param name="changedCraftDic">是否有变价工艺</param>
        /// <returns>套餐模板空间数据传输对象</returns>
        public static DecorationPackSpaceInfo ToDTO(this DecorationPackSpace packSpace, IDictionary <Guid, bool> offShelvedSkuDic, IDictionary <Guid, bool> offShelvedCraftDic, IDictionary <Guid, bool> changedSkuDic, IDictionary <Guid, bool> changedCraftDic)
        {
            DecorationPackSpaceInfo packSpaceInfo = Transform <DecorationPackSpace, DecorationPackSpaceInfo> .Map(packSpace);

            packSpaceInfo.DecorationPackInfo             = packSpace.DecorationPack.ToDTO(new List <DecorationPackScheme>());
            packSpaceInfo.DecorationPackSpaceDetailInfos = packSpace.SpaceDetails.Select(x => x.ToDTO());
            packSpaceInfo.ExistsOffShelvedSkuCraft       = offShelvedSkuDic[packSpace.Id] || offShelvedCraftDic[packSpace.Id];
            packSpaceInfo.ExistsChangedSkuCraft          = changedSkuDic[packSpace.Id] || changedCraftDic[packSpace.Id];

            return(packSpaceInfo);
        }
Esempio n. 3
0
        /// <summary>
        /// 套餐空间基础信息映射
        /// </summary>
        /// <param name="space"></param>
        /// <returns></returns>
        public static DecorationPackSpaceBaseInfo ToDto(this DecorationPackSpace space)
        {
            DecorationPackSpaceBaseInfo packSpaceInfo = Transform <DecorationPackSpace, DecorationPackSpaceBaseInfo> .Map(space);

            return(packSpaceInfo);
        }