コード例 #1
0
        public ActionResult VerifyShopifyOrder(string orderNameOrId)
        {
            var identity = HttpContext.GetIdentity();

            _instanceContext.InitializeShopify();

            var jsonByName   = _shopifyOrderApi.RetrieveByName(orderNameOrId);
            var ordersByName = jsonByName.DeserializeToOrderList().orders;

            if (ordersByName.Count > 0)
            {
                return(new JsonNetResult(MakeOrderVerification(ordersByName.First())));
            }

            if (orderNameOrId.IsLong())
            {
                var jsonById  = _shopifyOrderApi.Retrieve(orderNameOrId.ToLong());
                var orderById = jsonById.DeserializeToOrderParent().order;
                if (orderById != null)
                {
                    return(new JsonNetResult(orderById));
                }
            }

            return(new JsonNetResult(OrderVerification.Empty()));
        }
コード例 #2
0
        private OrderVerification MakeOrderVerification(Order order)
        {
            var output = new OrderVerification();

            output.ShopifyOrderId           = order.id;
            output.ShopifyOrderName         = order.name;
            output.ShopifyOrderCreatedAtUtc = order.created_at.ToUniversalTime().DateTime.ToString();
            output.ShopifyOrderHref         = _shopifyUrlService.ShopifyOrderUrl(order.id);

            return(output);
        }
 private void BtnSelect_Click(object sender, RoutedEventArgs e)
 {
     //  if (dgShowClients.SelectedItem != null)
     {
         // if (dgShowClients.SelectedItem is ClientDataGridVM)
         {
             ClientVM          client = (dgShowClients.SelectedItem as ClientVM);
             OrderVerification window = new OrderVerification(new OrderVM {
                 Car = _order.Car, Client = client
             });
             window.ShowDialog();
         }
     }
 }