Esempio n. 1
0
        private UpdateCustomEntityVersionPageBlockCommand Map(CustomEntityVersionPageBlock dbPageBlock, string pageBlockTypeFileName)
        {
            var result = new UpdateCustomEntityVersionPageBlockCommand()
            {
                CustomEntityVersionPageBlockId = dbPageBlock.CustomEntityVersionPageBlockId,
                PageBlockTypeId         = dbPageBlock.PageBlockTypeId,
                PageBlockTypeTemplateId = dbPageBlock.PageBlockTypeTemplateId
            };

            result.DataModel = _pageVersionBlockModelMapper.MapDataModel(pageBlockTypeFileName, dbPageBlock);

            return(result);
        }
Esempio n. 2
0
        private CustomEntityVersionPageBlockDetails MapBlock(CustomEntityVersionPageBlock dbBlock, ICollection <PageBlockTypeSummary> allPageBlockTypes)
        {
            var blockType = allPageBlockTypes.SingleOrDefault(t => t.PageBlockTypeId == dbBlock.PageBlockTypeId);

            var block = new CustomEntityVersionPageBlockDetails();

            block.BlockType = blockType;
            block.DataModel = _pageVersionBlockModelMapper.MapDataModel(blockType.FileName, dbBlock);
            block.CustomEntityVersionPageBlockId = dbBlock.CustomEntityVersionPageBlockId;
            block.Template = _entityVersionPageBlockMapper.GetCustomTemplate(dbBlock, blockType);

            return(block);
        }
Esempio n. 3
0
        private UpdatePageVersionBlockCommand Map(PageVersionBlock pageVersionBlock, string blockTypeFileName)
        {
            var result = new UpdatePageVersionBlockCommand()
            {
                PageBlockTypeId         = pageVersionBlock.PageBlockTypeId,
                PageBlockTypeTemplateId = pageVersionBlock.PageBlockTypeTemplateId,
                PageVersionBlockId      = pageVersionBlock.PageVersionBlockId
            };

            result.DataModel = _pageVersionBlockModelMapper.MapDataModel(blockTypeFileName, pageVersionBlock);

            return(result);
        }