private GoodsParams initParams() { GoodsParams param = new GoodsParams(); param.pageindex =Convert.ToInt32(Request.Form["pageindex"]); param.pagesize = Convert.ToInt32(Request.Form["pagesize"]); param.lng = Convert.ToDouble(Request.Form["lng"]); param.lat = Convert.ToDouble(Request.Form["lat"]); param.lowprice = Convert.ToInt32(Request.Form["lowprice"]); param.highprice = Convert.ToInt32(Request.Form["highprice"]); param.lowprice = Convert.ToInt32(Request.Form["lowprice"]); return param; }
public string GetAllList(GoodsParams param) { string jsonstr = ""; try { var list1 = GetAllCampaign(param); var list2 = GetAllHparty(param); List<object> newlist = CombineList(list1, list2); jsonstr = ReturnJson.toJson("100", "成功", newlist); } catch (Exception e) { jsonstr = ReturnJson.toJson("101", "失败", -1); } return jsonstr; }
/// <summary> /// 获取全部——可分页——未登录 /// </summary> /// <param name="pageIndex">页数</param> /// <param name="pageSize">每页个数</param> /// <param name="lng">经度</param> /// <param name="lat">纬度</param> /// <param name="location">地区</param> /// <returns></returns> public List<GoodInfoForList> GetAllHparty(GoodsParams param) { List<GoodInfoForList> newlist = null; int halfpagesize = param.pagesize / 2; string jsonstr = ""; try { var list = entity.hp_hparty.OrderBy(o => o.id).Skip(halfpagesize * (param.pageindex - 1)).Take(halfpagesize).ToList(); newlist = initGoodInfoList(list); } catch (Exception e) { jsonstr = ReturnJson.toJson("101", "失败", -1); } return newlist; }