Exemplo n.º 1
0
        public async Task <ActionResult> New(string tabId, int parentId)
        {
            var status = _statusTypeService.NewStatusTypeProperties(parentId);
            var model  = StatusTypeViewModel.Create(status, tabId, parentId);

            return(await JsonHtml("Properties", model));
        }
Exemplo n.º 2
0
        public async Task <ActionResult> Properties(string tabId, int parentId, int id, string successfulActionCode)
        {
            var status = _statusTypeService.ReadProperties(id);
            var model  = StatusTypeViewModel.Create(status, tabId, parentId);

            model.SuccesfulActionCode = successfulActionCode;
            return(await JsonHtml("Properties", model));
        }
Exemplo n.º 3
0
        public async Task <ActionResult> Properties(string tabId, int parentId, int id, IFormCollection collection)
        {
            var status = _statusTypeService.ReadPropertiesForUpdate(id);
            var model  = StatusTypeViewModel.Create(status, tabId, parentId);

            await TryUpdateModelAsync(model);

            if (ModelState.IsValid)
            {
                model.Data = _statusTypeService.UpdateProperties(model.Data);
                return(Redirect("Properties", new { tabId, parentId, id = model.Data.Id, successfulActionCode = ActionCode.UpdateVisualEditorPlugin }));
            }

            return(await JsonHtml("Properties", model));
        }
Exemplo n.º 4
0
        public async Task <ActionResult> New(string tabId, int parentId, IFormCollection collection)
        {
            var status = _statusTypeService.NewStatusTypePropertiesForUpdate(parentId);
            var model  = StatusTypeViewModel.Create(status, tabId, parentId);

            await TryUpdateModelAsync(model);

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

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