コード例 #1
0
        public IDataReader GetAutoCompleteKeywords(string prefixText, int count, bool orderByRelevance)
        {
            IDataReader reader = null;

            try
            {
                Database db = DatabaseFactory.CreateDatabase();

                string    sqlCommand = "usp_GetAutoCompleteKeywords";
                DbCommand dbCommand  = db.GetStoredProcCommand(sqlCommand);

                db.AddInParameter(dbCommand, "PrefixText", DbType.String, prefixText);
                db.AddInParameter(dbCommand, "Count", DbType.Int32, count);
                db.AddInParameter(dbCommand, "OrderByRelevance", DbType.Boolean, orderByRelevance);

                reader = db.ExecuteReader(dbCommand);
            }
            catch (Exception ex)
            {
                XmlDataUtility.logit("ERROR==> " + ex.Message + " STACK:" + ex.StackTrace + " SOURCE:" + ex.Source);;

                throw ex;
            }

            return(reader);
        }
コード例 #2
0
        public XmlReaderScope ProfileSearch(string searchQuery, bool isSecure)
        {
            string         spName = "usp_GetPersonList_xml";
            XmlReaderScope scope  = null;

            try
            {
                SqlDatabase db = DatabaseFactory.CreateDatabase() as SqlDatabase;

                DbCommand dbCommand = db.GetStoredProcCommand(spName);

                db.AddInParameter(dbCommand, "xMessage", DbType.Xml, searchQuery);

                if (isSecure)
                {
                    db.AddInParameter(dbCommand, "isSecure", DbType.Boolean, isSecure);
                }

                XmlReader reader = db.ExecuteXmlReader(dbCommand);
                scope = new XmlReaderScope(dbCommand.Connection, reader);
            }
            catch (Exception ex)
            {
                XmlDataUtility.logit("---- ERROR==> " + ex.Message + " STACK:" + ex.StackTrace + " SOURCE:" + ex.Source);;

                throw ex;
            }

            return(scope);
        }
コード例 #3
0
        public XmlReaderScope GetMatchingKeywords(string keyword, string queryID, bool exactKeyword)
        {
            string         spName = "usp_GetMatchingKeywords_xml ";
            XmlReaderScope scope  = null;
            // Defaults
            bool returnXML = true;

            try
            {
                SqlDatabase db = DatabaseFactory.CreateDatabase() as SqlDatabase;

                DbCommand dbCommand = db.GetStoredProcCommand(spName);

                db.AddInParameter(dbCommand, "Keyword", DbType.String, keyword);

                if (queryID.Length > 0)
                {
                    db.AddInParameter(dbCommand, "QueryID", DbType.String, null);
                }
                else
                {
                    db.AddInParameter(dbCommand, "QueryID", DbType.String, DBNull.Value);
                }

                db.AddInParameter(dbCommand, "ExactKeyword", DbType.Boolean, exactKeyword);
                db.AddInParameter(dbCommand, "ReturnXML", DbType.Boolean, returnXML);

                XmlReader reader = db.ExecuteXmlReader(dbCommand);
                scope = new XmlReaderScope(dbCommand.Connection, reader);
            }
            catch (Exception ex)
            {
                XmlDataUtility.logit("ERROR==> " + ex.Message + " STACK:" + ex.StackTrace + " SOURCE:" + ex.Source);;

                throw ex;
            }

            return(scope);
        }
コード例 #4
0
        public XmlReaderScope GetProfileNetworkForBrowser(int profileId)
        {
            string spName = "usp_GetFlashNetwork_XML";

            //This is a good debug tool.  You will need to add a flag to your web.config to enable it. See method for flag name.
            XmlDataUtility.logit("- line 1: NetworkBrowserDA.GetProfileNetworkForBrowser(" + profileId.ToString() + ")");
            XmlReaderScope scope = null;

            try
            {
                SqlDatabase db = DatabaseFactory.CreateDatabase() as SqlDatabase;


                DbCommand dbCommand = db.GetStoredProcCommand(spName);


                db.AddInParameter(dbCommand, "personid1", DbType.Int32, profileId);

                XmlReader reader = db.ExecuteXmlReader(dbCommand);

                scope = new XmlReaderScope(dbCommand.Connection, reader);
            }
            catch (Exception ex)
            {
                //this is a good debug tool.
                //XmlDataUtility.logit("- GetProfileNetworkForBrowser MESSAGE==> " + ex.Message + " STACKTRACE==>" + ex.StackTrace + " SOURCE==>" + ex.Source);

                bool rethrow = ExceptionPolicy.HandleException(ex, "Log Only Policy");
                if (rethrow)
                {
                    throw ex;
                }
            }

            return(scope);
        }