Ejemplo n.º 1
0
        /****************************************************************/
        /// <summary>
        /// 从缓存中取用户信息
        /// </summary>
        /// <param name="strUserKey"></param>
        /// <param name="objUser"></param>
        public static bool GetCacheUser(string strUserID, string strPwd, ref SmsServer.Model.SmsUser objUser)
        {
            bool   bExist     = false;
            string strUserKey = strUserID + strPwd;

            lock (pUserList)
            {
                bExist = pUserList.ContainsKey(strUserKey);
                if (bExist)
                {
                    objUser = pUserList[strUserKey];
                }
            }
            if (!bExist)
            {
                objUser = new SmsUser().GetSelectSmsUser(strUserID, strPwd);
                if (objUser == null)
                {
                    return(false);
                }
                AddCacheUser(objUser);
            }
            return(true);
        }
        /****************************************************************/
        /// <summary>
        /// 从缓存中取用户信息
        /// </summary>
        /// <param name="strUserKey"></param>
        /// <param name="objUser"></param>
        public static bool GetCacheUser(string strUserID,string strPwd,ref SmsServer.Model.SmsUser objUser)
        {
            bool bExist = false;
            string strUserKey = strUserID + strPwd;
            lock (pUserList)
            {
                bExist = pUserList.ContainsKey(strUserKey);
                if(bExist)
                {
                    objUser = pUserList[strUserKey];
                }

            }
            if (!bExist)
            {
                objUser = new SmsUser().GetSelectSmsUser(strUserID, strPwd);
                if (objUser == null)
                {
                    return false;
                }
                AddCacheUser(objUser);
            }
            return true;
        }