asp.net 2.0
llblgenpro 2
adapterTemplate
hiya,
I have a "search" textBox where a user can enter search values.
These values then become predicates in my code behind.
filter.AddWithOr(JobFields.jobDescription== txtSearch.Text);
Good so far.
However, I still don't know how to do it with lookups,
eg, what happens if the user wants to enter a job category of "delivery"?
This value obviously represents a lookup value:
tblJob
jobId (PK)
jobDescription
jobCategoryId (FK)
tblJobCategory
jobCategoryId (PK)
jobCategoryName
Let's say for arguments sake that:
1) my app is set up to search on word fragments.
2) the user enters "del"
The query will now go to the tblJobCategory and find 2 job category Id's:
jobCategoryId = 1
jobCategoryName ="delivery"
jobCategoryId = 2
jobCategoryName ="delete"
How would I add them both to my filter??
Would I create an filter factory that:
1) takes the filter + searchText as args
2) populates an entityCollection based on the searchText arg
3) loops thru this entityCollection and populates the filter with valid predicates
4) returns the filter as a function return value
I hope the above makes sense.
Any help appreciated.
many thanks,
yogi