Exemplo n.º 1
0
        protected void rpResult_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var rpOtherPrice = (Repeater)e.Item.FindControl("rpOtherPrice");

            var pageIndex = WebUtility.GetRequestInt("page", 1);
            var pageSize = Utility.GetInt(Request["pagesize"], 20, 5, 40);
            var userid = WebUtility.GetRequestInt("userid", 0);

            var pois = new GeoSearchBLL().Local<ADeeWu.HuoBi3J.Libary.LBSHelper.ProductContent>(
                ADee.Project.LBS.Common.ConfigHelper.GeoProductTableID,
                "",
                AccountHelper.City,
                pageIndex - 1,
                pageSize,
                "",
                "Price:1",
                string.Format("CreateUserID:[{0}]", userid));
            rpOtherPrice.DataSource = pois.contents;
            rpOtherPrice.DataBind();

            var Pager1 = (Pager3)e.Item.FindControl("Pager1");
            if (Pager1 == null) return;
            Pager1.AppendUrlParam("userid", userid.ToString());
            Pager1.PageSize = (int)pageSize;
            Pager1.PageIndex = (int)pageIndex;
            Pager1.TotalRecords = (int)pois.total;
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var kids = new List<string>();
                var index = 0;
                var totalIndex = 0;
                var geoSearchBLL = new GeoSearchBLL();
                while (true)
                {
                    var productContents = geoSearchBLL.Local<LBSHelper.ProductContent>(ADee.Project.LBS.Common.ConfigHelper.GeoProductTableID, "", "", index, 50, "", "", string.Format("CreateUserID:{0},{0}", LoginUser.UserID));
                    kids.AddRange(productContents.contents.Select(p => p.uid).ToList());

                    if (index == 0 && productContents.total > 0)
                    {
                        totalIndex = productContents.total / 50;
                        if (productContents.total % 50 != 0) totalIndex++;
                    }

                    if (index + 1 >= totalIndex) break;
                    index++;
                }

                if (kids.Any())
                {
                    BandWeak(kids);
                    BandMonth(kids);
                }
            }
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var salemanuserid = WebUtility.GetRequestInt("userid", 0);

                var geoSearchBLL = new GeoSearchBLL();
                var productContents = geoSearchBLL.Local<LBSHelper.ProductContent>(ADee.Project.LBS.Common.ConfigHelper.GeoProductTableID, "", AccountHelper.City, 0, 500, "", "", string.Format("CreateUserID:{0},{0}", salemanuserid));
                var kids = productContents.contents.Select(p => p.uid).ToList();

                if (kids.Any())
                {
                    BandWeak(kids);
                    BandMonth(kids);
                }
            }
        }
Exemplo n.º 4
0
        private void Search()
        {
            var pageIndex = WebUtility.GetRequestInt("page", 1);
            var pageSize = Utility.GetInt(Request["pagesize"], 10, 5, 40);

            var selectType = WebUtility.GetRequestStr("selectType", "");
            var selectSize = WebUtility.GetRequestStr("selectSize", "");
            var selectPrice = WebUtility.GetRequestStr("selectPrice", "");
            var keyword = WebUtility.GetRequestStr("keyword", "");

            rpKey.DataSource = new DAL.Key().GetEntityList("", new string[] { "kid" }, new object[] { kid });
            rpKey.DataBind();

            litType.Text = "<li class='item'><a href='key4product.aspx?kid=" + kid + "&selectType=&selectSize=" + selectSize + "&selectPrice=" + selectPrice + "' class='selectPrice'>全部</a></li>";
            litSize.Text = "<li class='item'><a href='key4product.aspx?kid=" + kid + "&selectType=" + selectType + "&selectSize=&selectPrice=" + selectPrice + "' class='selectPrice'>全部</a></li>";
            litPrice.Text = "<li class='item'><a href='key4product.aspx?kid=" + kid + "&selectType=" + selectSize + "&selectSize=" + selectSize + "&selectPrice=' class='selectPrice'>全部</a></li>";

            var attributes = new DAL.Key_Attribute().GetEntityList("", new string[] { "kid" }, new object[] { kid });
            if (attributes != null)
            {
                litType.Text += string.Join("", attributes.Where(p => p.DataType == "SelectType").Select(p => string.Format("<li class='item'><a href='key4product.aspx?kid={0}&selectType={4}-{1}&selectSize={2}&selectPrice={3}' class='selectPrice' title='{1}'>{1}</a></li>", kid, p.DataValue, selectSize, selectPrice, p.ID)));
                litSize.Text += string.Join("", attributes.Where(p => p.DataType == "SelectSize").Select(p => string.Format("<li class='item'><a href='key4product.aspx?kid={0}&selectType={1}&selectSize={4}-{2}&selectPrice={3}' class='selectPrice' title='{2}'>{2}</a></li>", kid, selectType, p.DataValue, selectPrice, p.ID)));
                litPrice.Text += string.Join("", attributes.Where(p => p.DataType == "SelectPrice").Select(p => string.Format("<li class='item'><a href='key4product.aspx?kid={0}&selectType={1}&selectSize={2}&selectPrice={4}-{3}' class='selectPrice' title='{3}'>{3}</a></li>", kid, selectType, selectSize, p.DataValue, p.ID)));
            }

            var filter = string.Format("KID:{0},{0}", kid);
            if (!string.IsNullOrWhiteSpace(selectType))
            {
                var id = Utility.GetInt(selectType.Split(new char[] { '-' }).FirstOrDefault(), 0);
                if (id > 0)
                    filter += string.Format("|SelectTypeID:{0},{0}", id);
            }
            if (!string.IsNullOrWhiteSpace(selectPrice))
            {
                var id = Utility.GetInt(selectPrice.Split(new char[] { '-' }).FirstOrDefault(), 0);
                if (id > 0)
                    filter += string.Format("|SelectPriceID:{0},{0}", id);
            }
            if (!string.IsNullOrWhiteSpace(selectSize))
            {
                var id = Utility.GetInt(selectSize.Split(new char[] { '-' }).FirstOrDefault(), 0);
                if (id > 0)
                    filter += string.Format("|SelectSizeID:{0},{0}", id);
            }

            var geoSearchBLL = new GeoSearchBLL();
            var productContents = geoSearchBLL.Local<LBSHelper.ProductContent>(ADee.Project.LBS.Common.ConfigHelper.GeoProductTableID, keyword, AccountHelper.City, pageIndex - 1, pageSize, keyword, "Price:1", filter);
            rpProduct.DataSource = productContents.contents;
            rpProduct.DataBind();

            this.Pager1.AppendUrlParam("kid", kid.ToString());
            this.Pager1.AppendUrlParam("selectType", selectType);
            this.Pager1.AppendUrlParam("selectSize", selectSize);
            this.Pager1.AppendUrlParam("selectPrice", selectPrice);
            this.Pager1.AppendUrlParam("keyword", keyword);
            this.Pager1.PageSize = (int)pageSize;
            this.Pager1.PageIndex = (int)pageIndex;
            this.Pager1.TotalRecords = productContents.total;
        }
Exemplo n.º 5
0
        /// <summary>
        /// 搜索报价,http://mobile.huobi3j.com/product/searchproduct
        /// </summary>
        /// <param name="kid">关键字ID</param>
        /// <param name="lat">所在位置LAT</param>
        /// <param name="lng">所在位置LNG</param>
        /// <param name="typeid">报价类型ID</param>
        /// <param name="priceid">报价范围ID</param>
        /// <param name="sizeid">报价其他信息ID</param>
        /// <param name="radius">半径,默认1000</param>
        /// <param name="sort">排序方式,默认Price</param>
        /// <param name="desc">升降序,默认asc,可选desc</param>
        /// <param name="pageindex">页码,默认1</param>
        /// <param name="pagesize">页容量,默认10</param>
        /// <returns></returns>
        //[OutputCache(Duration = 3600, VaryByParam = "keyword;lat;lng;type;price;size;radius;sort;desc;pageindex,pagesize")]
        public ActionResult SearchProduct(int? kid, double lat, double lng, string typeid, string priceid, string sizeid, int radius = 1000, string sort = "Price", string desc = "asc", int pageindex = 1, int pagesize = 10)
        {
            var filter = "";
            if (kid.HasValue && kid.Value > 0)
            {
                filter += string.Format("|KID:[{0}]", kid);
            }
            if (!string.IsNullOrWhiteSpace(typeid))
            {
                filter += string.Format("|SelectTypeID:[{0}]", typeid);
            }
            if (!string.IsNullOrWhiteSpace(priceid))
            {
                filter += string.Format("|SelectPriceID:[{0}]", priceid);
            }
            if (!string.IsNullOrWhiteSpace(sizeid))
            {
                filter += string.Format("|SelectSizeID:[{0}]", sizeid);
            }
            if (filter.StartsWith("|")) filter = filter.Substring(1);

            var sortby = "";
            if (!string.IsNullOrWhiteSpace(sort))
            {
                sortby = sort + ":1";
                if (desc == "desc")
                {
                    sortby = sort + ":0";
                }
            }

            var geoSearchBLL = new GeoSearchBLL();

            var productGeoSearchResult = geoSearchBLL.NearBy<ADeeWu.HuoBi3J.Libary.LBSHelper.ProductContent>(ADee.Project.LBS.Common.ConfigHelper.GeoProductTableID, "", lat, lng, radius, pageindex - 1, pagesize, "", sortby, filter);

            return GetJson(productGeoSearchResult);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 获取商家的报价信息,http://mobile.huobi3j.com/product/getproductofsaleman
        /// </summary>
        /// <param name="userid">用户ID</param>
        /// <param name="pageindex">页码</param>
        /// <param name="pagesize">页容量</param>
        /// <returns></returns>
        //[OutputCache(Duration = 3600, VaryByParam = "userid;pageindex;pagesize")]
        public ActionResult GetProductOfSaleMan(int userid, int pageindex = 0, int pagesize = 10, string sort = "Price", string desc = "asc")
        {
            if (userid == 0) return Json(new JsonResponse { status = false, message = "参数有误!" });

            var sortby = "";
            if (!string.IsNullOrWhiteSpace(sort))
            {
                sortby = sort + ":1";
                if (desc == "desc")
                {
                    sortby = sort + ":0";
                }
            }

            var pois = new GeoSearchBLL().Local<ADeeWu.HuoBi3J.Libary.LBSHelper.ProductContent>(
                ADee.Project.LBS.Common.ConfigHelper.GeoProductTableID,
                "",
                "",
                pageindex,
                pagesize,
                "",
                sortby,
                string.Format("CreateUserID:[{0},{0}]", userid)).contents;

            return GetJson(pois);
        }
Exemplo n.º 7
0
        private void SaleManProduct()
        {
            var userid = WebUtility.GetRequestInt("salemanuserid", 0);
            if (userid <= 0) return;

            var pageIndex = WebUtility.GetRequestInt("page", 1);
            var pageSize = Utility.GetInt(Request["pagesize"], 10, 5, 20);

            var pois = new GeoSearchBLL().Local<ADeeWu.HuoBi3J.Libary.LBSHelper.ProductContent>(
                ADee.Project.LBS.Common.ConfigHelper.GeoProductTableID,
                "",
                "",
                pageIndex - 1,
                pageSize,
                "",
                "Price:1",
                string.Format("CreateUserID:[{0}]", userid));
            rpProduct.DataSource = pois.contents;
            rpProduct.DataBind();

            Pager1.AppendUrlParam("salemanuserid", userid.ToString());
            Pager1.PageSize = (int)pageSize;
            Pager1.PageIndex = (int)pageIndex;
            Pager1.TotalRecords = (int)pois.total;
        }