コード例 #1
0
ファイル: SectionController.cs プロジェクト: vtan31/PortalCMS
        public ActionResult Edit(EditViewModel model)
        {
            if ("colour".Equals(model.BackgroundType, StringComparison.OrdinalIgnoreCase))
            {
                _pageSectionService.SetBackgroundType(model.SectionId, false);

                if (!string.IsNullOrWhiteSpace(model.BackgroundColour))
                {
                    _pageSectionService.Background(model.SectionId, model.BackgroundColour);
                }
            }
            else
            {
                _pageSectionService.SetBackgroundType(model.SectionId, true);

                if (model.BackgroundImageId > 0)
                {
                    _pageSectionService.Background(model.SectionId, model.BackgroundImageId);
                }

                _pageSectionService.SetBackgroundStyle(model.SectionId, model.PageSectionBackgroundStyle);
            }

            _pageSectionService.Height(model.SectionId, model.PageSectionHeight);
            _pageSectionService.Roles(model.SectionId, model.SelectedRoleList);

            return(Content("Refresh"));
        }
コード例 #2
0
ファイル: SectionController.cs プロジェクト: mesh42/PortalCMS
        public JsonResult Edit(EditViewModel model)
        {
            try
            {
                if ("colour".Equals(model.BackgroundType, StringComparison.OrdinalIgnoreCase))
                {
                    _pageSectionService.SetBackgroundType(model.SectionId, false);

                    if (!string.IsNullOrWhiteSpace(model.BackgroundColour))
                    {
                        _pageSectionService.Background(model.SectionId, model.BackgroundColour);
                    }
                }
                else
                {
                    _pageSectionService.SetBackgroundType(model.SectionId, true);

                    if (model.BackgroundImageId > 0)
                    {
                        _pageSectionService.Background(model.SectionId, model.BackgroundImageId);
                    }

                    _pageSectionService.SetBackgroundStyle(model.SectionId, model.PageSectionBackgroundStyle);
                }

                _pageSectionService.Height(model.SectionId, model.PageSectionHeight);
                _pageSectionService.Roles(model.SectionId, model.SelectedRoleList);

                return(Json(new { State = true, SectionMarkup = _pageSectionService.Get(model.SectionId).PageSectionBody }));
            }
            catch (Exception)
            {
                return(Json(new { State = false }));
            }
        }
コード例 #3
0
        public ActionResult Edit(EditViewModel model)
        {
            if (model.BackgroundImageId > 0)
            {
                _pageSectionService.Background(model.SectionId, model.BackgroundImageId);
            }

            _pageSectionService.Height(model.SectionId, model.PageSectionHeight);
            _pageSectionService.BackgroundType(model.SectionId, model.PageSectionBackgroundType);

            _pageSectionService.Roles(model.SectionId, model.SelectedRoleList);

            return(Content("Refresh"));
        }