AccountQueryField Enumeration |
Namespace: Dundas.BI.AccountServices
Member name | Value | Description | |
---|---|---|---|
None | 0 | No field specified. | |
Id | 1 | The Id property. | |
Name | 2 | The Name property. | |
CreatedTime | 3 | The CreatedTime property. | |
TenantId | 4 | Obsolete. The TenantId property. | |
AccountType | 5 | The AccountType property. | |
DisplayName | 6 | The DisplayName property. | |
EmailAddress | 7 | The EmailAddress property. | |
LastLogOnTime | 8 | The LastLogOnTime property. | |
LogOnCount | 9 | The LogOnCount property. | |
IsEnabled | 10 | The IsEnabled property. | |
CultureName | 11 | The Culture property. | |
TimeZoneId | 12 | The TimeZone property. | |
SeatKind | 13 | The SeatKind property. | |
IsSeatReserved | 14 | The IsSeatReserved property. | |
TrackLogOnHistory | 15 | The TrackLogOnHistory property. | |
AccountExpiryDate | 16 | The AccountExpiryDate property. | |
PasswordExpiryDate | 17 | The PasswordExpiryDate property. | |
PasswordNeverExpires | 18 | The PasswordNeverExpires property. | |
PasswordLastSetDate | 19 | The PasswordLastSetDate property. | |
IsApiAccount | 20 | The IsApiAccount property. | |
Description | 21 | The Description property. | |
CustomAttributes | 22 | The CustomAttributes property. | |
TenantIds | 23 | The TenantIds property. | |
ActiveTenantId | 24 | The ActiveTenantId property. | |
IsGlobal | 25 | The IsGlobal property. | |
ExternalId | 26 | The ExternalId property. | |
DataDiscoveryId | 27 | The DataDiscoveryId property. |
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.
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(); }