public static OrderCollection InvokeListOrdersDetailByDateTime(ServiceCliamDefinition serviceCliamDefinition, DateTime createdAfterDateTime, DateTime createdBeforeDateTime) { if (serviceCliamDefinition == null) { return(new OrderCollection()); } OrderCollection orderCollection = new OrderCollection(); XmlDocument xOrderList = getListOrdersByDateTimeXmlData(serviceCliamDefinition, createdAfterDateTime, createdBeforeDateTime); XmlNodeList orderList = xOrderList.GetElementsByTagName("Order"); foreach (XmlNode order in orderList) { DataExchangeService.Order orderDetail = new DataExchangeService.Order(); foreach (XmlNode informationType in order) { GetBasicOrderInformation(informationType, orderDetail); } if (orderDetail.Email != null && !orderDetail.Email.Equals(String.Empty)) { GetDetailOrderInformation(serviceCliamDefinition, orderDetail); if (orderDetail != null) { orderCollection.Add(orderDetail); } } } return(orderCollection); }
public static void GetBasicOrderInformation(XmlNode informationType, DataExchangeService.Order orderDetail) { if (informationType.Name == "AmazonOrderId") { orderDetail.OrderId = informationType.InnerText; } if (informationType.Name == "BuyerEmail") { orderDetail.Email = informationType.InnerText; } if (informationType.Name == "PurchaseDate") { orderDetail.PurchaseDate = DateTime.ParseExact(informationType.InnerText, "MM/dd/yyyy HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture); } if (informationType.Name == "ShippingAddress") { foreach (XmlNode inforType in informationType) { if (inforType.Name == "Name") { orderDetail.Name = inforType.InnerText; } } } if (informationType.Name == "OrderTotal") { foreach (XmlNode inforType in informationType) { if (inforType.Name == "Amount") { orderDetail.Amount = (float)Convert.ToDouble(inforType.InnerText); } } } }
private static DataExchangeService.Order GetDetailOrder(ServiceCliamDefinition serviceCliamDefinition, string orderId, string buyerEmail, string name) { DataExchangeService.Order orderDetail = new DataExchangeService.Order(); orderDetail.OrderId = orderId; orderDetail.Email = buyerEmail; orderDetail.Name = name; XmlDocument xOrder = GetListOrderItemsXmlData(serviceCliamDefinition, orderId); orderDetail.Item.ASIN = xOrder.GetElementsByTagName("ASIN")[0].InnerText; orderDetail.Item.Title = xOrder.GetElementsByTagName("Title")[0].InnerText; return(orderDetail); }
public static OrderCollection InvokeListOrdersDetailByDateTime(ServiceCliamDefinition serviceCliamDefinition, DateTime createdAfterDateTime, DateTime createdBeforeDateTime) { OrderCollection orderCollection = new OrderCollection(); XmlDocument xOrderList = getListOrdersByDateTimeXmlData(serviceCliamDefinition, createdAfterDateTime, createdBeforeDateTime); XmlNodeList orderList = xOrderList.GetElementsByTagName("Order"); foreach (XmlNode order in orderList) { string orderId = String.Empty; string buyerEmail = String.Empty; string name = String.Empty; foreach (XmlNode informationType in order) { if (informationType.Name == "AmazonOrderId") { orderId = informationType.InnerText; } if (informationType.Name == "BuyerEmail") { buyerEmail = informationType.InnerText; } if (informationType.Name == "ShippingAddress") { foreach (XmlNode inforType in informationType) { if (inforType.Name == "Name") { name = inforType.InnerText; } } } } if (!buyerEmail.Equals(String.Empty)) { DataExchangeService.Order orderDetail = GetDetailOrder(serviceCliamDefinition, orderId, buyerEmail, name); orderCollection.Add(orderDetail); } } return(orderCollection); }
public static void GetDetailOrderInformation(ServiceCliamDefinition serviceCliamDefinition, DataExchangeService.Order orderDetail) { XmlDocument xOrder = GetListOrderItemsXmlData(serviceCliamDefinition, orderDetail.OrderId); string ASIN = xOrder.GetElementsByTagName("ASIN")[0].InnerText; orderDetail.Item.ASIN = ASIN; orderDetail.Item.Title = xOrder.GetElementsByTagName("Title")[0].InnerText; }