Example #1
0
        private void btnAmazonOrders_Click(object sender, EventArgs e)
        {
            AmazonServiceClient mwsOrders = new AmazonServiceClient();

            DateTime FromDate = DateTime.Now.AddDays(-3).Date;

            DateTime ToDate = DateTime.Now.AddMinutes(-10).Date;

            AmazonOrderOptions orderOptions = new AmazonOrderOptions(FromDate, ToDate);

            ExternalOrderResult result = mwsOrders.GetOrders(orderOptions);

            if (result.Success)
            {
                MessageBox.Show("Success");
            }
        }
        public ExternalOrderResult GetUnshippedOrders(OrderSearchOptions orderOptions)
        {
            IOrderOptions extOrderOptions = null;
            IExternalStoreService externalService = null;

            if (orderOptions.StoreProvider == StoreProviderTypeEnum.eBay)
            {
                externalService = new eBayServiceCall();

                extOrderOptions = new eBayOrderOptions(orderOptions.FromDate, orderOptions.ToDate);

            }

            if (orderOptions.StoreProvider == StoreProviderTypeEnum.Amazon)
            {
                externalService = new AmazonServiceClient();

                extOrderOptions = new AmazonOrderOptions(orderOptions.FromDate, orderOptions.ToDate);
            }

            ExternalOrderResult orderResult = externalService.GetOrders(extOrderOptions);

            int serialNo = 0;

            //if (orderResult.Success)
            //{
            //    foreach (ExternalOrder extOrder in orderResult.Orders)
            //    {
            //        {
            //            serialNo += 1;
            //            ExternalOrderViewModel extOrderVM = new ExternalOrderViewModel(extOrder);

            //            extOrderVM.SerialNo = serialNo;

            //            vmResult.ExternalOrderViewModels.Add(extOrderVM);
            //        }
            //    }

            //    vmResult.Success = true;
            //}

            return orderResult;
        }