Пример #1
0
        public JsonResult GetFieldsByContentId([FromBody] int contentId)
        {
            var content  = _pageTemplateService.GetContentById(contentId);
            var statuses = _pageTemplateService.GetStatusIdsByContentId(contentId, out var hasWorkflow);

            return(Json(new
            {
                success = true,
                fields = string.Join(",", ServiceField.CreateAll()
                                     .Select(f => f.ColumnName).Concat(content.Fields.Select(x => x.Name))),
                statuses,
                hasWorkflow
            }));
        }
Пример #2
0
        public JsonResult GetFieldsByContentId(int contentId)
        {
            var content  = _pageTemplateService.GetContentById(contentId);
            var statuses = _pageTemplateService.GetStatusIdsByContentId(contentId, out var hasWorkflow);

            return(new JsonResult
            {
                Data = new
                {
                    success = true,
                    fields = string.Join(",", ServiceField.CreateAll().Select(f => f.ColumnName).Concat(content.Fields.Select(x => x.Name))),
                    statuses,
                    hasWorkflow
                },
                JsonRequestBehavior = JsonRequestBehavior.DenyGet
            });
        }