/// <summary>
        /// Sets the given customer as the current customer, adding values of the customer to the controls on the form and setting
        /// up eventhandlers so the gui is aware of changes of the customer or its contents.
        /// </summary>
        /// <param name="customer"></param>
        private void SetCustomerAsCurrent(CustomerEntity customer)
        {
            if (_currentCustomer != null)
            {
                // first remove the eventhandlers from the current object
                _currentCustomer.PropertyChanged    -= new PropertyChangedEventHandler(_currentCustomer_PropertyChanged);
                _currentCustomer.Orders.ListChanged -= new ListChangedEventHandler(Orders_ListChanged);
            }

            if (_ordersCManager != null)
            {
                // remove the currency manager.
                _ordersCManager.PositionChanged -= new EventHandler(_ordersCManager_PositionChanged);
                _ordersCManager = null;
            }

            // set new customer object.
            _currentCustomer = customer;

            // set sorter for orders. This sorter will be applied in all Order retrievals from now on for this object.
            _currentCustomer.SetCollectionParametersOrders(0, _orderSorter);

            // bind the customer to the gui elements.
            BindCustomerToGui();

            refreshOrdersButton.Enabled = true;
        }