IsTemporary : Boolean;
IsTemporary : boolean;
The IsTemporary property returns whether the temporary user account is correspondent.
Executing the example requires a form containing the Button component with the Button1 identifier.
Add links to the Metabase system assembly.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
User: IMetabaseUser;
Users: IMetabaseUsers;
Begin
MB := MetabaseClass.Active;
Users := MB.Security.Users;
User := Users.Item(0);
If User.IsTemporary = True Then
User.TemporaryAge := 10;
Else
Debug.Write("User is not temporary");
End If;
End Sub Button1OnClick;
After executing the example clicking the button checks whether the user with the 0 identifier is temporary. If user is temporary, the temporary period equal to 10 days using the IMetabaseUser.Temporary property is set. If user is not temporary, the console displays the message: User is not temporary.
The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.
Imports Prognoz.Platform.Interop.Metabase;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
MB: IMetabase;
User: IMetabaseUser;
Users: IMetabaseUsers;
Begin
MB := Self.Metabase;
Users := MB.Security.Users;
User := Users.Item[0];
If User.IsTemporary = True Then
User.TemporaryAge := 10;
Else
System.Diagnostics.Debug.Write("User is not temporary");
End If;
End Sub;
See also: