how can i fuse this 2 If statment to make Both my Droplist filters working together so i have 2 droplists (transfilter and droplist Soortfilter) and i want to be able to slect someting out of droplist 1 and select othere thing out of droplist 2 and then press filter and it shows up the items that have beenslected by filtering with BOTH filters
@ this point i have Return View(query.ToList()) what only shows my filtert items from Droplist 1
Function Index(transFilter As TransactieType?, soortfilter As Soort?) As ActionResult
Dim query As IEnumerable(Of Pand)
If Not transFilter.HasValue OrElse transFilter.Value = TransactieType.Beiden Then
query = db.Panden
Else
query = db.Panden.Where(Function(p) p.TransactieType = transFilter.Value)
End If
If Not soortfilter.HasValue OrElse soortfilter.Value = Soort.All Then
query = db.Panden
Else
query = db.Panden.Where(Function(p) p.Soort = soortfilter.Value)
End If
Return View(query.ToList())
End Function
i was trying this but that didn't realy work
Function Index(transFilter As TransactieType?, soortfilter As Soort?) As ActionResult
Dim query As IEnumerable(Of Pand)
If Not transFilter.HasValue And soortfilter.HasValue OrElse transFilter.Value = TransactieType.Beiden And soortfilter.Value = Soort.All Then
query = db.Panden
Else
query = db.Panden.Where(Function(p) p.TransactieType = transFilter.Value And p.Soort = soortfilter.Value)
End If
Return View(query.ToList())
Aucun commentaire:
Enregistrer un commentaire