private void InitDdls() { BllTemplateObjects = _service.GetAllTemplateObjects(_templateId).OrderBy(x => x.Name); BllRestTemplateObjects = _service.GetRestTemplateObjects(_templateId); if (_pageId.HasValue) { BllPageObjects = _service.GetAllPageObjects(_pageId.Value).OrderBy(x => x.Name); } PageObjects = HighlightedTAreaToolbarHelper.GenerateObjectListItems(BllPageObjects); TemplateObjects = HighlightedTAreaToolbarHelper.GenerateObjectListItems(BllTemplateObjects); RestTemplateObjects = HighlightedTAreaToolbarHelper.GenerateRestObjectListItems(BllRestTemplateObjects); if (IsContainer || IsForm) { var content = _service.ReadContentProperties(_contentId.Value); var fields = ServiceField.CreateAll() .Select(f => new ListItem { Text = f.ColumnName, Value = f.ColumnName }) .Concat(content.Fields.Select(x => new ListItem { Text = x.Name, Value = x.Name })) .ToList(); fields.Insert(0, new ListItem { Text = TemplateStrings.SelectField, Value = string.Empty }); Fields = fields; } }
private IEnumerable <ArticleSearchableField> GetArticleSystemFieldList() { return(ServiceField.CreateAll() // служебные поля .Select(f => new ArticleSearchableField { ID = f.ID.ToString(), Name = f.Name, ColumnName = f.ColumnName, ArticleFieldSearchType = f.ArticleFieldSearchType })); }
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 })); }
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 }); }