UpdateSequence(Options: RdsUpdateSequenceOptions);
UpdateSequence(Options: Prognoz.Platform.Interop.Rds.RdsUpdateSequenceOptions);
Options. Shift type.
The UpdateSequence method updates sequence.
Use the IRdsDictionary.Open method to open an MDM dictionary.
Executing the example requires:
An MDM repository with the OBJ_RDS identifier containing an MDM dictionary with the T_SOURCE_RDS identifier.
A form containing the Button component with the Button1 identifier.
The example is a handler of the OnClick event for the Button1 component. Add links to the Metabase, Rds system assemblies.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Mb: IMetabase;
iRdsDatabaseKey: Integer;
pDict: IRdsDictionary;
pDictInst: IRdsDictionaryInstance;
pData: IRdsDictionaryElementData;
Begin
Mb := MetabaseClass.Active;
iRdsDatabaseKey := Mb.GetObjectKeyById("OBJ_RDS");
pDict := Mb.ItemByIdNamespace("T_SOURSE_RDS", iRdsDatabaseKey).Edit As IRdsDictionary;
pDict.Attributes.Order.Hidden := False;
(pDict As IMetabaseObject).Save;
pDictInst := pDict.Open(Null);
pDictInst.ClearData;
pData := pDictInst.CreateElementData;
pData.Value(1) := "1";
pDictInst.Insert(-2, pData);
pData := pDictInst.CreateElementData;
pData.Value(1) := "2";
pDictInst.Insert(-2, pData);
pDict.IsBigDictionary := True;
pDict.UpdateSequence(RdsUpdateSequenceOptions.Key Or RdsUpdateSequenceOptions.Order);
(pDict As IMetabaseObject).Save;
pDictInst := pDict.Open(Null);
pData.Value(1) := "3";
pDictInst.Insert(-2, pData);
pData.Value(1) := "4";
pDictInst.Insert(-2, pData);
pDict.IsBigDictionary := False;
(pDict As IMetabaseObject).Save;
Mb.DeleteObject((pDict As IMetabaseObject).Key);
End Sub Button1OnClick;
After executing the example MDM dictionary sequence is updated.
Executing the example requires:
An MDM repository with the OBJ_RDS identifier containing an MDM dictionary with the T_SOURCE_RDS identifier.
A form containing the Button component with the button1 identifier.
This example is a handler of the Click event for the button1 component. Add a link to the Rds system assembly.
Imports Prognoz.Platform.Interop.Rds;
…
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
Mb: IMetabase;
iRdsDatabaseKey, parent: uinteger;
pDict: IRdsDictionary;
pDictInst: IRdsDictionaryInstance;
pData: IRdsDictionaryElementData;
Begin
Mb := self.Metabase;
iRdsDatabaseKey := Mb.GetObjectKeyById("OBJ_RDS");
pDict := Mb.ItemByIdNamespace["T_SOURSE_RDS", iRdsDatabaseKey].Edit() As IRdsDictionary;
pDict.Attributes.Order.Hidden := False;
(pDict As IMetabaseObject).Save();
pDictInst := pDict.Open(Null);
pDictInst.ClearData(True);
pData := pDictInst.CreateElementData();
pData.Value[1] := "1";
parent := -2 As uinteger;
pDictInst.Insert(parent, pData);
pData := pDictInst.CreateElementData();
pData.Value[1] := "2";
pDictInst.Insert(parent, pData);
pDict.IsBigDictionary := True;
pDict.UpdateSequence(RdsUpdateSequenceOptions.rusoKey Or RdsUpdateSequenceOptions.rusoOrder);
(pDict As IMetabaseObject).Save();
pDictInst := pDict.Open(Null);
pData.Value[1] := "3";
pDictInst.Insert(parent, pData);
pData.Value[1] := "4";
pDictInst.Insert(parent, pData);
pDict.IsBigDictionary := False;
(pDict As IMetabaseObject).Save();
Mb.DeleteObject((pDict As IMetabaseObject).Key);
End Sub;
The result of the Fore.NET Example execution matches with that in the Fore Example.
See also:
Related work items