Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Design Question Business Logic
Message
From
14/10/2004 16:46:23
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00951532
Message ID:
00951547
Views:
5
Shawn,

That's a tough one ... because there are many different ways you can do this.

As far as how to pass the parameters to a Biz object, I would use a DataSet rather than pass individual parameters and then there's only one method to code. It's more flexible that way. You could have a SearchCriteriaDataSet that contains a table with something like ColumnName, ColumnText, ColumnNumber, ColumnDate for columns. Then, each row in the table corresponds to another part of your where clause.

As far as building the Where clause, I've done it both ways ... building it in the Biz class *or* passing parameters to a Stored Proc. It depends on how generic it needs to be, I think.

~~Bonnie



>Okay, I have a form that has a search capability for three fields
>
>Customer First Name, Customer Last Name, Customer ID
>
>The data resides in SQl Server
>
>I am using a Like command with % on Each side of the text passed across.
>
>How would you write the method to use build a SQL including all or one of the fields.
>
>Would you pass across all fields and then in the business logic determine which method to call,
>or would you build an if structure to concat a series of strings to dynamically make the where clause.
>
>Would it be a series of methods with different parameters
>
>public DataSet GetCustomers()
>public DataSet GetCustomers(string custid)
>public DataSet GetCustomers(string custID, string firstname)
>public DataSet GetCustomers(string custid, string firstname, string lastname)
>
>I can't create nay more because the pattern would not be unique, the other members would be "string, string" so C# would complain.
>
>Or would I create
>GetCustomers_ID()
>GetCustomers_ID_Lastname()
>GetCustomers_ID_firstname()
>GetCustomers_lastname()
>GetCustomers_firstname()
>GetCustomers_lastname_firstname()
>
>Ideas!!!!!!
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform