public PutHtmlContentWidgetResponse Put(PutHtmlContentWidgetRequest request)
        {
            HtmlContentWidgetEntity widget;
            HtmlContentWidgetEntity originalWidget;

            var model = request.Data.ToServiceModel();
            if (request.Id.HasValue)
            {
                model.Id = request.Id.Value;
            }

            widgetService.SaveHtmlContentWidget(model, out widget, out originalWidget, false, true);

            return new PutHtmlContentWidgetResponse { Data = widget.Id };
        }
Esempio n. 2
0
        public PutHtmlContentWidgetResponse Put(PutHtmlContentWidgetRequest request)
        {
            HtmlContentWidgetEntity widget;
            HtmlContentWidgetEntity originalWidget;

            var model = request.Data.ToServiceModel();

            if (request.Id.HasValue)
            {
                model.Id = request.Id.Value;
            }

            IList <ContentOptionValuesViewModel> childContents = null;

            if (request.Data.ChildContentsOptionValues != null)
            {
                childContents = request.Data.ChildContentsOptionValues.ToViewModel();
            }
            widgetService.SaveHtmlContentWidget(model, childContents, out widget, out originalWidget, false, true);

            return(new PutHtmlContentWidgetResponse {
                Data = widget.Id
            });
        }
        public PutHtmlContentWidgetResponse Put(PutHtmlContentWidgetRequest request)
        {
            HtmlContentWidgetEntity widget;
            HtmlContentWidgetEntity originalWidget;

            var model = request.Data.ToServiceModel();
            if (request.Id.HasValue)
            {
                model.Id = request.Id.Value;
            }

            IList<ContentOptionValuesViewModel> childContents = null;
            if (request.Data.ChildContentsOptionValues != null)
            {
                childContents = request.Data.ChildContentsOptionValues.ToViewModel();
            }
            widgetService.SaveHtmlContentWidget(model, childContents, out widget, out originalWidget, false, true);

            return new PutHtmlContentWidgetResponse { Data = widget.Id };
        }