ShowHoursPolicy Command

Purpose

Opens a standard dialog box that is used to distribute system access time for the user.

Parameters of Use

Command parameters are passed in the Data property. Executing the command requires to specify the following value in this property:

Value type Description
IMetabaseUser User for whom it is necessary to set up access time permissions.

Application Features

None

Example

Executing the example requires a form and a button named Button1 on the form.

    Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
    Var
        Mb: IMetabase;
        MbSec: IMetabaseSecurity;
        User: IMetabaseUser;
        Target: IUiCommandTarget;
        Context: IUiCommandExecutionContext;
    Begin
        MB := MetabaseClass.Active;
        MbSec := MB.Security;
        User := MbSec.Users.Item(MbSec.Users.Count - 1);
        Target := WinApplication.Instance.GetPluginTarget("Adm");
        Context := Target.CreateExecutionContext;
        Context.Data := User;
        Target.Execute("ShowHoursPolicy", Context);
    End Sub Button1OnClick;

Clicking the button opens a dialog box that is used to distribute time of system access for the last user registered in the security manager.

See also:

IUiCommandTarget.Execute