Condition: IDimOrmCondition;
Condition: Prognoz.Platform.Interop.Dimensions.IDimOrmCondition;
The Condition property returns the collection of search conditions.
Executing the example requires a form with the Button1 button, the RdsDictionaryBox component named RdsDictionaryBox1, and the UiRdsDictionary component that is a data source for RdsDictionaryBox1. The MDM dictionary that is connected to the UiRdsDictionary component has the attributes Name and UserAttr.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
RdsInst: IRdsDictionaryInstance;
Search: IRdsDictionaryElementsSearch;
Cond: IDimOrmCondition;
Crit: IDimTextCriteria;
Elems: IRdsDictionaryElements;
Elem: IRdsDictionaryElement;
i: Integer;
Begin
RdsInst := RdsDictionaryBox1.Source.Instance;
Search := RdsInst.CreateSearch;
Search.Attributes.Attributes := "Name;UserAttr";
Crit := New DimTextCriteria.Create;
Crit.CriteriaOptions := TextCriteriaOptions.SearchStringAttributes
Or TextCriteriaOptions.FreeText;
Crit.Text := Income of the population;
Cond := Search.Condition;
Cond.SetTextCriteria(Crit);
Elems := RdsInst.Elements;
For i := 0 To Elems.Count - 1 Do
Elem := Elems.Item(i);
Debug.WriteLine(Elem.Name + : It meets search conditions - +
Cond.EvaluateRec(Elem.Record).ToString);
End For;
End Sub Button1OnClick;
After executing the example, pressing the button creates an object for searching MDM dictionary elements. The condition, according to which search should be executed, is set. Then all elements are checked against search conditions. Names of elements and result of check are displayed in the development environment console.
Executing the example requires a .NET form, a button named Button1 positioned on this form, the RdsDictionaryBoxNet component named RdsDictionaryBoxNet1 and the UiRdsDictionaryNet component used as data source for RdsDictionaryBoxNet1, and the TextBox component named TextBox1. The MDM dictionary that is connected to the UiRdsDictionaryNet component has the attributes Name and UserAttr.
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
RdsInst: IRdsDictionaryInstance;
Search: IRdsDictionaryElementsSearch;
Cond: IDimOrmCondition;
Crit: DimTextCriteria;
Elems: IRdsDictionaryElements;
Elem: IRdsDictionaryElement;
i: Integer;
ElemList: List <string>;
Begin
RdsInst := RdsDictionaryBoxNet1.Source.Instance;
Search := RdsInst.CreateSearch();
Search.Attributes.Attributes := "Name;UserAttr";
Crit := New DimTextCriteria();
Crit.CriteriaOptions := TextCriteriaOptions.tecropSearchStringAttributes
Or TextCriteriaOptions.tecropFreeText;
Crit.Text := Income of the population;
Cond := Search.Condition;
Cond.SetTextCriteria(Crit);
Elems := RdsInst.Elements;
ElemList := New List <string>();
For i := 0 To Elems.Count - 1 Do
Elem := Elems.Item[i];
ElemList.Add(Elem.Name + : It meets search conditions - +
Cond.EvaluateRec(Elem.Record).ToString());
End For;
TextBox1.Lines := ElemList.ToArray();
End Sub;
After executing the example, pressing the button creates an object for searching MDM dictionary elements. The condition, according to which search should be executed, is set. Then all elements are checked against search conditions. Names of elements and result of check are displayed in the TextBox1 component.
See also: