public void Execute()
        {
            DataIO search = new DataIO();
            XmlDocument returndata = null;
            string queryid = string.Empty;

            _doc.LoadXml(_doc.OuterXml.Replace("xmlns=\"\"", ""));

            returndata = search.BetaSearch(_doc);

            this.SetQueryID(returndata);

            CacheWrapper.CacheItem(this.QueryID + "request", _doc);
            CacheWrapper.CacheItem(this.QueryID + "results", returndata);
        }
        public XmlDocument Execute(string QueryID, string Keyword, string EntityID)
        {
            DataIO search = new DataIO();
            try
            {
                _doc = new XmlDocument();
                _doc.Load(AppDomain.CurrentDomain.BaseDirectory.ToString() + "/Search/Utilities/GetSearchConnection.xml");

                _doc.LoadXml(_doc.InnerXml.Replace("{{{@EntityID}}}", EntityID));
                _doc.LoadXml(_doc.InnerXml.Replace("{{{@QueryID}}}", QueryID));
                _doc.LoadXml(_doc.InnerXml.Replace("{{{@Keyword}}}", Keyword));

            }
            catch (Exception ex)
            {
                //For Debugging only put a break(F9) on the ex=ex while debugging,  if an error takes place at this level then the cache for the query header has
                // exprired so notify the user and have them start a new search session.
               Framework.Utilities.DebugLogging.Log(ex.Message + " ++ " + ex.StackTrace);
            }
            return search.BetaSearch(_doc);
        }
        public XmlDocument ExecuteSingle()
        {
            DataIO search = new DataIO();
            XmlDocument returndata = null;
            string queryid = string.Empty;

            _doc.LoadXml(_doc.OuterXml.Replace("xmlns=\"\"", ""));

            returndata = search.BetaSearch(_doc);
            return returndata;
        }
        public XmlDocument Execute(string QueryID, string SortBy, string StartRecord, string MaxRecords)
        {
            XmlDocument rtn = new XmlDocument();
            try
            {
                DataIO search = new DataIO();
                XmlDocument returndata = new XmlDocument();
                _doc.LoadXml(search.GetQueryXML(QueryID));

                if (_doc == null)
                {
                    _doc = new XmlDocument();
                    _doc.Load(AppDomain.CurrentDomain.BaseDirectory.ToString() + "/Search/Utilities/GetPersonListWithQueryID.xml");
                    this.LoadQueryID(QueryID);
                    this.LoadOutputOptions(SortBy, StartRecord, MaxRecords);
                }
                else
                {

                    this.SetPages(StartRecord, MaxRecords);
                    this.SetSort(SortBy);
                }

                //TODO: ZAP: Sometimes the personid gets cached if its a connection search of a keyword.
                if (_doc.SelectSingleNode("Profiles/QueryDefinition/PersonID") != null)
                {
                    _doc.SelectSingleNode("Profiles/QueryDefinition/PersonID").InnerText = "";
                }

                returndata = search.BetaSearch(_doc);

                this.QueryID = QueryID;

                CacheWrapper.CacheItem(QueryID + "request", _doc);
                CacheWrapper.CacheItem(QueryID + "results", returndata);
                rtn = returndata;
            }
            catch (Exception ex)
            {
                //For Debugging only put a break(F9) on the ex=ex while debugging,  if an error takes place at this level then the cache for the query header has
                // exprired so notify the user and have them start a new search session.
               Framework.Utilities.DebugLogging.Log(ex.Message + " ++ " + ex.StackTrace);

            }

            return rtn;
        }