Exemple #1
0
        public async Task <ActionResult> New(string tabId, int parentId)
        {
            var plugin = _pluginService.New(parentId);
            var model  = QpPluginViewModel.Create(plugin, tabId, parentId, _factory);

            return(await JsonHtml("Properties", model));
        }
Exemple #2
0
        public async Task <ActionResult> Properties(string tabId, int parentId, int id, string successfulActionCode)
        {
            var plugin = _pluginService.Read(id);
            var model  = QpPluginViewModel.Create(plugin, tabId, parentId, _factory);

            model.SuccesfulActionCode = successfulActionCode;

            return(await JsonHtml("Properties", model));
        }
Exemple #3
0
        public async Task <ActionResult> Properties(string tabId, int parentId, int id, IFormCollection collection)
        {
            var plugin = _pluginService.ReadForUpdate(id);
            var model  = QpPluginViewModel.Create(plugin, tabId, parentId, _factory);

            await TryUpdateModelAsync(model);

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

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