Exemplo n.º 1
0
        protected void btnTest_Click(object sender, EventArgs e)
        {
            string q = GB2312ToUTF8(txtQ.Text);// Server.UrlEncode(txtQ.Text);
            ItemFacade facade = new ItemFacade(defaultAppKey, defaultAppSecret);
            TOPDataList<ItemListItem> list;
            try
            {
                if (ddlQueryType.SelectedValue.Equals("key", StringComparison.OrdinalIgnoreCase))
                {
                    list = facade.QueryItemListByKey(q);
                }
                else
                {
                    list = facade.QueryItemListByNicks(q.Split(','));
                }

                lblItemCount.Text = string.Format("{0}条记录", list.TotalResultNum);
            }
            catch (ResponseException ex)
            {
                Response.Write(ex.Message + " - " + ex.ErrorCode + " - " + ex.ErrorDescription);
                list = null;
                lblItemCount.Text = "0条记录";
            }
            repeater.DataSource = list;
            repeater.DataBind();
        }
Exemplo n.º 2
0
 public void TestQuerySkuListByNicks_测试()
 {
     ItemFacade facade = new ItemFacade(defaultAppKey, defaultAppSecret);
     TOPDataList<ItemListItem> itemList = facade.QueryItemListByNicks("jimmy422");
     Assert.IsTrue(itemList.Count > 0);
 }