Example #1
0
        public DBUserInfo GetDBUserInfo(string userID)
        {
            DBUserInfo dbUserInfo = this._DBUserMgr.FindDBUserInfo(userID);

            if (null == dbUserInfo)
            {
                dbUserInfo = new DBUserInfo();
                MySQLConnection conn = this._DBConns.PopDBConnection();
                try
                {
                    if (!dbUserInfo.Query(conn, userID))
                    {
                        return(null);
                    }
                }
                catch (Exception ex)
                {
                    LogManager.WriteException(ex.ToString());
                }
                finally
                {
                    this._DBConns.PushDBConnection(conn);
                }
                dbUserInfo = this._DBUserMgr.AddDBUserInfo(dbUserInfo);
            }
            return(dbUserInfo);
        }
Example #2
0
        /// <summary>
        /// 获取指定的用户信息
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        public DBUserInfo GetDBUserInfo(string userID)
        {
            DBUserInfo dbUserInfo = _DBUserMgr.FindDBUserInfo(userID);

            if (null == dbUserInfo)
            {
                dbUserInfo = new DBUserInfo();
                MySQLConnection conn = _DBConns.PopDBConnection();

                try
                {
                    if (!dbUserInfo.Query(conn, userID))
                    {
                        return(null);
                    }
                }
                finally
                {
                    _DBConns.PushDBConnection(conn);
                }

                //放入缓存
                _DBUserMgr.AddDBUserInfo(dbUserInfo);
            }

            return(dbUserInfo);
        }