Пример #1
0
        public int SeteBayAccountInfo(SeteBayAccountInfoRequest Request)
        {
            int returnValue = 0;
            logger.InfoFormat("Request UserID : {0}", Request.ToString());

            logger.Info(string.Format("eBayToken {0}, eBayUserId {1}, expireDate{2}, userId{3}", Request.EbayTokenID, Request.EbayUserID, Request.ExpireDate, Request.UserID));
            if (Request == null) return 0;

            if (string.IsNullOrEmpty(Request.UserID) == true) return 0;
            if (Request.EbayTokenID.Equals(0)) return 0;

            try
            {
                CBT.GEP.Data.TaInfo taInfo = new CBT.GEP.BizDac.TaInfoBiz().FindTaUser(Request.UserID);
                if (taInfo != null)
                {
                    new CBT.GEP.BizDac.TaInfoBiz().TaAccountUpsert(Request.UserID, "ebay", Request.EbayUserID, Request.EbayTokenID.ToString(), CBT.GEP.Common.Util.Util.GetSafeDateTime(Request.ExpireDate));
                    returnValue = 1;
                }
                else
                {
                    returnValue = 0;
                }
            }
            catch (Exception ex)
            {
                returnValue = 0;

                ThriftException tException =  new ThriftException();
                tException.ExceptionCode= 3;
                tException.ExceptionMessage = ex.ToString();

                logger.Error(string.Format("[Exception!!]\nUserID : {0}\neBay ID : {1}\n{2}", Request.UserID, Request.EbayUserID, ex.StackTrace));
                //logger.Error(ex.Message);
                throw tException;
            }

            return returnValue;
        }
Пример #2
0
        public void SeteBayAccountInfo(string UserID, string eBayID, string eBayToken, string dateString)
        {
            string host = "localhost";
            int port = 60030;
            int timeout = 10 * 1000;

            TSocket socket = new TSocket(host, port, timeout);
            TProtocol protocol = new TBinaryProtocol(socket);
            Inbound_ItemService.Client client = new Inbound_ItemService.Client(protocol);

            try
            {
                socket.Open();
            }
            catch (Exception ex)
            {
                Console.WriteLine("Socket Open [NG]!!");
                throw new Exception(ex.ToString());
            }
            Console.WriteLine("Socket Open [OK]!!");

            SeteBayAccountInfoRequest Request = new SeteBayAccountInfoRequest();
            Request.UserID = UserID;
            Request.EbayUserID = eBayID;
            Request.EbayTokenID = eBayToken;
            Request.ExpireDate = dateString;

            try
            {
                int seteBayAccountInfo = client.SeteBayAccountInfo(Request);
                System.Console.WriteLine(string.Format("Result is {0}\n", seteBayAccountInfo));
            }
            catch (ThriftException ex)
            {
                System.Console.WriteLine(string.Format("ThriftException!! : {0} ", ex.ExceptionMessage));
            }
            catch (Exception ex)
            {
                System.Console.WriteLine(string.Format("Exception!! : {0} ", ex.ToString()));
            }

            socket.Close();
        }
Пример #3
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.Struct) {
     Request = new SeteBayAccountInfoRequest();
     Request.Read(iprot);
       } else {
     TProtocolUtil.Skip(iprot, field.Type);
       }
       break;
     default:
       TProtocolUtil.Skip(iprot, field.Type);
       break;
       }
       iprot.ReadFieldEnd();
     }
     iprot.ReadStructEnd();
 }
Пример #4
0
 public int SeteBayAccountInfo(SeteBayAccountInfoRequest Request)
 {
     send_SeteBayAccountInfo(Request);
     return recv_SeteBayAccountInfo();
 }
Пример #5
0
 public void send_SeteBayAccountInfo(SeteBayAccountInfoRequest Request)
 {
     oprot_.WriteMessageBegin(new TMessage("SeteBayAccountInfo", TMessageType.Call, seqid_));
     SeteBayAccountInfo_args args = new SeteBayAccountInfo_args();
     args.Request = Request;
     args.Write(oprot_);
     oprot_.WriteMessageEnd();
     oprot_.Transport.Flush();
 }