AccountQueryFilterRule Class

Represents a filter expression used when querying for accounts.
Inheritance Hierarchy
SystemObject
  Dundas.BI.UtilityQueryFilterRuleBase
    Dundas.BI.UtilityQueryFilterRuleAccountQueryField
      Dundas.BI.AccountServicesAccountQueryFilterRule

Namespace:  Dundas.BI.AccountServices
Assembly:  Dundas.BI.Core (in Dundas.BI.Core.dll) Version: 2.0.0.0 (24.1.0.1001)
Syntax
public class AccountQueryFilterRule : QueryFilterRule<AccountQueryField>

The AccountQueryFilterRule type exposes the following members.

Constructors
  NameDescription
Public methodAccountQueryFilterRule(AccountQueryField, QueryFilterOperator, Object)
Initializes a new instance of the AccountQueryFilterRule class.
Public methodAccountQueryFilterRule(AccountQueryField, QueryFilterOperator, Object, QueryFilterOptions)
Initializes a new instance of the AccountQueryFilterRule class.
Top
Properties
  NameDescription
Public propertyField
Gets the field on which the filter should be applied (left side of the filter expression).
(Inherited from QueryFilterRuleTFieldsEnum.)
Public propertyIsAccentSensitive
Gets a value indicating whether this column is accent sensitive.
(Inherited from QueryFilterRuleTFieldsEnum.)
Public propertyIsCaseSensitive
Gets a value indicating whether the filter should be case sensitive.
(Inherited from QueryFilterRuleBase.)
Public propertyIsOperatorInverted
Gets a value indicating whether a logical NOT should be applied to the filter expression.
(Inherited from QueryFilterRuleBase.)
Public propertyOperator
Gets the filter expression operator.
(Inherited from QueryFilterRuleBase.)
Public propertyOptions
Gets the query filter options.
(Inherited from QueryFilterRuleBase.)
Public propertyValue
Gets the value (right side of the filter expression).
(Inherited from QueryFilterRuleBase.)
Top
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