コード例 #1
0
ファイル: FormatController.cs プロジェクト: QuantumArt/QP
        public async Task <ActionResult> PageObjectFormatProperties(string tabId, int parentId, int id, IFormCollection collection)
        {
            var format = _formatService.ReadPageObjectFormatPropertiesForUpdate(id, _formatService.IsSiteDotNetByObjectId(parentId));
            var model  = ObjectFormatViewModel.Create(format, tabId, parentId, _formatService, true);

            await TryUpdateModelAsync(model);

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

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