/// <summary> /// 组合新地址 /// </summary> /// <param name="addressPath"></param> /// <param name="address"></param> /// <param name="level"></param> /// <returns></returns> public static string RenderAddress(string addressPath, string address, int level) { if (!string.IsNullOrWhiteSpace(addressPath)) { string fullName = RegionApplication.GetRegionName(addressPath); string[] arr = fullName.Split(',');//省,市,区,街道 if (arr.Length > 0) { for (int i = 0; i < arr.Length; i++) { if (!string.IsNullOrWhiteSpace(arr[i])) { address = address.Replace(arr[i], "");//去掉原详细地址中的省市区街道。(为兼容旧门店数据) } } } if (level <= arr.Length) { for (int i = 0; i < level; i++) { if (!string.IsNullOrWhiteSpace(arr[i])) { fullName = fullName.Replace(arr[i], ""); } } address = fullName + address; } } if (!string.IsNullOrWhiteSpace(address)) { address = address.Replace(",", " "); } return(address); }
public static string GetShopBranchsFullAddress(string addressPath) { var str = string.Empty; if (!string.IsNullOrEmpty(addressPath)) { str = RegionApplication.GetRegionName(addressPath); } return(str.Replace(",", "")); }