This kind of functionality should be handled at database level. What you can do is:
1) Pass all these fields as parameters to your stored procedure.
2) Create two temporary tables(PrimaryTable and SecondaryTable) with the columns you want to return.
3) Select all the records from your original table and fill the PrimaryTable with them.
Now comes the good part
4)
if @userid <> ''
BEGIN
truncate table SecondaryTable
insert into SecondaryTable
select * from PrimaryTable where userId = @userid
truncate table PrimaryTable
insert into PrimaryTable
select * from SecondaryTable
truncate table SecondaryTable
END
--Repeat till you have non-blank parameters.
This is just a sample. The idea is to return all the rows without any condition then based on each non-blank parameter, The records are selected from PrimaryTable to SecondaryTable, Empty PrimaryTable and Replace the records with filtered records, Empty the SecondaryTable. This whole process goes on for all the parameters. In the end return PrimaryTable.
Give it a try and tell if it is of any use for you?