SaveChangesToModels;
The SaveChangesToModels method saves changes in indicator data obtained from a modeling container model to the source model.
Executing the example requires a form with the following components: the Button components named Button1 and Button2, the TabSheetBox component named TabSheetBox1, and the UiErAnalyzer component named UiErAnalyzer1. UiErAnalyzer1 is a data source for TabSheetBox1. A working area of the time series database must be loaded to UiErAnalyzer1. Modeling container of the database must include a model with the OBJ_MODEL identifier based on database indicators.
Add links to the Cubes, Express, ExtCtrls, Forms, Laner, Metabase, Ms, and Tab system assemblies.
The example is executed in two steps:
Clicking the Button1 button opens the data table in the edit mode and loads the indicators data from the model to the table.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
ErAn: IEaxAnalyzer;
Laner: ILaner;
Ruby: IRubricator;
ActiveMetabase: IMetabase;
Cont: IMetabaseObjectDescriptor;
Model: IMsModel;
Begin
ActiveMetabase := MetabaseClass.Active;
ErAn := UiErAnalyzer1.ErAnalyzer;
Laner := ErAn.Laner;
Ruby := Laner.RubricatorInstance.Rubricator;
Cont := Ruby.ModelSpace;
Model := ActiveMetabase.FetchItemById("OBJ_MODEL", Cont.Key).Edit As IMsModel;
Model.RestoreLaner(Laner, Null);
TabSheetBox1.Source.GetTabSheet.Table.Style.Locked := TriState.OffOption;
End Sub Button1OnClick;
After executing the example the data can be modified.
Clicking the Button2 button saves modified indicator data to the model.
Sub Button2OnClick(Sender: Object; Args: IMouseEventArgs);
Var
ErAn: IEaxAnalyzer;
Laner: ILaner;
Begin
ErAn := UiErAnalyzer1.ErAnalyzer;
Laner := ErAn.Laner;
Laner.SaveChangesToModels;
End Sub Button2OnClick;
After executing the example the changed indicator data is saved to the model of the modeling container.
See also: