So, I've been reading up on creating a n-tier application and understand some of the basics such as selecting, saving and deleting data via custom business objects.
All of the samples I have found so far select data using something similar to the following in the Business Logic Layer:
I've also seen various methods for selecting by an ID.
How do you select Products using an unknown number of parameters? On my web page I might have the following fields to help filter data on screen:
Sold To: <person name>
Sold Between: <fromdate> - <todate>
Would I have to create a method with 3 parameters or would I have my Presentation Layer build a search string and pass that to my DAL via the BLL? What happens if I add another set of paramters on screen such as:
Order Status: <dropdown>
There seem to be plenty of samples on the web for simple data selection, but not complex data selection. Or maybe I'm just not understanding something, probably the latter.
Any thoughts would be appreciated.
CT
All of the samples I have found so far select data using something similar to the following in the Business Logic Layer:
VB.NET:
Public Shared Function SelectAll() As List<Product>
SQLDataAccessLayer dal = SQLNew DataAccessLayer
Return dal.ProductSelectAll()
End Function
I've also seen various methods for selecting by an ID.
How do you select Products using an unknown number of parameters? On my web page I might have the following fields to help filter data on screen:
Sold To: <person name>
Sold Between: <fromdate> - <todate>
Would I have to create a method with 3 parameters or would I have my Presentation Layer build a search string and pass that to my DAL via the BLL? What happens if I add another set of paramters on screen such as:
Order Status: <dropdown>
There seem to be plenty of samples on the web for simple data selection, but not complex data selection. Or maybe I'm just not understanding something, probably the latter.
Any thoughts would be appreciated.
CT