public static bool LoadSearch(String searchType, params Panel[] panels) { if (HttpContext.Current.Request.QueryString["searchId"] != null) { var searchHistoryID = HttpContext.Current.Request.QueryString["searchId"].ToString(); int searchQueryID; int.TryParse(searchHistoryID, out searchQueryID); var searchEntry = Bso.Archive.BusObj.BsoArchiveEntities.Current.Searches.FirstOrDefault(s => s.SearchID == searchQueryID && s.SearchType == searchType); if (searchEntry != null) { StringDictionary dictionary = SearchEntryToDictionary(searchEntry); foreach (var panel in panels) { FormHelpers.LoadFormItems(dictionary, panel); //LoadDropDowns(searchType, panel, dictionary); } } return(true); } return(false); }
private String SaveSearchHistory(string searchType, Panel[] panels) { StringDictionary dictionary = new StringDictionary(); foreach (var panel in panels) { FormHelpers.SaveFormItems(dictionary, panel); } var basicSearchParameters = DictionaryToString(dictionary); var search = Bso.Archive.BusObj.Search.AddSearchEntry(basicSearchParameters, searchType); if (search.IsNew) { BsoArchiveEntities.Current.Save(); } SessionContext.Current.LastSearchID = search.SearchID; AddCookie(search.SearchID); return(basicSearchParameters); }