コード例 #1
0
        public JsonResult AddRegion(Himall.CommonModel.Region.RegionLevel level, string regionName, string path, long parentId)
        {
            if (string.IsNullOrWhiteSpace(regionName))
            {
                throw new HimallException("区域名称不能为空");
            }
            if (regionName.Length > 30)
            {
                throw new HimallException("区域名称30个字符以内");
            }
            //  RegionApplication.AddRegion(regionName, level, path);
            //  var region = RegionApplication.GetAllRegions().Max(a => a.Id);
            var id = RegionApplication.AddRegion(regionName, parentId);

            return(Json(new { success = true, msg = "添加成功!", Id = id }));
        }