public BsJsonResult Search(ContributorSearchModel model) { var settings = new BsEditorRepositorySettings <YesNoValueTypes> { Search = model, TabId = YesNoValueTypes.Yes }; var count = 0; var html = this.RenderTab(settings, out count); return(new BsJsonResult(new { Count = count, Html = html })); }
public BsJsonResult Search(ContributorSearchModel model, ContributorType tabId) { var settings = new BsEditorRepositorySettings <ContributorType> { Search = model, TabId = tabId }; var count = 0; var html = this.RenderTab(settings, out count); return(new BsJsonResult(new { Count = count, Html = html })); }
public ContributorSearchModel GetSearchForm(ContributorSearchModel stateModel) { var model = new ContributorSearchModel(); model.IsEnabled = new BsSelectList <YesNoValueTypes?>(); model.IsEnabled.ItemsFromEnum(typeof(YesNoValueTypes)); model.RoleList = new BsSelectList <ProjectRole?>(); model.RoleList.ItemsFromEnum(typeof(ProjectRole)); model.CountriesList = Lists.AllCountries <string>(false); model.LanguagesList = Lists.AllLanguages <List <string> >(); if (stateModel != null) { if (stateModel.Name != null) { model.Name = stateModel.Name; } if (stateModel.IsEnabled != null && stateModel.IsEnabled.SelectedValues.HasValue) { model.IsEnabled.SelectedValues = stateModel.IsEnabled.SelectedValues; } else { model.IsEnabled.SelectedValues = YesNoValueTypes.Both; } if (stateModel.RoleList != null && stateModel.RoleList.SelectedValues.HasValue) { model.RoleList.SelectedValues = stateModel.RoleList.SelectedValues; } if (stateModel.CountriesList != null && stateModel.CountriesList.SelectedValues != null) { model.CountriesList.SelectedValues = stateModel.CountriesList.SelectedValues; } if (stateModel.LanguagesList != null && stateModel.LanguagesList.SelectedValues != null) { model.LanguagesList.SelectedValues = stateModel.LanguagesList.SelectedValues; } } if (model.StartDateRange == null) { model.StartDateRange = new BsRange <DateTime?>() { From = new BsRangeItem <DateTime?> { ItemValue = new DateTime(2013, 8, 1) }, To = new BsRangeItem <DateTime?> { ItemValue = DateTime.Now } }; } if (model.AgeRange == null) { model.AgeRange = new BsRange <int?> { From = new BsRangeItem <int?> { ItemValue = 14, MinValue = 10, TextValue = "14", Display = "Start" }, To = new BsRangeItem <int?> { ItemValue = 32, MaxValue = 100, TextValue = "32", Display = "End" }, TextValue = "18 - 21" }; } return(model); }
public BsJsonResult Search(ContributorSearchModel model, ContributorType tabId) { var settings = new BsEditorRepositorySettings<ContributorType> { Search = model, TabId = tabId }; var count = 0; var html = this.RenderTab(settings, out count); return new BsJsonResult(new { Count = count, Html = html }); }