Esempio n. 1
0
        public ActionResult New(string tabId, int parentId, int id)
        {
            var folder = SiteFolderService.New(parentId, id);
            var model  = SiteFolderViewModel.Create(folder, tabId, parentId);

            return(JsonHtml("FolderProperties", model));
        }
Esempio n. 2
0
        public ActionResult Properties(string tabId, int parentId, int id, string successfulActionCode)
        {
            var folder = SiteFolderService.Read(id);
            var model  = SiteFolderViewModel.Create(folder, tabId, parentId);

            model.SuccesfulActionCode = successfulActionCode;
            return(JsonHtml("FolderProperties", model));
        }
Esempio n. 3
0
        public ActionResult Properties(string tabId, int parentId, int id, FormCollection collection)
        {
            var folder = SiteFolderService.ReadForUpdate(id);
            var model  = SiteFolderViewModel.Create(folder, tabId, parentId);

            TryUpdateModel(model);
            model.Validate(ModelState);
            if (ModelState.IsValid)
            {
                model.Data = SiteFolderService.Update(model.Data);
                return(Redirect("Properties", new { tabId, parentId, id = model.Data.Id, successfulActionCode = ActionCode.UpdateSite }));
            }

            return(JsonHtml("FolderProperties", model));
        }
Esempio n. 4
0
        public async Task <ActionResult> New(string tabId, int parentId, int id, IFormCollection collection)
        {
            var folder = SiteFolderService.NewForSave(parentId, id);
            var model  = SiteFolderViewModel.Create(folder, tabId, parentId);

            await TryUpdateModelAsync(model);

            if (ModelState.IsValid)
            {
                model.Data = SiteFolderService.Save(model.Data);
                PersistResultId(model.Data.Id);
                return(Redirect("Properties", new { tabId, parentId, id = model.Data.Id, successfulActionCode = ActionCode.SaveSiteFolder }));
            }

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