AccountQueryFilterRule Class |
Namespace: Dundas.BI.AccountServices
The AccountQueryFilterRule type exposes the following members.
Name | Description | |
---|---|---|
AccountQueryFilterRule(AccountQueryField, QueryFilterOperator, Object) |
Initializes a new instance of the AccountQueryFilterRule class.
| |
AccountQueryFilterRule(AccountQueryField, QueryFilterOperator, Object, QueryFilterOptions) |
Initializes a new instance of the AccountQueryFilterRule class.
|
Name | Description | |
---|---|---|
Field | Gets the field on which the filter should be applied (left side of the filter expression). (Inherited from QueryFilterRuleTFieldsEnum.) | |
IsAccentSensitive |
Gets a value indicating whether this column is accent sensitive.
(Inherited from QueryFilterRuleTFieldsEnum.) | |
IsCaseSensitive | Gets a value indicating whether the filter should be case sensitive. (Inherited from QueryFilterRuleBase.) | |
IsOperatorInverted | Gets a value indicating whether a logical NOT should be applied to the filter expression. (Inherited from QueryFilterRuleBase.) | |
Operator | Gets the filter expression operator. (Inherited from QueryFilterRuleBase.) | |
Options | Gets the query filter options. (Inherited from QueryFilterRuleBase.) | |
Value | Gets the value (right side of the filter expression). (Inherited from QueryFilterRuleBase.) |
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(); }