Ejemplo n.º 1
0
        public IActionResult LayoutZones(string ID)
        {
            var layout    = Service.Get(ID);
            var viewModel = new LayoutZonesViewModel
            {
                Layout     = layout,
                LayoutID   = ID,
                Zones      = _zoneService.GetByLayoutId(ID),
                Widgets    = _widgetService.GetByLayoutId(ID),
                LayoutHtml = layout.Html
            };

            return(View(viewModel));
        }
Ejemplo n.º 2
0
        public override LayoutEntity Get(params object[] primaryKeys)
        {
            LayoutEntity entity = base.Get(primaryKeys);

            if (entity == null)
            {
                return(null);
            }
            IEnumerable <ZoneEntity> zones = _zoneService.GetByLayoutId(entity.ID);

            entity.Zones = new ZoneCollection();
            zones.Each(entity.Zones.Add);
            IEnumerable <LayoutHtml> htmls = _layoutHtmlService.GetByLayoutID(entity.ID);

            entity.Html = new LayoutHtmlCollection();
            htmls.Each(entity.Html.Add);
            return(entity);
        }