public OrderDetailInfoResponse getOrderById(OrderDetailInfoRequest orderFilter, string token)
        {
            OrderInfoService orderDetail = new OrderInfoService(AppRuntime.MarketWebClient, "api/v1/orders/details");

            orderDetail.SetToken = token;

            var result = orderDetail.GetOrderDetail(orderFilter).Result;

            return(result);
        }
Example #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            this.Title = string.Format(TitleOrderId);

            requestService = new OrderDetailInfoRequest()
            {
                OrderId     = OrderId,
                SessionInfo = new SessionInfoRequest()
                {
                    TokenSession = AppSecurity.securityToken.SessionId
                }
            };

            var resultOrder = AppRuntime.MarketData.getOrderById(requestService, AppSecurity.securityToken.Token);

            AppSecurity.hasExpired(resultOrder.SessionInfoResponse, this);

            List <OrderItemInfo> listOrders = new List <OrderItemInfo>();

            if (resultOrder.ServiceResponseStatus.IsSuccess)
            {
                orderDetail = resultOrder.OrderDetailInfo;
                listOrders  = orderDetail.ItemsInfo;
            }

            OrdersDetailCollectionViewSource ordersS = new OrdersDetailCollectionViewSource(listOrders, this);

            OrderDetailCollectionView.Source = ordersS;
            OrdersDetailDelegateFlowLayout ordersDelegateFlowLayout = new OrdersDetailDelegateFlowLayout(listOrders, this);

            OrderDetailCollectionView.Delegate = ordersDelegateFlowLayout;
            OrderDetailCollectionView.ReloadData();

            SubtotalLabel.Text = orderDetail.TotalInfo.SubTotal.ToString("C");
            ImpuestoLabel.Text = orderDetail.TotalInfo.Taxes.ToString("C");
            TotalLabel.Text    = orderDetail.TotalInfo.Total.ToString("C");

            loadFirstSegment();

            if (orderDetail.Invoice != null)
            {
                btnInvoice.TouchUpInside += (sender, e) => {
                    UIApplication.SharedApplication.OpenUrl(new NSUrl(orderDetail.Invoice.CFDI));
                };
            }
        }