Index: ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/details/EmployeeDetailUserControl.vb =================================================================== diff -u -r1721 -r1723 --- ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/details/EmployeeDetailUserControl.vb (.../EmployeeDetailUserControl.vb) (revision 1721) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/details/EmployeeDetailUserControl.vb (.../EmployeeDetailUserControl.vb) (revision 1723) @@ -46,7 +46,7 @@ ''' Public Function RefreshData() As Boolean Implements IEmployeeDetailUserControl.RefreshData Try - LoadEmployee + LoadEmployee() Return True Catch ex As Exception Return False Index: ActiviteitenOpvolging/ActiviteitenOpvolging/ActiviteitenOpvolgingForm.vb =================================================================== diff -u -r1721 -r1723 --- ActiviteitenOpvolging/ActiviteitenOpvolging/ActiviteitenOpvolgingForm.vb (.../ActiviteitenOpvolgingForm.vb) (revision 1721) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/ActiviteitenOpvolgingForm.vb (.../ActiviteitenOpvolgingForm.vb) (revision 1723) @@ -143,12 +143,17 @@ ''' Public Sub SelectEmployee(employeeIndex As Integer, employee As IEmployee) Implements IEmployeesMainForm.SelectEmployee + 'Call function in dc. _domainController.SelectEmployee(employeeIndex, employee) + 'Update all employee user controls. + _employeeUserControls.ForEach(Sub(employeeUserControl) employeeUserControl.RefreshData()) End Sub ''' Public Sub DeselectEmployee(employeeIndex As Integer) Implements IEmployeesMainForm.DeselectEmployee _domainController.DeselectEmployee(employeeIndex) + 'Update all employee user controls. + _employeeUserControls.ForEach(Sub(employeeUserControl) employeeUserControl.RefreshData()) End Sub ''' Index: ActiviteitenOpvolging/ActiviteitenOpvolging/domain/managers/implementations/EmployeeManager.vb =================================================================== diff -u -r1721 -r1723 --- ActiviteitenOpvolging/ActiviteitenOpvolging/domain/managers/implementations/EmployeeManager.vb (.../EmployeeManager.vb) (revision 1721) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/domain/managers/implementations/EmployeeManager.vb (.../EmployeeManager.vb) (revision 1723) @@ -17,7 +17,7 @@ 'Select the employees from the collection of all employees, which are not selected yet. 'The employees are compared on their initials in lowercase. Return New HashSet(Of IEmployee)(_employees.Where(Function(employee) _ - Not _selectedEmployeesDictionary.Any(Function(selectedEmployee) _ + Not _selectedEmployeesDictionary.Values.Any(Function(selectedEmployee) _ employee.Equals(selectedEmployee)))) End Get End Property Index: ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/EmployeeUserControl.vb =================================================================== diff -u -r1721 -r1723 --- ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/EmployeeUserControl.vb (.../EmployeeUserControl.vb) (revision 1721) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/EmployeeUserControl.vb (.../EmployeeUserControl.vb) (revision 1723) @@ -4,6 +4,8 @@ Implements IEmployeeUserControl, IEmployeeDetailParentUserControl, IEmployeePickerParentUserControl Private ReadOnly _parentForm As IEmployeesMainForm + Private _currentUserControl As IRefreshableUserControl + Private ReadOnly Property EmployeeIndex As Integer Private Sub New() @@ -62,8 +64,8 @@ ''' Public Function RefreshData() As Boolean Implements IEmployeeUserControl.RefreshData Try - 'todo Call helper method. - + 'Refresh the data on the current user control. + _currentUserControl.RefreshData() 'Refresh succesfull. Return True Catch ex As Exception @@ -131,7 +133,9 @@ ''' Swtich to another user control on the screen. ''' ''' - Private Sub SwitchUserControl(userControl As UserControl) + Private Sub SwitchUserControl(Of T As {IRefreshableUserControl, UserControl})(userControl As T) + 'Set current user control. + _currentUserControl = userControl 'Remove the current user control from the screen. UserControlPanel.Controls.Clear() 'Set the properties of the user control. Index: ActiviteitenOpvolging/ActiviteitenOpvolging/screens/DataGridViewUserControl.vb =================================================================== diff -u -r1721 -r1723 --- ActiviteitenOpvolging/ActiviteitenOpvolging/screens/DataGridViewUserControl.vb (.../DataGridViewUserControl.vb) (revision 1721) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/screens/DataGridViewUserControl.vb (.../DataGridViewUserControl.vb) (revision 1723) @@ -100,22 +100,22 @@ End Try End Sub - Private isInitialLoad As Boolean = True + Private _isInitialLoad As Boolean = True ''' ''' Fetch the data and fill the data grid view with it. ''' Private Sub LoadGrid() 'Load all work items. LoadWorkItems() - If isInitialLoad Then + If _isInitialLoad Then 'Update headers and visibility of static columns. This only happens once. UpdateStaticColumns() 'Generate grid columns for the activities of the work items. This only happens once. GenerateActivityColumns(_workItems) - isInitialLoad = False + _isInitialLoad = False End If 'Clear grid.