Filter Customer Module by Multiple Form Values (DatePicker, Yes/No & Like Search)
I created a custom module made up of about 6 fields. First Name, Last Name, Company, Gender, Active and Date of Birth. I would like to filter based on values submitted by a form but I'm not sure how to handle multiple values. I can get it to work if I hard code some values but I'm not sure who to do it dynamically. Plus how do you handle blank form values or date ranges. I would like to be able to search with a like value instead of equals and when it comes to date field, I'd like to be able to search by greater than and less than.
Type contactType = TypeResolutionService.ResolveType("Telerik.Sitefinity.DynamicTypes.Model.Contacts.Contact");
var myCollection = dynamicModuleManager.GetDataItems(contactType).Where("Active == true").Where(i => i.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && i.Visible == true);
//&& i.GetValue<
string
>("Company")==Company.Text
//&& i.GetValue<
string
>("Gender")==Gender.Text
return myCollection;