Example #1
0
        public void SearchCommand()
        {
            string searchTermText = SearchTerm.GetValue();

            if (String.IsNullOrEmpty(searchTermText))
            {
                return;
            }
            // Configure the FetchXml for query by adding search term, parameterising the paging and adjusting columns for lookups
            foreach (FetchQuerySettings config in Config.GetItems())
            {
                config.DataView.ResetPaging();
                config.DataView.FetchXml = null;
                config.DataView.Data.Clear();
                config.DataView.Refresh();

                config.DataView.FetchXml = _parser.GetFetchXmlForQuery(config, "%" + searchTermText + "%");

                if (config.RootEntity.PrimaryImageAttribute != null)
                {
                    // Add the entityimage_url into the fetch xml
                    int startofAttributes = config.DataView.FetchXml.IndexOf("<attribute ");
                    config.DataView.FetchXml = config.DataView.FetchXml.Substr(0, startofAttributes) + "<attribute name=\"" + config.RootEntity.PrimaryImageAttribute + "_url\" alias='card_image_url'/>" + config.DataView.FetchXml.Substr(startofAttributes);
                }



                config.DataView.Reset();
            }
        }
Example #2
0
 public void SearchCommand()
 {
     // Configure the FetchXml for query by adding search term, parameterising the paging and adjusting columns for lookups
     foreach (FetchQuerySettings config in Config.GetItems())
     {
         config.DataView.FetchXml = parser.GetFetchXmlForQuery(config, "%" + SearchTerm.GetValue() + "%");
         config.DataView.Reset();
         config.DataView.ResetPaging();
         config.DataView.Refresh();
     }
 }