Exemple #1
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);
                }
            }
        }
        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);
                }
            }
        }
Exemple #3
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;
        }