/// <summary> /// 删除营业网点 /// </summary> /// <param name="context"></param> public void DelBusinessOutlets(HttpContext context) { var hashtable = new Hashtable(); var businessOutletsDal = new BusinessOutletsDal(); var id = context.Request.Params["id"]; try { businessOutletsDal.Del(new BusinessOutlets() { Id = id }); hashtable["isSuccess"] = true; hashtable["jsMethod"] = "ajax_DelBusinessOutlets"; var json = _jss.Serialize(hashtable); context.Response.Write(json); } catch (Exception e) { Log.Debug("方法名:SavePowerInfo,描述:保存停电信息方法出错,错误原因:" + e.Message); } }
/// <summary> /// 根据经纬度查询营业网点信息 /// </summary> /// <param name="context"></param> public void QueryBusinessOutByJdAndWd(HttpContext context) { Log.Debug("in QueryBusinessOutByJdAndWd-----------------"); var hashtable = new Hashtable(); var businessOutletsDal = new BusinessOutletsDal(); var jd = context.Request.Params["jd"] ?? "0"; var wd = context.Request.Params["wd"] ?? "0"; Log.Debug("jd:" + jd + "wd:" + wd); try { var data = businessOutletsDal.QueryByJdAndWd(float.Parse(jd), float.Parse(wd)); var list = from da in data.AsEnumerable() select new { id = da.Field<string>("id"), areaName = da.Field<string>("AreaName"), address = da.Field<string>("Address"), name = da.Field<string>("Name"), longitude = da.Field<string>("Longitude"), latitude = da.Field<string>("Latitude"), }; hashtable["isSuccess"] = true; hashtable["data"] = list.ToList(); hashtable["jsMethod"] = "ajax_QueryBusinessOutByJdAndWd"; var json = _jss.Serialize(hashtable); context.Response.Write(json); } catch (Exception e) { //context.Response.Write("{\"error\":true,\"msg\":\"" + e.Message + "\"}"); Log.Debug("方法名:QueryBusinessOutByJdAndWd,描述:根据经纬度查询营业网点信息,错误原因:" + e.Message); } }