I am trying to duplicate a Query-by-Example capability in an existing application that I am porting to CSLA.
The current application has a toolbar button that when pressed puts an operator button next to each textbox and combobox on the form. The user can click the operator button to toggle between the following operator choices.
None, Equal, Not Equal, Less Than, Less Than or Equal, Greater than, Greater Than or Equal, Like, Not Like.
The buttons all start out set as None and then toggle through the other choices each time it is clicked.
The user is free to enter selection criteria in any combination of fields on the form and have any field’s operator set to any of the states listed above. So For example the following criteria to find All employees that started before 1/1/2000 that live in CA and are 65 or over:
“Start Date: 1/1/2000” with operator of <
“State: CA” with operator of =
“Age: 65” with operator of >=
So my question is with regards to CSLA would this be implemented by creating a Criteria class that includes all of the fields in the BO or is there a better way? Also, I didn’t see any example of the Criteria class providing an operator for each of its fields. For example if criteria contained Age am I only able to filter for just one age or can I say I want return all records with an age above a specified age.
If anyone here has implemented similar functionality can you gives some information on how you have implemented this. I didn’t see this covered in the book, did I miss it?
Thanks
I am trying to duplicate a Query-by-Example capability in an
existing application that I am porting to CSLA.
The current application has a toolbar button that when
pressed puts an operator button next to each textbox and combobox on the
form. The user can click the operator button to toggle
between the following operator choices.
None, Equal, Not Equal, Less Than, Less Than or Equal,
Greater than, Greater Than or Equal, Like, Not Like.
The buttons all start out set as None and then toggle through
the other choices each time it is clicked.
The user is free to enter selection criteria in any
combination of fields on the form and have any fieldbs operator set to any of
the states listed above. So For example the following
criteria to find All employees that started before 1/1/2000
that live in CA and are 65 or over:
bStart Date: 1/1/2000b with operator of
<
bState: CAb with operator of =
bAge: 65b with operator of >=
So my question is with regards to CSLA would this be
implemented by creating a Criteria class that includes all of the fields in the
BO or is there a better way? Also, I didnbt see any example
of the Criteria class providing an operator for each of its fields. For example
if criteria contained Age am I only able to filter for just one age or can I say
I want return all records with an age above a specified age.
If anyone here has implemented similar functionality can you
gives some information on how you have implemented this. I
didnbt see this covered in the book, did I miss it?
Thanks
Copyright (c) Marimer LLC