/// <summary>
    /// 增加活动图片到店铺分类
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Button1_Click(object sender, EventArgs e)
    {
        string appkey = "12159997";
        string secret = "614e40bfdb96e9063031d1a9e56fbed5";
        string name   = utils.NewRequest("left", utils.RequestType.Form);
        string istop  = utils.NewRequest("leftimgistop", utils.RequestType.Form);
        int    order  = 0;


        //保存到数据库
        string sql = "UPDATE TopAutoReview SET leftimgname = '" + name + "', leftimgistop = '" + istop + "' WHERE nick = '" + nick + "'";

        utils.ExecuteNonQuery(sql);

        //通过接口同步到淘宝
        TopXmlRestClient clientaa = new TopXmlRestClient("http://gw.api.taobao.com/router/rest", appkey, secret);

        //左侧分类的图片位置默认在最下面,获取当前序列号最大的
        SellercatsListGetRequest request1 = new SellercatsListGetRequest();

        request1.Nick   = nick;
        request1.Fields = "name,sort_order,parent_cid";
        PageList <SellerCat> cat = clientaa.SellercatsListGet(request1, session);

        if (cat.Content.Count == 0)
        {
            order = 1;
        }
        else
        {
            int max = 0;
            for (int i = 0; i < cat.Content.Count; i++)
            {
                if (cat.Content[i].ParentCid == 0 && cat.Content[i].SortOrder > max)
                {
                    max = cat.Content[i].SortOrder;
                }
            }
            order = max + 1;
        }

        //判断该店铺是否增加过该分类
        string isok  = "0";
        string catid = string.Empty;

        for (int i = 0; i < cat.Content.Count; i++)
        {
            if (cat.Content[i].Name == "好评有礼_特特营销")
            {
                isok  = "1";
                catid = cat.Content[i].Cid.ToString();
                break;
            }
        }

        if (isok == "0")
        {
            //添加到左侧分类
            SellercatsListAddRequest request = new SellercatsListAddRequest();
            request.Name      = "好评有礼_特特营销";
            request.PictUrl   = GetTaobaoImg(name, "left");
            request.SortOrder = order;
            clientaa.SellercatsListAdd(request, session);
        }
        else
        {
            //更新分类图片
            SellercatsListUpdateRequest request = new SellercatsListUpdateRequest();
            request.Cid     = int.Parse(catid);
            request.PictUrl = GetTaobaoImg(name, "left");
            clientaa.SellercatsListUpdate(request, session);
        }


        Response.Write("<script>alert('同步成功!');window.location.href='html.aspx';</script>");
        Response.End();
        return;
    }