AccountQueryField Enumeration

Properties that can be used to query for accounts.

Namespace:  Dundas.BI.AccountServices
Assembly:  Dundas.BI.Core (in Dundas.BI.Core.dll) Version: 2.0.0.0 (24.4.0.1000)
Syntax
public enum AccountQueryField
Members
  Member nameValueDescription
None0No field specified.
Id1The Id property.
Name2The Name property.
CreatedTime3The CreatedTime property.
TenantId4 Obsolete. The TenantId property.
AccountType5The AccountType property.
DisplayName6The DisplayName property.
EmailAddress7The EmailAddress property.
LastLogOnTime8The LastLogOnTime property.
LogOnCount9The LogOnCount property.
IsEnabled10The IsEnabled property.
CultureName11The Culture property.
TimeZoneId12The TimeZone property.
SeatKind13The SeatKind property.
IsSeatReserved14The IsSeatReserved property.
TrackLogOnHistory15The TrackLogOnHistory property.
AccountExpiryDate16The AccountExpiryDate property.
PasswordExpiryDate17The PasswordExpiryDate property.
PasswordNeverExpires18The PasswordNeverExpires property.
PasswordLastSetDate19The PasswordLastSetDate property.
IsApiAccount20The IsApiAccount property.
Description21The Description property.
CustomAttributes22The CustomAttributes property.
TenantIds23The TenantIds property.
ActiveTenantId24The ActiveTenantId property.
IsGlobal25The IsGlobal property.
ExternalId26The ExternalId property.
DataDiscoveryId27The DataDiscoveryId property.
Examples

This example demonstrates how to create the Dundas BI engine, start the Dundas BI engine, log on, queries accounts that start with the letter 'A', and then shutdown the Dundas BI engine.

C#
using Dundas.BI;
using Dundas.BI.AccountServices;
using Dundas.BI.Services;
using System.Collections.ObjectModel;
   ...

// Create the engine.
EngineManager.CreateEngine(
    // Path to the application's data folder. Type: System.String
    @"C:\Program Files\Dundas Data Visualization Inc\Dundas BI\Instances\Instance1\www\BIWebsite\App_Data"
);

try
{
    // Start the Dundas BI Engine.
    EngineManager.StartEngine();

    // Create a caller context not associated with any session.
    using(Engine.Current.GetService<ICallerContextService>().CreateAndSetCurrentContext(null))
    {

        // LogOn.
        LogOnResult logOnResult = Engine.Current.GetService<ILogOnService>().LogOn(
            // The account name. Type: System.String
            "admin",
            // The password. Type: System.String
            "1234",
            // Delete other sessions for the logon to succeed. Type: System.Boolean
            true,
            // Culture to associate with the session, or null. Type: System.Globalization.CultureInfo
            null
        );

        // Set the current session ID.
        using(Engine.Current.GetService<ICallerContextService>().CurrentContext.SetCurrentSessionId(
            logOnResult.Session.Id
        );

        // Get the account service.
        IAccountService accountService =
            Engine.Current.GetService<IAccountService>();

        // Order by name descending.
        var orderQueryBy = 
            new List<Tuple<AccountQueryField, SortDirection>>() {
                new Tuple<AccountQueryField, SortDirection>(AccountQueryField.Name, SortDirection.Descending)
            };

        // Get the accounts that start with the letter 'a'.
        var rules = new List<AccountQueryFilterRule>();
           rules.Add(
               new AccountQueryFilterRule(
                AccountQueryField.Name, 
                QueryFilterOperator.StartsWith, 
                "a"
                )
            );

        // Get the accounts.  
        var accounts = 
            accountService.AccountQuery(
                // The first page.
                1,
                // Get maximum ten entries during query.
                10,
                // pass the order by.
                orderQueryBy,
                // pass the query rules.
                rules
            );

        // Write the account names to the console.
        foreach(var account in accounts)
        {
            Console.WriteLine(account.Name);
        }
    }
}
finally
{
    EngineManager.ShutdownEngine();
}
See Also