コード例 #1
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));
                };
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (btnInvoice != null)
            {
                btnInvoice.Dispose();
                btnInvoice = null;
            }

            if (ButtonsHeightConstraint != null)
            {
                ButtonsHeightConstraint.Dispose();
                ButtonsHeightConstraint = null;
            }

            if (ButtonsView != null)
            {
                ButtonsView.Dispose();
                ButtonsView = null;
            }

            if (ImpuestoLabel != null)
            {
                ImpuestoLabel.Dispose();
                ImpuestoLabel = null;
            }

            if (KeyOneLabel != null)
            {
                KeyOneLabel.Dispose();
                KeyOneLabel = null;
            }

            if (KeyThreeLabel != null)
            {
                KeyThreeLabel.Dispose();
                KeyThreeLabel = null;
            }

            if (KeyTwoLabel != null)
            {
                KeyTwoLabel.Dispose();
                KeyTwoLabel = null;
            }

            if (OptionsSegment != null)
            {
                OptionsSegment.Dispose();
                OptionsSegment = null;
            }

            if (OrderDetailCollectionView != null)
            {
                OrderDetailCollectionView.Dispose();
                OrderDetailCollectionView = null;
            }

            if (PdfButton != null)
            {
                PdfButton.Dispose();
                PdfButton = null;
            }

            if (SubtotalLabel != null)
            {
                SubtotalLabel.Dispose();
                SubtotalLabel = null;
            }

            if (TotalLabel != null)
            {
                TotalLabel.Dispose();
                TotalLabel = null;
            }

            if (ValueOneLabel != null)
            {
                ValueOneLabel.Dispose();
                ValueOneLabel = null;
            }

            if (ValueThreeLabel != null)
            {
                ValueThreeLabel.Dispose();
                ValueThreeLabel = null;
            }

            if (ValueTwoLabel != null)
            {
                ValueTwoLabel.Dispose();
                ValueTwoLabel = null;
            }
        }