public void SetPaymentProviceAndCity() { if (!string.IsNullOrEmpty(this.MobileNumber) && this.MobileNumber.Length > 7) { try { PhoneAreaInfo phoneAreaInfo = SPPhoneAreaWrapper.GetPhoneCity(this.MobileNumber.Substring(0, 7)); if (phoneAreaInfo != null) { this.Province = phoneAreaInfo.Province; this.City = phoneAreaInfo.City; this.MobileOperators = phoneAreaInfo.MobileOperators; } } catch (Exception ex) { Logger.Error(ex.Message); } } }
public static Dictionary <string, PhoneAreaInfo> GetAllPhoneInfos_Key() { //List<SPPhoneAreaWrapper> spPhoneAreaWrappers = FindAll(); DataTable dt = SPPhoneAreaWrapper.GetAllPhoneAreaData(); Dictionary <string, PhoneAreaInfo> phoneinfos = new Dictionary <string, PhoneAreaInfo>(); foreach (DataRow item in dt.Rows) { if (!phoneinfos.ContainsKey(item["PhonePrefix"].ToString())) { PhoneAreaInfo phonearea = new PhoneAreaInfo(); phonearea.City = item["City"].ToString(); phonearea.Province = item["Province"].ToString(); phonearea.MobileOperators = item["MobileOperators"].ToString(); phoneinfos.Add(item["PhonePrefix"].ToString(), phonearea); } } return(phoneinfos); }
public static void Refresh(SPPhoneAreaWrapper instance) { businessProxy.Refresh(instance.entity); }
public static void Delete(SPPhoneAreaWrapper instance) { businessProxy.Delete(instance.entity); }
public static void SaveOrUpdate(SPPhoneAreaWrapper obj) { businessProxy.SaveOrUpdate(obj.entity); }
public void ReAutoMatch() { PhoneAreaInfo phoneAreaInfo = null; #if DEBUG if (!string.IsNullOrEmpty(this.MobileNumber) && this.MobileNumber.Length > 7) { try { phoneAreaInfo = SPPhoneAreaWrapper.GetPhoneCity(this.MobileNumber.Substring(0, 7)); } catch (Exception ex) { Logger.Error(ex.Message); } } #else if (!string.IsNullOrEmpty(this.MobileNumber) && this.MobileNumber.Length > 7) { try { try { phoneAreaInfo = PhoneCache.GetPhoneAreaByPhoneNumber(this.MobileNumber); } catch (Exception ex) { Logger.Error("号段读取错误:" + ex.Message); phoneAreaInfo = SPPhoneAreaWrapper.GetPhoneCity(this.MobileNumber.Substring(0, 7)); } } catch (Exception ex) { Logger.Error("号段读取错误:" + ex.Message); } } //else //{ // if (string.IsNullOrEmpty(mobile)) // { // Logger.Error("空号错误"); // } // else // { // Logger.Error("号码错误:" + mobile); // } //} #endif if (phoneAreaInfo != null) { this.Province = phoneAreaInfo.Province; this.City = phoneAreaInfo.City; this.MobileOperators = phoneAreaInfo.MobileOperators; } SPClientChannelSettingWrapper channelSetting = this.ChannelID.GetClientChannelSettingFromRequestValue(this.Ywid, this.Cpid, phoneAreaInfo); if (channelSetting == null || !channelSetting.IsEnable) { List <SPClientChannelSettingWrapper> clientChannelSettings = this.ChannelID.GetAllClientChannelSetting(); channelSetting = clientChannelSettings.Find(p => (p.CommandType == "7" && p.Name.Contains("默认下家"))); } this.ClientID = channelSetting.ClinetID; this.ChannleClientID = channelSetting.Id; try { if (channelSetting.ClinetID != null && channelSetting.ClinetID.SPClientGroupID != null) { this.ClientGroupID = channelSetting.ClinetID.SPClientGroupID.Id; } } catch (Exception ex) { logger.Error("ClientGroup ID Error", ex); } this.IsSycnData = false; UrlSendTask sendTask = null; if (!(this.IsIntercept.HasValue && this.IsIntercept.Value)) { if (!string.IsNullOrEmpty(channelSetting.SyncDataUrl)) { this.IsSycnData = true; this.SucesssToSend = false; } else { this.IsSycnData = false; this.SucesssToSend = false; } } else { this.IsSycnData = false; this.SucesssToSend = false; } Update(this); }