Пример #1
0
        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 };
        }
Пример #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 };
        }