Example #1
0
        /// <summary>
        /// 根据指定的email查找用户并返回用户uid
        /// </summary>
        /// <param name="email">email地址</param>
        /// <returns>用户uid</returns>
        public static int FindUserEmail(string email)
        {
            int userid = -1;
            if (appDBCache)
            {
                userid = IUserService.FindUserEmail(email);
                if (userid > 0)
                    return userid;
            }

            IDataReader reader = DatabaseProvider.GetInstance().FindUserEmail(email);
            if (reader.Read())
            {
                userid = Utils.StrToInt(reader[0].ToString(), -1);
            }
            reader.Close();

            if (appDBCache && userid > 0)
                GetUserInfo(userid);

            return userid;
        }