Beispiel #1
0
        /// <summary>
        /// Calculates the statistics for the Northwind database and shows them in the form, utilizing the remote service for the actual work.
        /// </summary>
        /// <remarks>No error checking is applied to this routine, it's for illustrating the framework functionality.</remarks>
        private void CalculateStatistics()
        {
            var statistics = _dalService.GetStatistics();

            _amountCustomersTextBox.Text        = statistics.NumberOfCustomers.ToString();
            _highestOrderPriceTextBox.Text      = statistics.MaxOrderPrice.ToString("C");
            _averageOrderPriceTextBox.Text      = statistics.AverageOrderPrice.ToString("C");
            _highestOrderCustomerTextBox.Text   = statistics.MaxOrderCustomerCompanyName;
            _customerIdOfCustomerWithMaxOrder   = statistics.MaxOrderCustomerCustomerId;
            _mostOrdersPerCustomerTextBox.Text  = statistics.MostOrdersForOneCustomer.ToString();
            _mostOrdersCustomerTextBox.Text     = statistics.MostOrdersCustomerCompanyName;
            _customerIdOfCustomerWithMostOrders = statistics.MostOrdersCustomerCustomerId;
        }