/// <summary>
        /// eBay에 리스팅후 결과를 반환한다.
        /// </summary>
        /// <param name="data">eBay 리스팅 대기상품</param>
        /// <returns></returns>
        private ResultSet SetListItem(eBayItemsData data)
        {
            ResultSet result = new ResultSet();
            try
            {
                TaInfo taInfo = new BizDac.TaInfoBiz().FindTaUser(data.ta);
                var queryTainfo = (from t in taInfo.accounts
                                   where ((int)t.site_id) == data.site
                                   select t).ToList();

                //사이트 정보가 없으면 에러
                if (queryTainfo.Count() == 0)
                {
                    result.isResult = false;
                    result.Message = "사이트 정보가 없습니다";
                    return result;
                }

                ListItemRequest req = new ListItemRequest();

                //등록과 재등록을 구분해 준다.
                if (String.IsNullOrEmpty(data.itemno))
                {
                    logger.Info("forSeller listing id : " + data._id);

                    req = new ListItemRequest
                        {
                            EbayItemInfo = CreateJsonData(data)
                            ,
                            EbayTokenID = queryTainfo[0].token
                            ,
                            InventoryID = data._id.ToString()
                            ,
                            SiteID = data.site
                            ,
                            ItemID = ""
                        };
                }
                else
                {
                    logger.Info("forSeller relisting id : " + data._id);

                    req = new ListItemRequest
                    {
                        EbayItemInfo = CreateJsonData(data)
                        ,
                        EbayTokenID = queryTainfo[0].token
                        ,
                        InventoryID = data._id.ToString()
                        ,
                        SiteID = data.site

                        ,ItemID = data.itemno.ToString()
                    };
                }

                var res = new ItemService(apiUrl).ListItem
            (req);

                result.eBayResponse = res.Response;
                if (res.Ack == AckType.Failure)
                {
                    result.isResult = false;
                    result.Message = "eBay 리스팅에 실패했습니다.";
                }
                else
                {
                    result.isResult = true;
                }
            }
            catch (Exception ex)
            {
                result.Message = ex.Message.ToString();
            }

            return result;
        }
Exemple #2
0
 public ListItemResponse ListItem(ListItemRequest Request)
 {
     return GetClient().ListItem(Request);
 }
 public void send_ListItem(ListItemRequest Request)
 {
     oprot_.WriteMessageBegin(new TMessage("ListItem", TMessageType.Call, seqid_));
     ListItem_args args = new ListItem_args();
     args.Request = Request;
     args.Write(oprot_);
     oprot_.WriteMessageEnd();
     oprot_.Transport.Flush();
 }
 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<ListItemRequest>();
       TList _list85 = iprot.ReadListBegin();
       for( int _i86 = 0; _i86 < _list85.Count; ++_i86)
       {
         ListItemRequest _elem87 = new ListItemRequest();
         _elem87 = new ListItemRequest();
         _elem87.Read(iprot);
         Request.Add(_elem87);
       }
       iprot.ReadListEnd();
     }
       } else {
     TProtocolUtil.Skip(iprot, field.Type);
       }
       break;
     default:
       TProtocolUtil.Skip(iprot, field.Type);
       break;
       }
       iprot.ReadFieldEnd();
     }
     iprot.ReadStructEnd();
 }
 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.Struct) {
     Request = new ListItemRequest();
     Request.Read(iprot);
       } else {
     TProtocolUtil.Skip(iprot, field.Type);
       }
       break;
     default:
       TProtocolUtil.Skip(iprot, field.Type);
       break;
       }
       iprot.ReadFieldEnd();
     }
     iprot.ReadStructEnd();
 }
 public ListItemResponse ListItem(ListItemRequest Request)
 {
     send_ListItem(Request);
     return recv_ListItem();
 }