Exemplo n.º 1
0
        public void GetSalesOrderHeaderCollectionWithLinqTest()
        {
            var actual = SalesOrderQueries.GetSalesOrderHeaderCollectionWithLinq(FromDate, ToDate, FirstName, LastName, OrderID, OrderNumber, CityName, StateName, CountryName, Zip, maxNumberOfItemsToReturn, prefetch);

            Assert.AreEqual(maxNumberOfItemsToReturn, actual.Count);
            //Assert.IsNotNull(actual[0].CustomerViewRelated);
        }
Exemplo n.º 2
0
        private void searchWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            e.Result = checkBoxUseLinq.Checked ? SalesOrderQueries.GetSalesOrderHeaderCollectionWithLinq(
                _fromDate,
                _toDate,
                _firstName,
                _lastName,
                _orderID,
                _orderName,
                _cityName,
                _state,
                _country,
                _zip,
                _maxNumberOfItemsToReturn,
                _prefetch
                ) : SalesOrderQueries.GetSalesOrderHeaderCollection(
                _fromDate,
                _toDate,
                _firstName,
                _lastName,
                _orderID,
                _orderName,
                _cityName,
                _state,
                _country,
                _zip,
                _maxNumberOfItemsToReturn,
                _prefetch);
            // Do not access the form's BackgroundWorker reference directly.
            // Instead, use the reference provided by the sender parameter.
            var bw = sender as BackgroundWorker;

            // If the operation was canceled by the user,
            // set the DoWorkEventArgs.Cancel property to true.
            if (bw != null && bw.CancellationPending)
            {
                e.Cancel = true;
            }
        }