C# Class Habanero.BO.BusinessObjectLookupList

Provides a lookup-list sourced from business object collections. A lookup-list is typically used to populate features like a ComboBox, where the string would be displayed, but the Guid would be the value stored (for reasons of data integrity). The string-Guid pair collection will be created using each object's ToString() function and the object's Guid ID.
NB: this class does not provide criteria, so the entire collection will be loaded.
Inheritance: IBusinessObjectLookupList
Datei anzeigen Open project: Chillisoft/habanero Class Usage Examples

Private Properties

Property Type Description
AddBusinessObjectToLookupList void
CacheHasNotTimedOut bool
CreateValueList ICollection
FillKeyValueDictionary void
GetAvailableDisplayValue string
GetValueCollection ICollection

Public Methods

Method Description
BusinessObjectLookupList ( Type boType, int timeout = 10000 ) : System

Constructor to initialise a new lookup-list

BusinessObjectLookupList ( Type type, string criteria, string sort, bool limitToList ) : System

Constructor to initialise a new lookup-list

BusinessObjectLookupList ( string assemblyName, string className, int timeout = 10000 ) : System

Constructor to initialise a new lookup-list

BusinessObjectLookupList ( string assemblyName, string className, string criteria, string sort ) : System

Constructor to initialise a new lookup-list

BusinessObjectLookupList ( string assemblyName, string className, string criteria, string sort, bool limitToList ) : System

Constructor to initialise a new lookup-list

BusinessObjectLookupList ( string assemblyName, string className, string criteria, string sort, int timeout ) : System

Constructor to initialise a new lookup-list

CreateDisplayValueDictionary ( IBusinessObjectCollection col, bool sortByDisplayValue ) : string>.Dictionary

Returns a collection of string Guid pairs from the business object collection provided. Each pair consists of a string version of a business object and the object's ID.

CreateDisplayValueDictionary ( IBusinessObjectCollection col, bool sortByDisplayValue, ConvertPrimaryKeyGetAsValueToString coverter ) : string>.Dictionary

Returns a collection of string Guid pairs from the business object collection provided. Each pair consists of a string version of a business object and the object's ID.

GetBusinessObjectCollection ( ) : IBusinessObjectCollection

Returns a collection of related business objects for a particular property based on the definition of the business object lookup list. This returns the same set of data as returned by the GetLookupList() method.

GetIDValueLookupList ( ) : string>.Dictionary

Returns the lookup list contents being held where the list is keyed on the list key either a Guid, int or Business object i.e. the value being stored for the property. The display value can be looked up.

GetLookupList ( ) : string>.Dictionary

Returns a lookup-list for all the business objects stored under the class definition held in this instance

GetLookupList ( IDatabaseConnection connection ) : string>.Dictionary

Returns a lookup-list for all the business objects stored under the class definition held in this instance, using the database connection provided

GetLookupList ( bool ignoreTimeout ) : string>.Dictionary

Returns a lookup-list for all the business objects stored under the class definition held in this instance. An option is included to ignore the default timeout, which causes use of a cached version within the timeout period.

Private Methods

Method Description
AddBusinessObjectToLookupList ( string>.IDictionary lookupList, string objectID, string stringValue ) : void
CacheHasNotTimedOut ( ) : bool
CreateValueList ( IBusinessObjectCollection col ) : ICollection

Populates a collection with a string version of each business object in the collection provided

FillKeyValueDictionary ( ) : void
GetAvailableDisplayValue ( string>.IDictionary sortedLookupList, string stringValue ) : string

Returns a unique display value for an item of the given name, so that it can be added to the list without the risk of having duplicate entries.

GetValueCollection ( ) : ICollection

Method Details

BusinessObjectLookupList() public method

Constructor to initialise a new lookup-list
public BusinessObjectLookupList ( Type boType, int timeout = 10000 ) : System
boType System.Type The business object type
timeout int The period after which the cache expires
return System

BusinessObjectLookupList() public method

Constructor to initialise a new lookup-list
public BusinessObjectLookupList ( Type type, string criteria, string sort, bool limitToList ) : System
type System.Type The type of business object that the lookup list is being loaded for
criteria string Sql criteria to apply on loading of the /// collection
sort string The property to sort on. /// The possible formats are: "property", "property asc", /// "property desc" and "property des".
limitToList bool The specification of whether to create a validating lookup or not.
return System

BusinessObjectLookupList() public method

Constructor to initialise a new lookup-list
public BusinessObjectLookupList ( string assemblyName, string className, int timeout = 10000 ) : System
assemblyName string The assembly containing the class
className string The class from which to load the values
timeout int The time period in milliseconds after which the cache expires
return System

BusinessObjectLookupList() public method

Constructor to initialise a new lookup-list
public BusinessObjectLookupList ( string assemblyName, string className, string criteria, string sort ) : System
assemblyName string The assembly containing the class
className string The class from which to load the values
criteria string Sql criteria to apply on loading of the /// collection
sort string The property to sort on. /// The possible formats are: "property", "property asc", /// "property desc" and "property des".
return System

BusinessObjectLookupList() public method

Constructor to initialise a new lookup-list
public BusinessObjectLookupList ( string assemblyName, string className, string criteria, string sort, bool limitToList ) : System
assemblyName string The assembly containing the class
className string The class from which to load the values
criteria string Sql criteria to apply on loading of the /// collection
sort string The property to sort on. /// The possible formats are: "property", "property asc", /// "property desc" and "property des".
limitToList bool The specification of whether to create a validating lookup or not.
return System

BusinessObjectLookupList() public method

Constructor to initialise a new lookup-list
public BusinessObjectLookupList ( string assemblyName, string className, string criteria, string sort, int timeout ) : System
assemblyName string The assembly containing the class
className string The class from which to load the values
criteria string Sql criteria to apply on loading of the /// collection
sort string The property to sort on. /// The possible formats are: "property", "property asc", /// "property desc" and "property des".
timeout int the timeout period in milliseconds. This is the period that the lookup list will cached (i.e will not be reloaded from the database between successive calls)
return System

CreateDisplayValueDictionary() public method

Returns a collection of string Guid pairs from the business object collection provided. Each pair consists of a string version of a business object and the object's ID.
public CreateDisplayValueDictionary ( IBusinessObjectCollection col, bool sortByDisplayValue ) : string>.Dictionary
col IBusinessObjectCollection The business object collection
sortByDisplayValue bool Must the collection be sorted by the display value or not
return string>.Dictionary

CreateDisplayValueDictionary() public static method

Returns a collection of string Guid pairs from the business object collection provided. Each pair consists of a string version of a business object and the object's ID.
public static CreateDisplayValueDictionary ( IBusinessObjectCollection col, bool sortByDisplayValue, ConvertPrimaryKeyGetAsValueToString coverter ) : string>.Dictionary
col IBusinessObjectCollection The business object collection
sortByDisplayValue bool Must the collection be sorted by the display value or not
coverter ConvertPrimaryKeyGetAsValueToString The delegated converter that converts a primary key to the appropriate string
return string>.Dictionary

GetBusinessObjectCollection() public method

Returns a collection of related business objects for a particular property based on the definition of the business object lookup list. This returns the same set of data as returned by the GetLookupList() method.
public GetBusinessObjectCollection ( ) : IBusinessObjectCollection
return IBusinessObjectCollection

GetIDValueLookupList() public method

Returns the lookup list contents being held where the list is keyed on the list key either a Guid, int or Business object i.e. the value being stored for the property. The display value can be looked up.
public GetIDValueLookupList ( ) : string>.Dictionary
return string>.Dictionary

GetLookupList() public method

Returns a lookup-list for all the business objects stored under the class definition held in this instance
public GetLookupList ( ) : string>.Dictionary
return string>.Dictionary

GetLookupList() public method

Returns a lookup-list for all the business objects stored under the class definition held in this instance, using the database connection provided
public GetLookupList ( IDatabaseConnection connection ) : string>.Dictionary
connection IDatabaseConnection The database connection
return string>.Dictionary

GetLookupList() public method

Returns a lookup-list for all the business objects stored under the class definition held in this instance. An option is included to ignore the default timeout, which causes use of a cached version within the timeout period.
public GetLookupList ( bool ignoreTimeout ) : string>.Dictionary
ignoreTimeout bool Whether to ignore the timeout and reload from the database regardless of when the lookup list was last loaded.
return string>.Dictionary