/// <summary> /// Export site settings /// </summary> /// <param name="si"></param> /// <param name="model"></param> /// <param name="gridExportMode"></param> /// <returns></returns> public HSSFWorkbook Exports(JqSearchIn si, GridExportMode gridExportMode, SiteSettingSearchModel model) { var data = gridExportMode == GridExportMode.All ? GetAll() : SearchSettings(model); var siteSettings = Maps(data); var exportData = si.Export(siteSettings, gridExportMode); return(ExcelUtilities.CreateWorkBook(exportData)); }
/// <summary> /// Export site settings /// </summary> /// <param name="si"></param> /// <param name="model"></param> /// <param name="gridExportMode"></param> /// <returns></returns> public ActionResult Exports(JqSearchIn si, GridExportMode gridExportMode, SiteSettingSearchModel model) { var workbook = _siteSettingService.Exports(si, gridExportMode, model); var output = new MemoryStream(); workbook.Write(output); return(File(output.ToArray(), "application/vnd.ms-excel", "SiteSettings.xls")); }
/// <summary> /// Search site settings /// </summary> /// <param name="model"></param> /// <returns></returns> private IQueryable <SiteSetting> SearchSettings(SiteSettingSearchModel model) { if (model.SettingTypeNames == null) { model.SettingTypeNames = new List <string>(); } var data = Fetch(s => (string.IsNullOrEmpty(model.Keyword) || s.Name.ToLower().Contains(model.Keyword.ToLower()) || s.Value.ToLower().Contains(model.Keyword.ToLower())) && (!model.SettingTypeNames.Any() || model.SettingTypeNames.Contains(s.SettingType))); return(data); }
/// <summary> /// Search the site settings /// </summary> /// <param name="si"></param> /// <param name="model"></param> /// <returns></returns> public JqGridSearchOut SearchSiteSettings(JqSearchIn si, SiteSettingSearchModel model) { var data = SearchSettings(model); var siteSettings = Maps(data); return(si.Search(siteSettings)); //#region Column model options //model.ModelOptions = new List<ModelOptions>(); //var modelOption = new ModelOptions(GridColumnType.Select, "SettingTypeName", // _settingTypeService.GetSettingTypes(null, true)); //model.ModelOptions.Add(modelOption); //#endregion }
public string _AjaxBinding(JqSearchIn si, SiteSettingSearchModel model) { return(JsonConvert.SerializeObject(_siteSettingService.SearchSiteSettings(si, model))); }
public ActionResult Index() { var model = new SiteSettingSearchModel(); return(View(model)); }