/// <summary> /// 生成旅游天数的链接 /// </summary> /// <returns></returns> protected string CreateDaysSearchLink() { string link = "<a href='{0}' class='{1}'>{2}</a>"; LineSearchInfo model = CurrentSearchInfo; StringBuilder sb = new StringBuilder(); for (int i = 0; i <= 10; i++) { string title = i + "天"; if (i == 0) { title = "不限"; } if (i == 10) { title += "以上"; } model.Days = i; string href = LineSearch.CreateQueryParas(model); string reqVal = Request.QueryString["days"]; if (reqVal.IsNullOrEmpty()) { reqVal = "0"; } string cls = reqVal == i.ToString() ? "selected" : ""; sb.AppendLine(string.Format(link, href, cls, title)); } return(sb.ToString()); }
/// <summary> /// 生成单价区间的搜索链接 /// </summary> /// <param name="value"></param> /// <param name="title"></param> /// <returns></returns> protected string CreateFixPriceSearchLink(string value, string title) { string link = "<a href='{0}' class='{1}'>{2}</a>"; LineSearchInfo model = CurrentSearchInfo; model.FixPrice = value.ToArrowInt(); model.MinCustomPrice = 0M; model.MaxCustomPrice = 0M; string href = LineSearch.CreateQueryParas(model); string reqVal = Request.QueryString["fprice"]; if (reqVal.IsNullOrEmpty()) { reqVal = "0"; } string cls = reqVal == value ? "selected" : ""; link = string.Format(link, href, cls, title); return(link); }
/// <summary> /// 价格 /// </summary> /// <returns></returns> protected string CreatePriceSort() { string downArrow = "sort-category-2"; string upArrow = "sort-category-1"; string doubleArrow = "sort-category-3"; LineSearchInfo model = CurrentSearchInfo; int priceSort = Request.QueryString["pricesort"].ToArrowInt(); string css = doubleArrow; if (priceSort == 0) { css = doubleArrow; model.PriceSort = 1; model.SellSort = 0; model.NewSort = 0; } else if (priceSort == 1) { css = downArrow; model.PriceSort = -1; model.SellSort = 0; model.NewSort = 0; } else if (priceSort == -1) { css = upArrow; model.PriceSort = 1; model.SellSort = 0; model.NewSort = 0; } string href = LineSearch.CreateQueryParas(model); string link = "<a class='sort-item {0}' href='{1}'>价格</a>"; link = string.Format(link, css, href); return(link); }