Ejemplo n.º 1
0
        public static void Upload(AccountType account, ISession NSession)
        {
            ApiContext context = AppSettingHelper.GetGenericApiContext("US");

            context.ApiCredential.eBayToken = account.ApiToken;
            AddMemberMessageRTQCall   addMsgApicall = new AddMemberMessageRTQCall(context);
            ReviseMyMessagesCall      revMsgApicall = new ReviseMyMessagesCall(context);
            IList <EbayMessageReType> list          = NSession.CreateQuery("from EbayMessageReType where IsUpload<>'1'").List <EbayMessageReType>();

            if (list.Count != 0)
            {
                foreach (var item in list)
                {
                    MemberMessageType mm = new MemberMessageType();
                    mm.SenderID        = item.SenderID;
                    mm.SenderEmail     = item.SenderEmail;
                    mm.MessageID       = item.EbayId;
                    mm.Body            = item.BodyRe;
                    mm.ParentMessageID = item.EbayId;

                    addMsgApicall.AddMemberMessageRTQ(item.ItemId, mm);
                    revMsgApicall.ReviseMyMessages(true, false, new StringCollection(new string[] { mm.MessageID }));

                    item.IsUpload = 1;
                }
            }
        }
		public void AddMemberMessagesAAQToBidder()
		{
			AddMemberMessagesAAQToBidderCall api = new AddMemberMessagesAAQToBidderCall(apiContext);
			AddMemberMessagesAAQToBidderRequestContainerTypeCollection msgs = new AddMemberMessagesAAQToBidderRequestContainerTypeCollection();
			api.AddMemberMessagesAAQToBidderRequestContainerList = msgs;
			AddMemberMessagesAAQToBidderRequestContainerType msg = new AddMemberMessagesAAQToBidderRequestContainerType();
			msgs.Add(msg);
			msg.CorrelationID = "TestCorrelationID";
			msg.ItemID = "1111111111";
			MemberMessageType memberMsg = new MemberMessageType();
			msg.MemberMessage = memberMsg;
			memberMsg.Subject = "SDK Sanity Test ASQ";
			memberMsg.Body = "SDK sanity test body";
			memberMsg.DisplayToPublic = false; memberMsg.DisplayToPublicSpecified = true;
			memberMsg.EmailCopyToSender = false; memberMsg.EmailCopyToSenderSpecified = true;
			memberMsg.HideSendersEmailAddress = true; memberMsg.HideSendersEmailAddressSpecified = true;
			memberMsg.MessageType = MessageTypeCodeType.ContactEbayMember;
			memberMsg.QuestionType = QuestionTypeCodeType.General;
			memberMsg.RecipientID = new StringCollection();
			memberMsg.RecipientID.Add(TestData.ApiUserID);
			// Make API call.
			ApiException gotException = null;
			// Negative test.
			try {
			api.Execute();
			} catch (ApiException ex) {
				gotException = ex;
			}
			Assert.IsNotNull(gotException);
			
		}
Ejemplo n.º 3
0
        /// <summary>
        /// Enables a buyer and seller in an order relationship to
        /// send messages to each other's My Messages Inboxes.
        /// </summary>
        ///
        /// <param name="ItemID">
        /// Unique identifier for the listing that is being discussed between the two order partners.
        /// </param>
        ///
        /// <param name="MemberMessage">
        /// This container holds the message, and includes the subject, message body, and other details related to the message.
        /// </param>
        ///
        public void AddMemberMessageAAQToPartner(string ItemID, MemberMessageType MemberMessage)
        {
            this.ItemID        = ItemID;
            this.MemberMessage = MemberMessage;

            Execute();
        }
        public void AddMemberMessageRTQ()
        {
            AddMemberMessageRTQCall api = new AddMemberMessageRTQCall(apiContext);

            MemberMessageType memberMsg = new MemberMessageType();

            memberMsg.Subject                 = "SDK Sanity Test ASQ";
            memberMsg.Body                    = "SDK sanity test body";
            memberMsg.DisplayToPublic         = false; memberMsg.DisplayToPublicSpecified = true;
            memberMsg.EmailCopyToSender       = false; memberMsg.EmailCopyToSenderSpecified = true;
            memberMsg.HideSendersEmailAddress = true; memberMsg.HideSendersEmailAddressSpecified = true;
            memberMsg.MessageType             = MessageTypeCodeType.ContactEbayMember;
            memberMsg.QuestionType            = QuestionTypeCodeType.General;
            memberMsg.RecipientID             = new StringCollection();
            memberMsg.ParentMessageID         = "1234";
            memberMsg.RecipientID.Add(TestData.ApiUserID);
            // Make API call.
            ApiException gotException = null;

            // Negative test.
            try {
                api.AddMemberMessageRTQ("1111111111", memberMsg);
            } catch (ApiException ex) {
                gotException = ex;
            }
            Assert.IsNotNull(gotException);
        }
        public void AddMemberMessageRTQ()
        {
            AddMemberMessageRTQCall api = new AddMemberMessageRTQCall(apiContext);

            MemberMessageType memberMsg = new MemberMessageType();
            memberMsg.Subject = "SDK Sanity Test ASQ";
            memberMsg.Body = "SDK sanity test body";
            memberMsg.DisplayToPublic = false; memberMsg.DisplayToPublicSpecified = true;
            memberMsg.EmailCopyToSender = false; memberMsg.EmailCopyToSenderSpecified = true;
            memberMsg.HideSendersEmailAddress = true; memberMsg.HideSendersEmailAddressSpecified = true;
            memberMsg.MessageType = MessageTypeCodeType.ContactEbayMember;
            memberMsg.QuestionType = QuestionTypeCodeType.General;
            memberMsg.RecipientID = new StringCollection();
            memberMsg.ParentMessageID = "1234";
            memberMsg.RecipientID.Add(TestData.ApiUserID);
            // Make API call.
            ApiException gotException = null;
            // Negative test.
            try {
            api.AddMemberMessageRTQ("1111111111", memberMsg);
            } catch (ApiException ex) {
                gotException = ex;
            }
            Assert.IsNotNull(gotException);
        }
        public void AddMemberMessagesAAQToBidder()
        {
            AddMemberMessagesAAQToBidderCall api = new AddMemberMessagesAAQToBidderCall(apiContext);
            AddMemberMessagesAAQToBidderRequestContainerTypeCollection msgs = new AddMemberMessagesAAQToBidderRequestContainerTypeCollection();

            api.AddMemberMessagesAAQToBidderRequestContainerList = msgs;
            AddMemberMessagesAAQToBidderRequestContainerType msg = new AddMemberMessagesAAQToBidderRequestContainerType();

            msgs.Add(msg);
            msg.CorrelationID = "TestCorrelationID";
            msg.ItemID        = "1111111111";
            MemberMessageType memberMsg = new MemberMessageType();

            msg.MemberMessage                 = memberMsg;
            memberMsg.Subject                 = "SDK Sanity Test ASQ";
            memberMsg.Body                    = "SDK sanity test body";
            memberMsg.DisplayToPublic         = false; memberMsg.DisplayToPublicSpecified = true;
            memberMsg.EmailCopyToSender       = false; memberMsg.EmailCopyToSenderSpecified = true;
            memberMsg.HideSendersEmailAddress = true; memberMsg.HideSendersEmailAddressSpecified = true;
            memberMsg.MessageType             = MessageTypeCodeType.ContactEbayMember;
            memberMsg.QuestionType            = QuestionTypeCodeType.General;
            memberMsg.RecipientID             = new StringCollection();
            memberMsg.RecipientID.Add(TestData.ApiUserID);
            // Make API call.
            ApiException gotException = null;

            // Negative test.
            try {
                api.Execute();
            } catch (ApiException ex) {
                gotException = ex;
            }
            Assert.IsNotNull(gotException);
        }
		/// <summary>
		/// Enables a seller to reply to a question about an active item listing.
		/// </summary>
		/// 
		/// <param name="ItemID">
		/// The unique ID of the item about which the question was asked. This field
		/// is not required in the request, if the request includes a RecipientID
		/// in the MemberMessage container.
		/// </param>
		///
		/// <param name="MemberMessage">
		/// Container for the message. Includes the message body (which should answer
		/// the question that an eBay user asks you (the seller) about an active
		/// listing), plus other values related to the message.
		/// </param>
		///
		public void AddMemberMessageRTQ(string ItemID, MemberMessageType MemberMessage)
		{
			this.ItemID = ItemID;
			this.MemberMessage = MemberMessage;

			Execute();
			
		}
Ejemplo n.º 8
0
        public void UploadEmailByAPI(SaleAccountType account)
        {
            ApiContext context = AppSettingHelper.GetGenericApiContext("US");
            context.ApiCredential.eBayToken = account.ApiToken;
            List<EmailRepliedType> result = EmailRepliedType.find("IsToEbay = 0 AND SaleAccount = '"+account.UserName+"'").list();

            AddMemberMessageRTQCall addMsgApicall = new AddMemberMessageRTQCall(context);
            ReviseMyMessagesCall revMsgApicall = new ReviseMyMessagesCall(context);

            foreach (EmailRepliedType er in result)
            {
                MemberMessageType mm = new MemberMessageType();
                mm.MessageID = er.MessageID;
                mm.Body = er.Body;
                mm.Subject = er.Subject;
                mm.SenderID = er.BuyerAccount;
                mm.SenderEmail = er.BuyerEmail;
                mm.ParentMessageID = er.MessageID;

                addMsgApicall.AddMemberMessageRTQ(er.ItemID, mm);
                revMsgApicall.ReviseMyMessages(true, false, new StringCollection(new string[] { mm.MessageID }));

                er.IsToEbay = true;
                er.ToEbayOn = DateTime.Now;
                er.RepliedSpaceHour = (er.ToEbayOn - er.ReceiveOn).TotalHours;
                er.update();
            }
        }
        public static void Upload(AccountType account, ISession NSession)
        {
            ApiContext context = AppSettingHelper.GetGenericApiContext("US");
            context.ApiCredential.eBayToken = account.ApiToken;
            AddMemberMessageRTQCall addMsgApicall = new AddMemberMessageRTQCall(context);
            ReviseMyMessagesCall revMsgApicall = new ReviseMyMessagesCall(context);
            IList<EbayMessageReType> list = NSession.CreateQuery("from EbayMessageReType where IsUpload<>'1'").List<EbayMessageReType>();
            if (list.Count != 0)
            {
                foreach (var item in list)
                {
                    MemberMessageType mm = new MemberMessageType();
                    mm.SenderID = item.SenderID;
                    mm.SenderEmail = item.SenderEmail;
                    mm.MessageID = item.EbayId;
                    mm.Body = item.BodyRe;
                    mm.ParentMessageID = item.EbayId;

                    addMsgApicall.AddMemberMessageRTQ(item.ItemId, mm);
                    revMsgApicall.ReviseMyMessages(true, false, new StringCollection(new string[] { mm.MessageID }));

                    item.IsUpload = 1;
                }
            }
        }