Beispiel #1
0
        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;
            }
        }