コード例 #1
0
        private PhoneArea GetProvinceAndCity(string mobile)
        {
            PhoneArea phoneAreaInfo = null;

//#if DEBUG
//            phoneAreaInfo = GetPhoneAreaInfo(mobile);


//#else
            if (!string.IsNullOrEmpty(mobile) && mobile.Length > 7)
            {
                try
                {
                    try
                    {
                        phoneAreaInfo = CacheProviderFactory.GetPhoneAreaCache().GetPhoneAreaByPhoneNumber(mobile);
                    }
                    catch (Exception ex)
                    {
                        Logger.Error("NOSQL读取错误。", ex);
                        phoneAreaInfo = GetPhoneAreaInfo(mobile);
                    }
                }
                catch (Exception ex)
                {
                    Logger.Error("手机号段读取失败。", ex);
                }
            }
//#endif

            return(phoneAreaInfo);
        }