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; }
/// <summary> /// 获取关键字的属性 /// </summary> /// <param name="kid">kid</param> /// <returns></returns> public ActionResult GetKeywordAttribute(int kid) { var attributes = new DAL.Key_Attribute().GetEntityList("", new string[] { "kid" }, new object[] { kid }); if (attributes != null) { return GetJson(new { ktype = attributes.Where(p => p.DataType == "SelectType").Select(p => new { id = p.ID, name = p.DataValue }), kprice = attributes.Where(p => p.DataType == "SelectPrice").Select(p => new { id = p.ID, name = p.DataValue }), kother = attributes.Where(p => p.DataType == "SelectSize").Select(p => new { id = p.ID, name = p.DataValue }), }); } return GetJson(new { ktype = "", kprice = "", kother = "" }); }
private void Search() { var kid = WebUtility.GetRequestInt("kid", -1); var id = WebUtility.GetRequestInt("id", -1); if (kid == -1 || id == -1) { WebUtility.ShowAndGoBack(this, "参数有误!"); return; } if (LoginUser == null) { WebUtility.ShowMsg(this, "请登录!", "/login.aspx?url=" + Request.RawUrl); return; } var productPoi = new PoiBLL().Details<ADeeWu.HuoBi3J.Libary.LBSHelper.ProductPoi>(id, ADee.Project.LBS.Common.ConfigHelper.GeoProductTableID).poi; litTitle.Text = productPoi.title; litPrice.Text = productPoi.Price.ToString("F2"); var key = new DAL.Key().GetEntity(kid); litKey.Text = key.Name; var attributes = new DAL.Key_Attribute().GetEntityList("", new string[] { "kid" }, new object[] { kid }); ddlType.DataSource = attributes.Where(p => p.DataType == "SelectType").Select(p => new { ID = p.ID, Value = p.DataValue }); ddlType.DataTextField = "Value"; ddlType.DataValueField = "ID"; ddlType.DataBind(); ddlType.AppendDataBoundItems = true; ddlType.Items.Insert(0, new ListItem("")); ddlPrice.DataSource = attributes.Where(p => p.DataType == "SelectPrice").Select(p => new { ID = p.ID, Value = p.DataValue }); ddlPrice.DataTextField = "Value"; ddlPrice.DataValueField = "ID"; ddlPrice.DataBind(); ddlPrice.AppendDataBoundItems = true; ddlPrice.Items.Insert(0, new ListItem("")); ddlSize.DataSource = attributes.Where(p => p.DataType == "SelectSize").Select(p => new { ID = p.ID, Value = p.DataValue }); ddlSize.DataTextField = "Value"; ddlSize.DataValueField = "ID"; ddlSize.DataBind(); ddlSize.AppendDataBoundItems = true; ddlSize.Items.Insert(0, new ListItem("")); var viewPrice = new DAL.Key_ViewPrice().GetEntity(new string[] { "KID" }, new object[] { kid }); if (viewPrice != null && viewPrice.ID > 0) litmsg.Text = string.Format("该关键字每次点击扣费 {0} 元,每条信息当天点击 量达到 {1} 次后当日不再计费!", viewPrice.Price.Value.ToString("0.00"), viewPrice.Count); else litmsg.Text = "当前该关键字的报价点击免费"; }