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

            await TryUpdateModelAsync(model);

            if (ModelState.IsValid)
            {
                model.Data = _formatService.SaveObjectFormatProperties(model.Data);
                PersistResultId(model.Data.Id);
                return(Redirect("PageObjectFormatProperties", new { tabId, parentId, id = model.Data.Id, successfulActionCode = ActionCode.SavePageObjectFormat }));
            }

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