public GetOrderResponse InvokeGetOrder(ServiceCliamDefinition serviceCliamDefinition, string orderId) { // Create a request. GetOrderRequest request = new GetOrderRequest(); request.SellerId = serviceCliamDefinition.SellerId; request.MWSAuthToken = serviceCliamDefinition.AuthToken; List <string> amazonOrderId = new List <string>(); amazonOrderId.Add(orderId); request.AmazonOrderId = amazonOrderId; return(client.GetOrder(request)); }
public static ListOrdersResponse InvokeListOrdersByDateTime(ServiceCliamDefinition serviceCliamDefinition, DateTime createdAfterDateTime, DateTime createdBeforeDateTime) { ListOrdersRequest request = new ListOrdersRequest() { SellerId = serviceCliamDefinition.SellerId, MWSAuthToken = serviceCliamDefinition.AuthToken, CreatedAfter = createdAfterDateTime, CreatedBefore = createdBeforeDateTime }; List <string> marketplaceId = new List <string>(); marketplaceId.Add(serviceCliamDefinition.MarketplaceId); request.MarketplaceId = marketplaceId; request.MaxResultsPerPage = 100; return(GetClient(serviceCliamDefinition).ListOrders(request)); }
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 ListOrdersResponse InvokeListOrders(ServiceCliamDefinition serviceCliamDefinition) { // Create a request. ListOrdersRequest request = new ListOrdersRequest(); request.SellerId = serviceCliamDefinition.SellerId; request.MWSAuthToken = serviceCliamDefinition.AuthToken; DateTime createdAfter = new DateTime(2017, 7, 19); request.CreatedAfter = createdAfter; /*DateTime createdBefore = new DateTime(); * request.CreatedBefore = createdBefore; * DateTime lastUpdatedAfter = new DateTime(); * request.LastUpdatedAfter = lastUpdatedAfter; * DateTime lastUpdatedBefore = new DateTime(); * request.LastUpdatedBefore = lastUpdatedBefore; * List<string> orderStatus = new List<string>(); * request.OrderStatus = orderStatus;*/ List <string> marketplaceId = new List <string>(); marketplaceId.Add("ATVPDKIKX0DER"); request.MarketplaceId = marketplaceId; /*List<string> fulfillmentChannel = new List<string>(); * request.FulfillmentChannel = fulfillmentChannel; * List<string> paymentMethod = new List<string>(); * request.PaymentMethod = paymentMethod; * string buyerEmail = "example"; * request.BuyerEmail = buyerEmail; * string sellerOrderId = "example"; * request.SellerOrderId = sellerOrderId; * decimal maxResultsPerPage = 1; * request.MaxResultsPerPage = maxResultsPerPage; * List<string> tfmShipmentStatus = new List<string>(); * request.TFMShipmentStatus = tfmShipmentStatus;*/ return(GetClient(serviceCliamDefinition).ListOrders(request)); }
private static void ExecuteSaveOrderCollectionStatment(ServiceCliamDefinition serviceCliamDefinition, DataAccess dataAccess, string statment, OrderCollection orderCollection) { foreach (Order order in orderCollection) { using (SqlCommand command = new SqlCommand()) { command.CommandText = statment; command.CommandType = CommandType.Text; command.Connection = dataAccess.Connection; command.Parameters.AddWithValue("@orderID", order.OrderId); command.Parameters.AddWithValue("@emailAddress", order.Email); command.Parameters.AddWithValue("@asin", order.Item.ASIN); command.Parameters.AddWithValue("@customerName", order.Name); command.Parameters.AddWithValue("@amount", order.Amount); command.Parameters.AddWithValue("@itemTitle", order.Item.Title); command.Parameters.AddWithValue("@purchaseDate", order.PurchaseDate); command.Parameters.AddWithValue("@sellerId", serviceCliamDefinition.SellerId); command.Parameters.AddWithValue("@emailStatus", 0); command.ExecuteNonQuery(); } } }
public static OrderCollection InvokeListOrdersDetailByNextDate(ServiceCliamDefinition serviceCliamDefinition) { OrderCollection orderCollection = null; try { if (serviceCliamDefinition != null) { if (serviceCliamDefinition.LastInvokeDateTime == DateTime.MaxValue) { throw new TTekException("You do not have Last Invoke Date Time Value", ExceptionType.LastInvokeDateTimeNotSet); } DateTime createdBeforeDateTime = DateTime.Now.AddMinutes(-2); orderCollection = InvokeListOrdersDetailByDateTime(serviceCliamDefinition, serviceCliamDefinition.LastInvokeDateTime, createdBeforeDateTime); serviceCliamDefinition.LastInvokeDateTime = createdBeforeDateTime; } } catch (Exception ex) { orderCollection = new OrderCollection(); orderCollection.AddError(ex); } return(orderCollection); }
public MainUIView(ServiceCliamDefinition serviceCliamDefinition) { this._serviceCliamDefinition = serviceCliamDefinition; InitializeComponent(); }
public SetLastInvokeDateTimeView(ServiceCliamDefinition serviceCliamDefinition) { this._serviceCliamDefinition = serviceCliamDefinition; InitializeComponent(); }
public EmailContextView(ServiceCliamDefinition serviceCliamDefinition) { this._serviceCliamDefinition = serviceCliamDefinition; InitializeComponent(); }
public LogInView(ServiceCliamDefinition serviceCliamDefinition) { this._serviceCliaimDefinition = serviceCliamDefinition; InitializeComponent(); }