Ejemplo n.º 1
0
        private void AddRegion(HttpContext context)
        {
            context.Response.ContentType = "application/json";
            string szJson = context.Request["DataJson"];

            Hidistro.Entities.Store.RegionInfo regionInfo = JsonHelper.ParseFormJson <Hidistro.Entities.Store.RegionInfo>(szJson);
            int num2;

            if (!string.IsNullOrEmpty(regionInfo.RegionName))
            {
                int num = regionInfo.ParentRegionId;
                if (!string.IsNullOrEmpty(num.ToString()))
                {
                    num = regionInfo.Depth;
                    if (!string.IsNullOrEmpty(num.ToString()))
                    {
                        num2 = (string.IsNullOrEmpty(regionInfo.FullRegionPath) ? 1 : 0);
                        goto IL_0071;
                    }
                }
            }
            num2 = 1;
            goto IL_0071;
IL_0071:
            if (num2 != 0)
            {
                context.Response.Write("{\"Status\":\"0\"}");
            }
            else if (RegionHelper.IsSameName(regionInfo.RegionName, regionInfo.ParentRegionId, 0))
            {
                context.Response.Write("{\"Status\":\"same\"}");
            }
            else
            {
                bool flag = RegionHelper.AddRegion(regionInfo);
                context.Response.Write("{\"Status\":\"" + flag.ToString() + "\"}");
            }
        }