/// <summary> /// Retrieves the current search values from session or request. /// </summary> public void GetSearchValue() { bool isClearing = HttpContext.Current.Request.Form["clearSearch"] == "1"; if (!isClearing) { if (!String.IsNullOrEmpty(HttpContext.Current.Request.Form["data_" + IdData])) { SessionHandler.AddToSessionVars("data_" + IdData, HttpContext.Current.Request.Form["data_" + IdData]); } if (!String.IsNullOrEmpty(HttpContext.Current.Request.Form["data_" + IdData + "_aux"])) { SessionHandler.AddToSessionVars("data_" + IdData + "_aux", HttpContext.Current.Request.Form["data_" + IdData + "_aux"]); } try { SearchValue = SessionHandler.SessionVars["data_" + IdData]; Value = SearchValue; } catch (Exception ex) { } try { SearchValueAux = SessionHandler.SessionVars["data_" + IdData + "_aux"]; } catch (Exception ex) { } } else { SessionHandler.ClearSessionVars(); } }
/// <summary> /// Returns the filters for the current selection. /// </summary> /// <returns>An SQL filter.</returns> public static string GetFilters() { string retval = ""; bool isClearing = HttpContext.Current.Request.Form["clearSearch"] == "1"; if (isClearing) { SessionHandler.ClearSessionVars(); } List <DataDesc> dataDescList = GetDataDesc(); dataDescList.AddRange(ExtraList); foreach (DataDesc dataDesc in dataDescList) { dataDesc.GetSearchValue(); if (!isClearing) { retval = Common.StrAdd(retval, " AND ", dataDesc.GetFilter()); } } return(retval); }