public ActionResult ProvinceCityArea(int pid, int cid, int aid)
 {
     using (FxtAPIClient client = new FxtAPIClient())
     {
         string ProvinceName = string.Empty,
                CityName     = string.Empty,
                AreaName     = string.Empty;
         //省份
         JObject _obj = new JObject();
         _obj.Add("provinceId", pid);
         result = client.Entrance(Utils.CommonKey, Utils.GetWcfCode(Utils.CommonKey),
                                  "D", _GetProvinceById, Utils.Serialize(_obj));
         SYSProvince sysp = Utils.Deserialize <SYSProvince>(result.ToString());
         if (sysp != null)
         {
             ProvinceName = sysp.ProvinceName;
         }
         //城市
         _obj = new JObject();
         _obj.Add("cityId", cid);
         result = client.Entrance(Utils.CommonKey, Utils.GetWcfCode(Utils.CommonKey),
                                  "D", _GetCityByCityId, Utils.Serialize(_obj));
         SYSCity sysc = Utils.Deserialize <SYSCity>(result.ToString());
         if (sysc != null)
         {
             CityName = sysc.CityName;
         }
         //行政区
         _obj = new JObject();
         _obj.Add("areaId", aid);
         result = client.Entrance(Utils.CommonKey, Utils.GetWcfCode(Utils.CommonKey),
                                  "D", _GetAreaByAreaId, Utils.Serialize(_obj));
         SYSArea sysa = Utils.Deserialize <SYSArea>(result.ToString());
         if (sysa != null)
         {
             AreaName = sysa.AreaName;
         }
         return(Json(new
         {
             PName = ProvinceName,
             CName = CityName,
             AName = AreaName
         }));
     }
 }
Beispiel #2
0
        public DATProjectView(DATProject proj, IList <SYSCity> cityList, IList <SYSArea> areaList)
        {
            this.ProjectId   = proj.ProjectId;
            this.ProjectName = proj.ProjectName;;
            this.AreaID      = proj.AreaID;
            SYSArea area = areaList.Where(p => p.AreaId == proj.AreaID).FirstOrDefault();

            if (area != null)
            {
                this.AreaName = area.AreaName;
            }
            this.CityID = proj.CityID;
            SYSCity city = cityList.Where(p => p.CityId == proj.CityID).FirstOrDefault();

            if (city != null)
            {
                this.CityName = city.CityName;
            }
        }