private string GetExtraFieldValue(int articleId, int articleModuleId, string tagname) { //Determine ID of ExtraField var extraFieldId = -1; if (!_extrafieldIds.ContainsKey(tagname + articleModuleId)) { var lst = new ExtraFieldController().GetByModules(articleModuleId); foreach (ExtraFieldInfo o in lst.Where(o => o.Tag == tagname)) { extraFieldId = o.ItemID; break; } _extrafieldIds.Add(tagname + articleModuleId, extraFieldId); } extraFieldId = _extrafieldIds[tagname + articleModuleId]; if (extraFieldId != -1) { //Retrieve ExtraField value var oFieldValue = new FieldValueController().GetFieldValue(extraFieldId, articleId); if (oFieldValue != null) { return(oFieldValue.FieldValue); } } return(""); }
private void RefreshTableValues() { string indexName; lVTableValues.Items.Clear(); lVTableValues.Columns.Clear(); SelectedObject = _selectedTable; _tableType = _selectedTable.GetType(); var tableQuery = CreateTableQuery(out indexName); var extraFieldController = new ExtraFieldController(_selectedObject); if (!extraFieldController.Exists) { return; } var extraFieldsDictionary = extraFieldController.Fields; LoadListView(indexName, tableQuery, extraFieldsDictionary); foreach (var field in extraFieldsDictionary) { var text = new Label(); var control = ExtraField.GetControl(field.Value); text.AutoSize = true; text.Text = field.Key; text.Location = new Point(2, y); panelPropArea.Controls.Add(text); control.Size = new Size(150, 25); control.Location = new Point(x, y); panelPropArea.Controls.Add(control); y += difference; } }