void submitData(string lname, string content) { //jd_union_goods_jingfen_query_response ////if(JdGoodsQueryClass.Inited == false)//一定要检查是否完全初始化,才能查询 ////{ //// answerMsg("很抱歉,尚未完成初始化!请稍候再提交请求!"); //// return; ////} Dictionary <string, JdGoodSummayInfoItemClass> ret = JdGoodsQueryClass.QueryWeb(lname, 5); //string strRet = string.Join("\r\n", ret.Select(a => a.Value.getFullContent())); if (ret == null || ret.Count == 0) { answerMsg("很抱歉,无法找到您要查找的券!请尝试修改下其他条件查找!"); return; } foreach (JdGoodSummayInfoItemClass ji in ret.Values) { ji.shortLinkFunc = getShortLink; ji.commissionUrl = ji.getShortLink(); answerMsg(ji.imgageUrl, null, null, true, true); answerMsg(ji.getFullContent(ji.discount != "0") + ji.commissionUrl); } answerMsg(string.Format(@"{0} 更多优惠请{2}或移步到武府乐购网站{1}获取!", "", JdGoodsQueryClass.NavigateUrl, JdGoodsQueryClass.MyPublic)); }
private void button1_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; JdGoodsQueryClass.LoadPromotionGoodsinfo = this.getInfoBySukIds; Dictionary <string, JdGoodSummayInfoItemClass> ret = JdGoodsQueryClass.QueryWeb(this.txt_ask.Text, 10); List <string> retStrs = ret.Select(a => { //a.Value.commissionUrl = a.Value.getMyUrl(null); if (a.Value.commissionUrl == null) { return(null); } return(a.Value.getFullContent(!string.IsNullOrEmpty(a.Value.commissionUrl))); }).ToList(); string strRet = string.Join("\r\n", retStrs.Where(a => string.IsNullOrEmpty(a) == false)); this.txt_answer.Text = strRet; this.Cursor = Cursors.Default; }