Here is an even cleaner way to do it. I created a class called EmployerQO which stands for Employer Query Object.
It looks like this.
public class EmployerQO
{
private string _employerName = string.Empty;
private string _employerNo = string.Empty;
private string _status = string.Empty;
private string _office = string.Empty;
.... create properties (get/set) for each.
}
in my view class after the user fills in the search parameters and then clicks the find button, I call a method called RetrieveFilterFields which creates an EmployerQO object and then looks at each query field and builds the query object. I then call the following myController.GetEmployers(qo) passing it the query object.
In my controller call I build an RdbQuery object and then for each non empty field in the EmployerQO object I do a
query.AddClause(). I call GetEntities passing it the query object.
There may be better ways of doing this, but it seems to work for me.
Bill