SobekCM.SobekCM_Page_Globals.Search_Block C# (CSharp) Method

Search_Block() private method

private Search_Block ( ) : void
return void
        private void Search_Block()
        {
            tracer.Add_Trace("SobekCM_Page_Globals.Search_Block", "Retreiving search results");

            // Here just pull the hierarchy object then (later this will be pused out of here)
            Item_Aggregation hierarchyObject = SobekEngineClient.Aggregations.Get_Aggregation(currentMode.Aggregation, currentMode.Language, UI_ApplicationCache_Gateway.Settings.System.Default_UI_Language, tracer);

            try
            {
                // If there is no search term, forward back to the collection
                if (( String.IsNullOrEmpty(currentMode.Search_String)) && ( String.IsNullOrEmpty(currentMode.Coordinates)))
                {
                    currentMode.Mode = Display_Mode_Enum.Aggregation;
                    currentMode.Aggregation_Type = Aggregation_Type_Enum.Home;
                    UrlWriterHelper.Redirect(currentMode);
                    return;
                }

                SobekCM_Assistant assistant = new SobekCM_Assistant();
                assistant.Get_Search_Results(currentMode, UI_ApplicationCache_Gateway.Items, hierarchyObject, UI_ApplicationCache_Gateway.Search_Stop_Words, tracer, out searchResultStatistics, out pagedSearchResults);

                if ((!currentMode.isPostBack) && (UI_ApplicationCache_Gateway.Search_History != null))
                {
                    UI_ApplicationCache_Gateway.Search_History.Add_New_Search(Get_Search_From_Mode(currentMode, HttpContext.Current.Request.UserHostAddress, currentMode.Search_Type, hierarchyObject.Name, currentMode.Search_String ));
                }
            }
            catch (Exception ee)
            {
                currentMode.Mode = Display_Mode_Enum.Error;
                currentMode.Error_Message = "Unable to perform search at this time ";
                if (hierarchyObject == null)
                    currentMode.Error_Message = "Unable to perform search - hierarchyObject = null";
                currentMode.Caught_Exception = ee;
            }
        }