示例#1
0
        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
        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"));
        }