Example #1
0
        public async Task <ActionResult> NotificationTemplateFormatProperties(string tabId, int parentId, int id, string successfulActionCode)
        {
            var format   = _notificationService.ReadNotificationTemplateFormat(id);
            var template = _notificationService.ReadPageTemplateByObjectFormatId(id);
            var model    = NotificationTemplateFormatViewModel.Create(format, tabId, parentId, template.Id, template.SiteId);

            model.SuccesfulActionCode = successfulActionCode;
            return(await JsonHtml("NotificationTemplateFormatProperties", model));
        }
Example #2
0
        public async Task <ActionResult> NotificationTemplateFormatProperties(string tabId, int parentId, int id, IFormCollection collection)
        {
            var format   = _notificationService.ReadNotificationTemplateFormatForUpdate(id);
            var template = _notificationService.ReadPageTemplateByObjectFormatId(id);
            var model    = NotificationTemplateFormatViewModel.Create(format, tabId, parentId, template.Id, template.SiteId);

            await TryUpdateModelAsync(model);

            if (ModelState.IsValid)
            {
                model.Data = _notificationService.UpdateNotificationTemplateFormat(model.Data);
                return(Redirect("NotificationTemplateFormatProperties", new { tabId, parentId, id = model.Data.Id, successfulActionCode = ActionCode.UpdateContentGroup }));
            }

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