示例#1
0
        /// <summary>
        /// 绑定数据
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        protected void BindData(float x, float y, int wid)
        {
            BLL.wx_lbs_setting   setBll  = new BLL.wx_lbs_setting();
            Model.wx_lbs_setting setting = setBll.GetSettingByWid(wid);

            bannerPic.ImageUrl = setting.bannerPicUrl;
            BLL.wx_lbs_shopInfo sBll = new BLL.wx_lbs_shopInfo();
            //SELECT * FROM wx_lbs_shopInfo WHERE dbo.[ufn_GetMapDistance](121.4624,31.220933,yPoint, xPoint) < 5
            IList <Model.wx_lbs_shopInfo> shopList = sBll.GetDetailList(wid, "dbo.[ufn_GetMapDistance](" + y + "," + x + ",yPoint, xPoint) < " + setting.searchRadius);
            StringBuilder rpLocationStr            = new StringBuilder("");

            if (shopList != null && shopList.Count > 0)
            {
                string juli = "0";
                for (int i = 0; i < shopList.Count; i++)
                {
                    juli = (sBll.getMapDistance((double)y, (double)x, (double)(shopList[i].yPoint.Value), (double)(shopList[i].xPoint.Value))).ToString("F1");

                    rpLocationStr.Append("<li>");
                    string dUrl = DetailUrl(wid, shopList[i].id, x, y, shopList[i].wUrl);
                    rpLocationStr.Append("<a href=\"" + dUrl + "\" rel=\"external\" data-ajax=\"false\">");
                    rpLocationStr.Append(" <h2><img src=\"images/1.gif\" /><span onclick='" + shopList[i].telphone + "'>" + shopList[i].telphone + "</span></h2>");

                    rpLocationStr.Append("<p>地址:" + shopList[i].detailAddr + " &nbsp; 距离:约" + juli + "公里 </p>");
                    rpLocationStr.Append("<p> 简介:" + shopList[i].brief + "</p>");
                    rpLocationStr.Append("</li>");
                }
                txtrpLocationStr.Text = rpLocationStr.ToString();
                litshopNum.Text       = shopList.Count.ToString();
            }
            else
            {
                txtrpLocationStr.Text = "暂无数据";
            }
        }
示例#2
0
        private void TreeBind()
        {
            Model.wx_userweixin  weixin = GetWeiXinCode();
            BLL.article_category bll    = new BLL.article_category();
            DataTable            dt     = bll.GetList(" wid=" + weixin.id);

            //最新车讯
            this.ddlZxcx.Items.Clear();
            this.ddlZxcx.Items.Add(new ListItem("请选择最新车讯...", ""));
            foreach (DataRow dr in dt.Rows)
            {
                string Id    = dr["id"].ToString();
                string Title = dr["title"].ToString().Trim();
                this.ddlZxcx.Items.Add(new ListItem(Title, Id));
            }
            //最新优惠
            this.ddlZxyh.Items.Clear();
            this.ddlZxyh.Items.Add(new ListItem("请选择最新优惠...", ""));
            foreach (DataRow dr in dt.Rows)
            {
                string Id    = dr["id"].ToString();
                string Title = dr["title"].ToString().Trim();
                this.ddlZxyh.Items.Add(new ListItem(Title, Id));
            }
            //尊享二手车
            this.ddlEsc.Items.Clear();
            this.ddlEsc.Items.Add(new ListItem("请选择二手车...", ""));
            foreach (DataRow dr in dt.Rows)
            {
                string Id    = dr["id"].ToString();
                string Title = dr["title"].ToString().Trim();
                this.ddlEsc.Items.Add(new ListItem(Title, Id));
            }

            //品牌相册
            BLL.wx_albums_info aiBll = new BLL.wx_albums_info();
            DataTable          aidt  = aiBll.GetList(" wid=" + weixin.id).Tables[0];

            this.ddlPpxc.Items.Clear();
            this.ddlPpxc.Items.Add(new ListItem("请选择品牌相册...", ""));
            foreach (DataRow dr in aidt.Rows)
            {
                string Id    = dr["id"].ToString();
                string Title = dr["aname"].ToString().Trim();
                this.ddlPpxc.Items.Add(new ListItem(Title, Id));
            }

            //LBS
            BLL.wx_lbs_shopInfo lbsBll = new BLL.wx_lbs_shopInfo();
            DataTable           lbsdt  = lbsBll.GetList(" wid=" + weixin.id).Tables[0];

            this.ddlLbs.Items.Clear();
            this.ddlLbs.Items.Add(new ListItem("请选择LBS...", ""));
            foreach (DataRow dr in lbsdt.Rows)
            {
                string Id    = dr["id"].ToString();
                string Title = dr["shopName"].ToString().Trim();
                this.ddlLbs.Items.Add(new ListItem(Title, Id));
            }
        }
示例#3
0
        /// <summary>
        /// 绑定数据
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        protected void BindData(float x, float y,int wid)
        {
            BLL.wx_lbs_setting setBll = new BLL.wx_lbs_setting();
            Model.wx_lbs_setting setting = setBll.GetSettingByWid(wid);

            bannerPic.ImageUrl = setting.bannerPicUrl;
            BLL.wx_lbs_shopInfo sBll = new BLL.wx_lbs_shopInfo();
            //SELECT * FROM wx_lbs_shopInfo WHERE dbo.[ufn_GetMapDistance](121.4624,31.220933,yPoint, xPoint) < 5
            IList<Model.wx_lbs_shopInfo> shopList = sBll.GetDetailList(wid,"dbo.[ufn_GetMapDistance](" + y + "," + x + ",yPoint, xPoint) < " + setting.searchRadius);
            StringBuilder rpLocationStr =new StringBuilder("");
            if (shopList != null && shopList.Count > 0)
            {
                string juli = "0";
                for (int i = 0; i < shopList.Count; i++)
                {
                    juli = (sBll.getMapDistance((double)y, (double)x, (double)(shopList[i].yPoint.Value), (double)(shopList[i].xPoint.Value))).ToString("F1");

                    rpLocationStr.Append("<li>");
                    string dUrl = DetailUrl(wid, shopList[i].id, x, y, shopList[i].wUrl);
                    rpLocationStr.Append("<a href=\"" + dUrl + "\" rel=\"external\" data-ajax=\"false\">");
                    rpLocationStr.Append(" <h2><img src=\"images/1.gif\" /><span onclick='" + shopList[i].telphone + "'>" + shopList[i].telphone+ "</span></h2>");

                    rpLocationStr.Append("<p>地址:" + shopList[i].detailAddr + " &nbsp; 距离:约" + juli + "公里 </p>");
                    rpLocationStr.Append("<p> 简介:" + shopList[i].brief + "</p>");
                    rpLocationStr.Append("</li>");
                }
                txtrpLocationStr.Text = rpLocationStr.ToString();
                litshopNum.Text = shopList.Count.ToString();
            }
            else {
                txtrpLocationStr.Text = "暂无数据";
            }
        }
示例#4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="shopid"></param>
        /// <param name="x">客户传过来的纬度x</param>
        /// <param name="y">客户传过来的经度y</param>
        protected void BindData(int wid, int shopid, float x, float y)
        {
            // 页面上部链接
            BLL.wx_lbs_shopInfo   shopBll = new BLL.wx_lbs_shopInfo();
            Model.wx_lbs_shopInfo shop    = shopBll.GetModel(shopid);
            string openid = MyCommFun.RequestOpenid();

            if (shop == null)
            {
                return;
            }

            string aInfo = " <a data-role=\"button\" data-ajax=\"false\" rel=\"external\" href=\"index.aspx?x=" + x + "&y=" + y + "&wid=" + wid + "&openid=" + openid + "\">更多..." + br();

            aInfo        += "</a>" + br();
            aInfo        += "<a data-role=\"button\" href=\"tel:" + shop.telphone + "\">拨打电话</a>";
            litAInfo.Text = aInfo;


            //页面Js

            string jsInfo = " <script type=\"text/javascript\">" + br();

            jsInfo += "  var map = new BMap.Map(\"allmap\"); " + br();
            jsInfo += "  var point = new BMap.Point(" + shop.yPoint + ", " + shop.xPoint + "); " + br();
            jsInfo += " map.centerAndZoom(point, 15);                 " + br();
            jsInfo += " map.enableScrollWheelZoom();                         " + br();
            jsInfo += "  map.addControl(new BMap.NavigationControl()); " + br();

            jsInfo += "  var marker = new BMap.Marker(point);  " + br();
            jsInfo += " map.addOverlay(marker);            " + br();
            jsInfo += "   marker.setAnimation(BMAP_ANIMATION_BOUNCE);" + br();

            jsInfo += "  var p1 = new BMap.Point(" + y + ", " + x + ");" + br();
            jsInfo += "  var p2 = new BMap.Point(" + shop.yPoint + ", " + shop.xPoint + "); " + br();

            jsInfo += "  var driving = new BMap.DrivingRoute(map, { renderOptions: { map: map, autoViewport: true } });" + br();
            jsInfo += "  driving.search(p1, p2);" + br();

            jsInfo += "  $('#allmap').height($(window).height() - 60);" + br();
            jsInfo += "  document.title = '" + shop.city + "';" + br();

            jsInfo += "</script>";

            litJavaScript.Text = jsInfo;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="shopid"></param>
        /// <param name="x">客户传过来的纬度x</param>
        /// <param name="y">客户传过来的经度y</param>
        protected void BindData(int wid,int shopid, float x, float y)
        {
            // 页面上部链接
            BLL.wx_lbs_shopInfo shopBll = new BLL.wx_lbs_shopInfo();
           Model.wx_lbs_shopInfo  shop = shopBll.GetModel(shopid);
           string openid = MyCommFun.RequestOpenid();
           if (shop == null)
            {
                return;
            }

           string aInfo = " <a data-role=\"button\" data-ajax=\"false\" rel=\"external\" href=\"index.aspx?x=" + x + "&y=" + y + "&wid=" + wid + "&openid=" + openid + "\">更多..." + br();
            aInfo += "</a>" + br();
            aInfo += "<a data-role=\"button\" href=\"tel:" + shop.telphone + "\">拨打电话</a>";
            litAInfo.Text = aInfo;


            //页面Js

            string jsInfo = " <script type=\"text/javascript\">" + br();
            jsInfo += "  var map = new BMap.Map(\"allmap\"); " + br();
            jsInfo += "  var point = new BMap.Point(" + shop.yPoint + ", " + shop.xPoint + "); " + br();
            jsInfo += " map.centerAndZoom(point, 15);                 " + br();
            jsInfo += " map.enableScrollWheelZoom();                         " + br();
            jsInfo += "  map.addControl(new BMap.NavigationControl()); " + br();

            jsInfo += "  var marker = new BMap.Marker(point);  " + br();
            jsInfo += " map.addOverlay(marker);            " + br();
            jsInfo += "   marker.setAnimation(BMAP_ANIMATION_BOUNCE);" + br();

            jsInfo += "  var p1 = new BMap.Point(" + y + ", " + x + ");" + br();
            jsInfo += "  var p2 = new BMap.Point(" + shop.yPoint + ", " + shop.xPoint + "); " + br();

            jsInfo += "  var driving = new BMap.DrivingRoute(map, { renderOptions: { map: map, autoViewport: true } });" + br();
            jsInfo += "  driving.search(p1, p2);" + br();

            jsInfo += "  $('#allmap').height($(window).height() - 60);" + br();
            jsInfo += "  document.title = '" + shop.city + "';" + br();

            jsInfo += "</script>";

            litJavaScript.Text = jsInfo;
        }
示例#6
0
        public IResponseMessageBase GetResponseMessage(RequestMessageLocation requestMessage)
        {
            #region 注释掉的
            //var responseMessage = ResponseMessageBase.CreateFromRequestMessage<ResponseMessageNews>(requestMessage);

            //var markersList = new List<Markers>();
            //markersList.Add(new Markers()
            //{
            //    X = requestMessage.Location_X,
            //    Y = requestMessage.Location_Y,
            //    Color = "red",
            //    Label = "S",
            //    Size = MarkerSize.Default,
            //});
            //var mapSize = "480x600";
            //var mapUrl = GoogleMapHelper.GetGoogleStaticMap(19 /*requestMessage.Scale*//*微信和GoogleMap的Scale不一致,这里建议使用固定值*/,
            //                                                markersList, mapSize);
            //responseMessage.Articles.Add(new Article()
            //{
            //    Description = string.Format("您刚才发送了地理位置信息。Location_X:{0},Location_Y:{1},Scale:{2},标签:{3}",
            //                  requestMessage.Location_X, requestMessage.Location_Y,
            //                  requestMessage.Scale, requestMessage.Label),
            //    PicUrl = mapUrl,
            //    Title = "定位地点周边地图",
            //    Url = mapUrl
            //});
            //responseMessage.Articles.Add(new Article()
            //{
            //    Title = "微信公众平台SDK 官网链接",
            //    Description = "Senparc.Weixin.MK SDK地址",
            //    PicUrl = "http://weixin.senparc.com/images/logo1.jpg",
            //    Url = "http://www.yubom.net"
            //});

            //return responseMessage;

            #endregion

               WeiXCommFun wxcomm = new WeiXCommFun();

            string yuming = MyCommFun.getWebSite();
            int apiid = wxcomm.getApiid();

            //1 查询店面,如果查询到店面,则返回图文列表信息,如果未查询到,则返回纯文本“找不到你查询的内容”
            BLL.wx_lbs_setting setBll = new BLL.wx_lbs_setting();
            Model.wx_lbs_setting setting = setBll.GetSettingByWid(apiid);

            BLL.wx_lbs_shopInfo sBll = new BLL.wx_lbs_shopInfo();
            //SELECT * FROM wx_lbs_shopInfo WHERE dbo.[ufn_GetMapDistance](121.4624,31.220933,yPoint, xPoint) < 5
            IList<Model.wx_lbs_shopInfo> shopList = sBll.GetDetailList(apiid,"dbo.[ufn_GetMapDistance](" + requestMessage.Location_Y + "," + requestMessage.Location_X + ",yPoint, xPoint) < " + setting.searchRadius);

            if (shopList == null || shopList.Count <= 0)
            {  //未查询到
                var responseTextMessage = ResponseMessageBase.CreateFromRequestMessage<ResponseMessageText>(requestMessage);

                responseTextMessage.Content = "找不到你查询的内容";
                return responseTextMessage;
            }
            else
            {  //查询到了数据
                var responseMessage = ResponseMessageBase.CreateFromRequestMessage<ResponseMessageNews>(requestMessage);
                ////第一条信息
                //responseMessage.Articles.Add(new Article()
                //{
                //    Description = string.Format("您刚才发送了地理位置信息。Location_X:{0},Location_Y:{1},Scale:{2},标签:{3}",
                //                  requestMessage.Location_X, requestMessage.Location_Y,
                //                  requestMessage.Scale, requestMessage.Label),
                //    PicUrl = yuming + "/lbsInfo/images/ditu.jpg",
                //    Title = "周边门店信息",
                //    Url = yuming + "/weixin/lbs/index.aspx?x=" + requestMessage.Location_X + "&y=" + requestMessage.Location_Y + "&wid=" + apiid + "&openid=" + requestMessage.FromUserName
                //});

                //中间n条信息 ,图文消息个数,限制为10条以内,所以中间控制最多8条信息
                for (int i = 0; i < shopList.Count; i++)
                {
                    if (i == 8)
                    {
                        break;
                    }
                    Model.wx_lbs_shopInfo shop = shopList[i];
                    string pUrl = "";
                    if (shop.shopLogo == null || shop.shopLogo.Trim() == "")
                    {
                        // pUrl = yuming + "/lbsinfo/images/logo.jpg";
                    }
                    else
                    {
                        pUrl = yuming + shop.shopLogo;
                    }
                    responseMessage.Articles.Add(new Article()
                    {
                        Title = shop.shopName + "\n 地址:" + shop.detailAddr + "\n电话:" + shop.telphone,
                        Description = shop.shopName + "分店信息",
                        PicUrl = pUrl,
                        Url = yuming + "/weixin/lbs/detailAddr.aspx?shopid=" + shop.id + "&x=" + requestMessage.Location_X + "&y=" + requestMessage.Location_Y + "&wid=" + apiid + "&openid=" + requestMessage.FromUserName
                    });
                }

                //最后一条信息
                responseMessage.Articles.Add(new Article()
                {
                    Title = "更多门店>>",
                    Url = yuming + "/weixin/lbs/index.aspx?x=" + requestMessage.Location_X + "&y=" + requestMessage.Location_Y + "&wid=" + apiid + "&openid=" + requestMessage.FromUserName
                });

                return responseMessage;

            }
        }
示例#7
0
        public IResponseMessageBase GetResponseMessage(RequestMessageLocation requestMessage)
        {
            #region 注释掉的
            //var responseMessage = ResponseMessageBase.CreateFromRequestMessage<ResponseMessageNews>(requestMessage);

            //var markersList = new List<Markers>();
            //markersList.Add(new Markers()
            //{
            //    X = requestMessage.Location_X,
            //    Y = requestMessage.Location_Y,
            //    Color = "red",
            //    Label = "S",
            //    Size = MarkerSize.Default,
            //});
            //var mapSize = "480x600";
            //var mapUrl = GoogleMapHelper.GetGoogleStaticMap(19 /*requestMessage.Scale*//*微信和GoogleMap的Scale不一致,这里建议使用固定值*/,
            //                                                markersList, mapSize);
            //responseMessage.Articles.Add(new Article()
            //{
            //    Description = string.Format("您刚才发送了地理位置信息。Location_X:{0},Location_Y:{1},Scale:{2},标签:{3}",
            //                  requestMessage.Location_X, requestMessage.Location_Y,
            //                  requestMessage.Scale, requestMessage.Label),
            //    PicUrl = mapUrl,
            //    Title = "定位地点周边地图",
            //    Url = mapUrl
            //});
            //responseMessage.Articles.Add(new Article()
            //{
            //    Title = "微信公众平台SDK 官网链接",
            //    Description = "Senparc.Weixin.MK SDK地址",
            //    PicUrl = "http://weixin.senparc.com/images/logo1.jpg",
            //    Url = "http://www.yubom.net"
            //});

            //return responseMessage;

            #endregion

            WeiXCommFun wxcomm = new WeiXCommFun();

            string yuming = MyCommFun.getWebSite();
            int    apiid  = 38;// wxcomm.getApiid()该了

            //1 查询店面,如果查询到店面,则返回图文列表信息,如果未查询到,则返回纯文本“找不到你查询的内容”
            BLL.wx_lbs_setting   setBll  = new BLL.wx_lbs_setting();
            Model.wx_lbs_setting setting = setBll.GetSettingByWid(apiid);


            BLL.wx_lbs_shopInfo sBll = new BLL.wx_lbs_shopInfo();
            //SELECT * FROM wx_lbs_shopInfo WHERE dbo.[ufn_GetMapDistance](121.4624,31.220933,yPoint, xPoint) < 5
            IList <Model.wx_lbs_shopInfo> shopList = sBll.GetDetailList(apiid, "dbo.[ufn_GetMapDistance](" + requestMessage.Location_Y + "," + requestMessage.Location_X + ",yPoint, xPoint) < " + setting.searchRadius);

            if (shopList == null || shopList.Count <= 0)
            {  //未查询到
                var responseTextMessage = ResponseMessageBase.CreateFromRequestMessage <ResponseMessageText>(requestMessage);

                responseTextMessage.Content = "找不到你查询的内容";
                return(responseTextMessage);
            }
            else
            {  //查询到了数据
                var responseMessage = ResponseMessageBase.CreateFromRequestMessage <ResponseMessageNews>(requestMessage);
                ////第一条信息
                //responseMessage.Articles.Add(new Article()
                //{
                //    Description = string.Format("您刚才发送了地理位置信息。Location_X:{0},Location_Y:{1},Scale:{2},标签:{3}",
                //                  requestMessage.Location_X, requestMessage.Location_Y,
                //                  requestMessage.Scale, requestMessage.Label),
                //    PicUrl = yuming + "/lbsInfo/images/ditu.jpg",
                //    Title = "周边门店信息",
                //    Url = yuming + "/weixin/lbs/index.aspx?x=" + requestMessage.Location_X + "&y=" + requestMessage.Location_Y + "&wid=" + apiid + "&openid=" + requestMessage.FromUserName
                //});

                //中间n条信息 ,图文消息个数,限制为10条以内,所以中间控制最多8条信息
                for (int i = 0; i < shopList.Count; i++)
                {
                    if (i == 8)
                    {
                        break;
                    }
                    Model.wx_lbs_shopInfo shop = shopList[i];
                    string pUrl = "";
                    if (shop.shopLogo == null || shop.shopLogo.Trim() == "")
                    {
                        // pUrl = yuming + "/lbsinfo/images/logo.jpg";
                    }
                    else
                    {
                        pUrl = yuming + shop.shopLogo;
                    }
                    responseMessage.Articles.Add(new Article()
                    {
                        Title       = shop.shopName + "\n 地址:" + shop.detailAddr + "\n电话:" + shop.telphone,
                        Description = shop.shopName + "分店信息",
                        PicUrl      = pUrl,
                        Url         = yuming + "/weixin/lbs/detailAddr.aspx?shopid=" + shop.id + "&x=" + requestMessage.Location_X + "&y=" + requestMessage.Location_Y + "&wid=" + apiid + "&openid=" + requestMessage.FromUserName
                    });
                }

                //最后一条信息
                responseMessage.Articles.Add(new Article()
                {
                    Title = "更多门店>>",
                    Url   = yuming + "/weixin/lbs/index.aspx?x=" + requestMessage.Location_X + "&y=" + requestMessage.Location_Y + "&wid=" + apiid + "&openid=" + requestMessage.FromUserName
                });

                return(responseMessage);
            }
        }