Esempio n. 1
0
        public async Task <ActionResult> FileProperties(string tabId, int parentId, string id, string successfulActionCode)
        {
            var file  = ContentFolderService.GetFile(parentId, id);
            var model = FileViewModel.Create(file, tabId, parentId, false);

            model.SuccesfulActionCode = successfulActionCode;
            return(await JsonHtml("FileProperties", model));
        }
Esempio n. 2
0
        public async Task <ActionResult> FileProperties(string tabId, int parentId, string id, IFormCollection collection)
        {
            var file  = ContentFolderService.GetFile(parentId, id);
            var model = FileViewModel.Create(file, tabId, parentId, false);

            await TryUpdateModelAsync(model);

            if (ModelState.IsValid)
            {
                ContentFolderService.SaveFile(model.File);
                return(Redirect("FileProperties", new { tabId, parentId, id = model.Id, successfulActionCode = ActionCode.UpdateContentFile }));
            }

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