Пример #1
0
 public void Read(TProtocol iprot)
 {
     TField field;
     iprot.ReadStructBegin();
     while (true)
     {
       field = iprot.ReadFieldBegin();
       if (field.Type == TType.Stop) {
     break;
       }
       switch (field.ID)
       {
     case 1:
       if (field.Type == TType.List) {
     {
       Request = new List<GetTranslateItemConvertingRequest>();
       TList _list81 = iprot.ReadListBegin();
       for( int _i82 = 0; _i82 < _list81.Count; ++_i82)
       {
         GetTranslateItemConvertingRequest _elem83 = new GetTranslateItemConvertingRequest();
         _elem83 = new GetTranslateItemConvertingRequest();
         _elem83.Read(iprot);
         Request.Add(_elem83);
       }
       iprot.ReadListEnd();
     }
       } else {
     TProtocolUtil.Skip(iprot, field.Type);
       }
       break;
     default:
       TProtocolUtil.Skip(iprot, field.Type);
       break;
       }
       iprot.ReadFieldEnd();
     }
     iprot.ReadStructEnd();
 }
Пример #2
0
        private Dictionary<string, object> GeteBaySuggestedCategory(int siteId, string lcategoryNm, string mcategoryNm, string scategoryNm, string srcNo, string srcName)
        {
            var req = new GetTranslateItemConvertingRequest
            {
                ServiceName = "GMKT",
                SiteID = siteId,
                InventoryID = srcNo,
                Title = srcName,
                CategoryIDList = new List<string>
                {
                    lcategoryNm,
                    mcategoryNm,
                    scategoryNm
                }
            };
            var res = new ItemService(UrlConst.Instance.CBT_GEPAPI_URL + "/api/Outbound_ItemService").GetTranslateItemConverting(
                new List<GetTranslateItemConvertingRequest> { req }
                );

            Dictionary<string, object> resultDic = new Dictionary<string, object>();
            foreach (var data in res.Response)
            {
                resultDic.Add("category", data.CategoryID);
                resultDic.Add("name", data.Title);
                resultDic.Add("categoryPathOriginal", data.CategoryPathOriginal == null ? "" : data.CategoryPathOriginal);
            }
            return resultDic;
        }