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; } }
public InsertPopupViewModel(int templateId, int?languageId, string assemblingType, bool presentationOrCodeBehind, bool isContainer, bool isForm, int?contentId, int?pageId, IPageTemplateService service) { Functions = HighlightedTAreaToolbarHelper.FunctionsAsListItems(languageId, assemblingType, presentationOrCodeBehind, isContainer); ContainerProps = HighlightedTAreaToolbarHelper.ContainerInfoPropertiesAsListItems(languageId, assemblingType, presentationOrCodeBehind); IsContainer = isContainer; IsForm = isForm; _templateId = templateId; _service = service; _pageId = pageId; _contentId = contentId; InitDdls(); }