public List<ParcelMessage> ConvertEbayMessages(GetMemberMessagesResponseType messages) { List<ParcelMessage> newMessages = new List<ParcelMessage>(); foreach (MemberMessageExchangeType message in messages.MemberMessage) { ParcelMessage newMessage = new ParcelMessage(); newMessage.Subject = message.Question.Subject; newMessage.Text = message.Question.Body; newMessage.Date = message.CreationDate; newMessage.Status = message.MessageStatus == MessageStatusTypeCodeType.Answered ? "Answered" : "Pending"; newMessages.Add(newMessage); } return newMessages; }
private string GetMessageText(string note, string date) { if (string.IsNullOrEmpty(note) == false) { List<ParcelMessage> messages = new List<ParcelMessage>(); ParcelMessage message = new ParcelMessage(); message.Subject = "-"; message.Date = DateTime.Parse(date); message.Text = note; messages.Add(message); return Common.Serialize(messages); } else return null; }