Example #1
0
        /// <summary>
        /// 根据regionId获取省市名称
        /// </summary>
        /// <param name="regionId"></param>
        /// <returns></returns>
        public static string ReadCityName(string regionId)
        {
            string result = string.Empty;

            if (!string.IsNullOrEmpty(regionId))
            {
                foreach (string rid in regionId.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries))
                {
                    int _rid = ShopCommon.ConvertToT <Int32>(rid);
                    if (_rid > 0)
                    {
                        result += RegionBLL.ReadRegionCache(_rid).RegionName;
                    }
                }
            }
            return(result);
        }
Example #2
0
        /// <summary>
        /// 读取编排好的地区名称
        /// </summary>
        /// <param name="idList"></param>
        /// <returns></returns>
        public static string RegionNameList(string idList)
        {
            string content = string.Empty;

            if (idList != string.Empty)
            {
                idList = idList.Substring(1, idList.Length - 2);
            }
            idList = idList.Replace("||", "#");
            if (idList.Length > 0)
            {
                foreach (string temp in idList.Split('#'))
                {
                    string tempRegionName = string.Empty;
                    foreach (string id in temp.Split('|'))
                    {
                        if (tempRegionName == string.Empty)
                        {
                            tempRegionName = RegionBLL.ReadRegionCache(Convert.ToInt32(id)).RegionName;
                        }
                        else
                        {
                            tempRegionName += "   " + RegionBLL.ReadRegionCache(Convert.ToInt32(id)).RegionName;
                        }
                    }
                    if (tempRegionName != string.Empty)
                    {
                        if (content == string.Empty)
                        {
                            content = tempRegionName;
                        }
                        else
                        {
                            content += "," + tempRegionName;
                        }
                    }
                }
            }
            return(content);
        }
Example #3
0
        /// <summary>
        /// 读取地区的湖南级分类
        /// </summary>
        /// <returns></returns>
        public static List <UnlimitClassInfo> ReadRegionUnlimitClassHN()
        {
            List <RegionInfo> regionList = new List <RegionInfo>();

            List <UnlimitClassInfo> unlimitClassList = new List <UnlimitClassInfo>();
            UnlimitClassInfo        unlimitClass     = new UnlimitClassInfo();

            unlimitClass.ClassID   = 27;
            unlimitClass.ClassName = RegionBLL.ReadRegionCache(27).RegionName;
            unlimitClass.FatherID  = RegionBLL.ReadRegionCache(27).FatherID;
            unlimitClassList.Add(unlimitClass);
            regionList = RegionBLL.ReadRegionChildList(27);

            foreach (RegionInfo region in regionList)
            {
                unlimitClass           = new UnlimitClassInfo();
                unlimitClass.ClassID   = region.ID;
                unlimitClass.ClassName = region.RegionName;
                unlimitClass.FatherID  = region.FatherID;
                unlimitClassList.Add(unlimitClass);
            }

            return(unlimitClassList);
        }