Beispiel #1
0
        private void GetOrders()
        {
            MainModuleServiceClient client = new MainModuleServiceClient();

            client.GetPagedOrdersAsync(new PagedCriteria()
            {
                PageIndex = 0, PageCount = 100
            });


            client.GetPagedOrdersCompleted += delegate(object sender, GetPagedOrdersCompletedEventArgs e)
            {
                if (!e.Cancelled && e.Error == null)
                {
                    List <Order> orders = new List <Order>();

                    foreach (var item in e.Result)
                    {
                        orders.Add(item);
                    }

                    if (orders != null)
                    {
                        this.Orders = orders;
                        CollectionViewSource collectionViewSource = new CollectionViewSource();
                        collectionViewSource.Source = orders;
                        ICollectionView collectionView = collectionViewSource.View;
                        this._viewData        = collectionView;
                        this._viewData.Filter = null;
                    }
                }
                else
                {
                    MessageBox.Show(e.Error.Message, "Orders List", MessageBoxButton.OK);
                }
            };
        }
        private void GetOrders()
        {

            MainModuleServiceClient client = new MainModuleServiceClient();

            client.GetPagedOrdersAsync(new PagedCriteria() { PageIndex = 0, PageCount = 100 });


            client.GetPagedOrdersCompleted += delegate(object sender, GetPagedOrdersCompletedEventArgs e)
            {
                if (!e.Cancelled && e.Error == null)
                {
                    List<Order> orders = new List<Order>();

                    foreach (var item in e.Result)
                    {
                        orders.Add(item);
                    }

                    if (orders != null)
                    {
                        this.Orders = orders;
                        CollectionViewSource collectionViewSource = new CollectionViewSource();
                        collectionViewSource.Source = orders;
                        ICollectionView collectionView = collectionViewSource.View;
                        this._viewData = collectionView;
                        this._viewData.Filter = null;
                    }
                }
                else
                    MessageBox.Show(e.Error.Message, "Orders List", MessageBoxButton.OK);
            };

        }