How to do this in c#

  • Thread starter Thread starter LamSoft
  • Start date Start date
L

LamSoft

For example, I have 3 textboxs, which allow users to input something and
compare with the system data.
Such as 1st textbox is to enter first name, second is to enter surname,
third one is to enter the sex(M/F).


Those are compared with "AND" case, which means if the user input sth into
the 1st textbox and didn't enter data into the 2nd and 3rd textbox, the
system will only use the 1st data and compare with against the first name
if the user input data in 1st and 2nd textbox, then the system will compare
the data with "AND" case, which means whether match the first name AND the
surname and vice versa.


I only know how to write those comparison in SQL format.... (in here, have
to use if then else to compare against and loop through hashtable),
if i use the stupid method (write all of the "if then else" occurence), it
is not efficient.

are there any other smarter methods?

Thanks
 
How about doing it in filter pattern?

You filter your data on first value.
If second value if present your filter results from first step using second
value or continue to next filter otherwise.
And so on.
 
Oh..yes
Thanks a lot.
AlexS said:
How about doing it in filter pattern?

You filter your data on first value.
If second value if present your filter results from first step using
second value or continue to next filter otherwise.
And so on.
 
Back
Top