Esempio n. 1
0
        /// <summary>
        /// 写字楼详情
        /// </summary>
        /// <returns></returns>
        public ActionResult GetFormJson(int?keyValue)
        {
            string           returnUrl = Request.Url.ToString();
            Pet_MasterEntity entity    = locationBll.GetEntity(keyValue);

            return(Content(entity.ToJson()));
        }
Esempio n. 2
0
        public ActionResult MasterForm(int?keyValue, Pet_MasterEntity entity)
        {
            //微信火星转百度
            double Lon = double.Parse(entity.wxLon);
            double Lat = double.Parse(entity.wxLat);
            double bdLat, bdLon;

            MapConverter.GCJ02ToBD09(Lat, Lon, out bdLat, out bdLon);
            entity.bdLat    = bdLat.ToString();
            entity.bdLon    = bdLon.ToString();
            entity.OpenId   = CurrentWxUser.OpenId;
            entity.NickName = CurrentWxUser.NickName;

            //根据坐标获取省市县信息
            string       url          = @"http://restapi.amap.com/v3/geocode/regeo?location=" + Lon + "," + Lat + "&key=cf3dd05a8192fd1839628b39e589c89e&radius=1000&extensions=all";//output=XML&
            string       responseJson = HttpClientHelper.Get(url);
            RestLocation restLocation = JsonConvert.DeserializeObject <RestLocation>(responseJson.Replace("[]", "\"\""));

            entity.Province = restLocation.regeocode.addressComponent.province;
            entity.City     = restLocation.regeocode.addressComponent.city;
            entity.CityCode = restLocation.regeocode.addressComponent.citycode;
            entity.District = restLocation.regeocode.addressComponent.district;

            //插入热点表
            locationBll.SaveForm(keyValue, entity);

            return(Content("true"));
        }
Esempio n. 3
0
 /// <summary>
 /// 保存表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 public void SaveForm(int?keyValue, Pet_MasterEntity entity)
 {
     try
     {
         service.SaveForm(keyValue, entity);
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 4
0
 public ActionResult SaveForm(int?keyValue, Pet_MasterEntity entity)
 {
     pet_housebll.SaveForm(keyValue, entity);
     return(Success("操作成功。"));
 }