Пример #1
0
        public async Task <ActionResult> NewTemplateObjectFormat(string tabId, int parentId)
        {
            var format = _formatService.NewTemplateObjectFormatProperties(parentId, _formatService.IsSiteDotNetByObjectId(parentId));
            var model  = ObjectFormatViewModel.Create(format, tabId, parentId, _formatService, false);

            return(await JsonHtml("Properties", model));
        }
Пример #2
0
        public ActionResult NewPageObjectFormat(string tabId, int parentId)
        {
            var format = _formatService.NewPageObjectFormatProperties(parentId, _formatService.IsSiteDotNetByObjectId(parentId));
            var model  = ObjectFormatViewModel.Create(format, tabId, parentId, _formatService, true);

            return(JsonHtml("Properties", model));
        }
Пример #3
0
        public async Task <ActionResult> TemplateObjectFormatProperties(string tabId, int parentId, int id, string successfulActionCode)
        {
            var format = _formatService.ReadTemplateObjectFormatProperties(id, _formatService.IsSiteDotNetByObjectId(parentId));
            var model  = ObjectFormatViewModel.Create(format, tabId, parentId, _formatService, false);

            ViewData[SpecialKeys.IsEntityReadOnly] = format.LockedByAnyoneElse;
            model.SuccesfulActionCode = successfulActionCode;
            return(await JsonHtml("Properties", model));
        }
Пример #4
0
        public async Task <ActionResult> TemplateObjectFormatProperties(string tabId, int parentId, int id, IFormCollection collection)
        {
            var format = _formatService.ReadTemplateObjectFormatPropertiesForUpdate(id, _formatService.IsSiteDotNetByObjectId(parentId));
            var model  = ObjectFormatViewModel.Create(format, tabId, parentId, _formatService, false);

            await TryUpdateModelAsync(model);

            if (ModelState.IsValid)
            {
                model.Data = _formatService.UpdateObjectFormatProperties(model.Data);
                return(Redirect("TemplateObjectFormatProperties", new { tabId, parentId, id = model.Data.Id, successfulActionCode = ActionCode.UpdateTemplateObjectFormat }));
            }

            return(await JsonHtml("Properties", model));
        }
Пример #5
0
        public ActionResult PageObjectFormatProperties(string tabId, int parentId, int id, FormCollection collection)
        {
            var format = _formatService.ReadPageObjectFormatPropertiesForUpdate(id, _formatService.IsSiteDotNetByObjectId(parentId));
            var model  = ObjectFormatViewModel.Create(format, tabId, parentId, _formatService, true);

            TryUpdateModel(model);
            model.Validate(ModelState);
            if (ModelState.IsValid)
            {
                model.Data = _formatService.UpdateObjectFormatProperties(model.Data);
                return(Redirect("PageObjectFormatProperties", new { tabId, parentId, id = model.Data.Id, successfulActionCode = ActionCode.UpdatePageObjectFormat }));
            }

            return(JsonHtml("Properties", model));
        }