Index: ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/implementations/activity state/ActivityState.vb =================================================================== diff -u -r1737 -r1743 --- ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/implementations/activity state/ActivityState.vb (.../ActivityState.vb) (revision 1737) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/implementations/activity state/ActivityState.vb (.../ActivityState.vb) (revision 1743) @@ -3,16 +3,7 @@ Public Activity As IActivity - Dim _employee As IEmployee Protected Property CurrentEmployee As IEmployee - Set(value As IEmployee) - _employee = value - _employee.CurrentActivity = Activity - End Set - Get - Return _employee - End Get - End Property ''' ''' The for the current state. Index: ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/IEmployee.vb =================================================================== diff -u -r1735 -r1743 --- ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/IEmployee.vb (.../IEmployee.vb) (revision 1735) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/IEmployee.vb (.../IEmployee.vb) (revision 1743) @@ -1,6 +1,6 @@ Public Interface IEmployee Property PersonelNumber As Integer - 'Property Picture As Image + Property Picture As String Property FirstName As String Property LastName As String Property Initials As String Index: ActiviteitenOpvolging/ActiviteitenOpvolging/domain/managers/implementations/WorkItemManager.vb =================================================================== diff -u -r1736 -r1743 --- ActiviteitenOpvolging/ActiviteitenOpvolging/domain/managers/implementations/WorkItemManager.vb (.../WorkItemManager.vb) (revision 1736) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/domain/managers/implementations/WorkItemManager.vb (.../WorkItemManager.vb) (revision 1743) @@ -7,14 +7,14 @@ End Function Public Sub StartActivity(activity As IActivity, employee As IEmployee) Implements IWorkItemManager.StartActivity - Throw New NotImplementedException("Activity start...") + activity.StartActivity(employee) End Sub Public Sub FinishActivity(activity As IActivity) Implements IWorkItemManager.FinishActivity - Throw New NotImplementedException("Activity finish...") + activity.FinishActivity() End Sub Public Sub StopActivity(activity As IActivity) Implements IWorkItemManager.StopActivity - Throw New NotImplementedException("Activity stop...") + activity.StopActivity() End Sub End Class Index: ActiviteitenOpvolging/ActiviteitenOpvolging/screens/IEmployeesMainForm.vb =================================================================== diff -u -r1736 -r1743 --- ActiviteitenOpvolging/ActiviteitenOpvolging/screens/IEmployeesMainForm.vb (.../IEmployeesMainForm.vb) (revision 1736) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/screens/IEmployeesMainForm.vb (.../IEmployeesMainForm.vb) (revision 1743) @@ -25,7 +25,7 @@ ''' The selected employee if there is one. 'Nothing' if there wasn't one. Function GetSelectedEmployee(employeeIndex As Integer) As IEmployee - Sub StartActivity(employee As IEmployee) - Sub FinishActivity() - Sub StopActivity() + Sub StartActivity(employeeIndex As integer) + Sub FinishActivity(employeeIndex As integer) + Sub StopActivity(employeeIndex As integer) End Interface Index: ActiviteitenOpvolging/ActiviteitenOpvolging/domain/controllers/IDomainController.vb =================================================================== diff -u -r1736 -r1743 --- ActiviteitenOpvolging/ActiviteitenOpvolging/domain/controllers/IDomainController.vb (.../IDomainController.vb) (revision 1736) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/domain/controllers/IDomainController.vb (.../IDomainController.vb) (revision 1743) @@ -43,10 +43,10 @@ ''' Collection of the work items Function GiveWorkItems(workPostIndex As Integer) As ICollection(Of IWorkItem) - Sub StartActivity(activity As IActivity, employee As IEmployee) + Sub StartActivity(activity As IActivity, employeeNumber As Integer) - Sub FinishActivity(activity As IActivity) + Sub FinishActivity(employeeNumber As Integer) - Sub StopActivity(activity As IActivity) + Sub StopActivity(employeeNumber As Integer) #End Region End Interface Index: ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/implementations/Employee.vb =================================================================== diff -u -r1735 -r1743 --- ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/implementations/Employee.vb (.../Employee.vb) (revision 1735) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/implementations/Employee.vb (.../Employee.vb) (revision 1743) @@ -4,6 +4,7 @@ Implements IEmployee Public Property PersonelNumber As Integer Implements IEmployee.PersonelNumber + Public Property Picture As String Implements IEmployee.Picture Public Property FirstName As String Implements IEmployee.FirstName Public Property LastName As String Implements IEmployee.LastName Public Property Initials As String Implements IEmployee.Initials Index: ActiviteitenOpvolging/ActiviteitenOpvolging/mappers/CacheMapper.vb =================================================================== diff -u -r1735 -r1743 --- ActiviteitenOpvolging/ActiviteitenOpvolging/mappers/CacheMapper.vb (.../CacheMapper.vb) (revision 1735) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/mappers/CacheMapper.vb (.../CacheMapper.vb) (revision 1743) @@ -23,6 +23,11 @@ If Not _sqlConnection.State = ConnectionState.Open Then 'If not, open the connection. _sqlConnection.Open() + Else + 'If state is open, close and open again. + 'todo find better solution for losing connection and then re-establishing connection. + _sqlConnection.Close() + _sqlConnection.Open() End If Catch ex As Exception Throw New Exception($"Can't reach the Caché database: {vbNewLine}{ex.Message}") @@ -182,7 +187,7 @@ 'Fetch the employee if defined. Dim employeeInitials = ExtractItemFromDataReader(dr, $"Gebruiker_{i}", String.Empty) - Dim employee As IEmployee = If(employeeInitials.Equals(string.Empty), Nothing,employees.FirstOrDefault(Function(employeeToCheck) employeeToCheck.Initials.Equals(employeeInitials))) + Dim employee As IEmployee = If(employeeInitials.Equals(String.Empty), Nothing, employees.FirstOrDefault(Function(employeeToCheck) employeeToCheck.Initials.Equals(employeeInitials))) 'Set the current state based on the enum value. If the quantity is 0, the status is automatically zero. .State = ConvertEnumValueToActivityState(If(.QuantityToProduce = 0, ActivityStateEnum.Zero, ActivityStateEnumMapper.GetActivityStateFromLetter(ExtractItemFromDataReader(Of Char)(dr, $"Status_{i}"))), activity, employee) End With Index: ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/details/EmployeeDetailUserControl.Designer.vb =================================================================== diff -u -r1724 -r1743 --- ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/details/EmployeeDetailUserControl.Designer.vb (.../EmployeeDetailUserControl.Designer.vb) (revision 1724) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/details/EmployeeDetailUserControl.Designer.vb (.../EmployeeDetailUserControl.Designer.vb) (revision 1743) @@ -25,14 +25,14 @@ Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(EmployeeDetailUserControl)) Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel() Me.ActivityNameLabel = New System.Windows.Forms.Label() - Me.Label2 = New System.Windows.Forms.Label() + Me.ActivityVisualLabel = New System.Windows.Forms.Label() Me.ImagePictureBox = New System.Windows.Forms.PictureBox() Me.StartButton = New System.Windows.Forms.Button() Me.StopButton = New System.Windows.Forms.Button() Me.FinishButton = New System.Windows.Forms.Button() Me.NameLabel = New System.Windows.Forms.Label() Me.StatusLabel = New System.Windows.Forms.Label() - Me.Label1 = New System.Windows.Forms.Label() + Me.BatchVisualLabel = New System.Windows.Forms.Label() Me.BatchLabel = New System.Windows.Forms.Label() Me.RemoveEmployeeButton = New System.Windows.Forms.Button() Me.TableLayoutPanel1.SuspendLayout @@ -49,14 +49,14 @@ Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33334!)) Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33334!)) Me.TableLayoutPanel1.Controls.Add(Me.ActivityNameLabel, 1, 5) - Me.TableLayoutPanel1.Controls.Add(Me.Label2, 0, 5) + Me.TableLayoutPanel1.Controls.Add(Me.ActivityVisualLabel, 0, 5) Me.TableLayoutPanel1.Controls.Add(Me.ImagePictureBox, 2, 0) Me.TableLayoutPanel1.Controls.Add(Me.StartButton, 1, 7) Me.TableLayoutPanel1.Controls.Add(Me.StopButton, 1, 9) Me.TableLayoutPanel1.Controls.Add(Me.FinishButton, 1, 11) Me.TableLayoutPanel1.Controls.Add(Me.NameLabel, 0, 1) Me.TableLayoutPanel1.Controls.Add(Me.StatusLabel, 0, 3) - Me.TableLayoutPanel1.Controls.Add(Me.Label1, 0, 4) + Me.TableLayoutPanel1.Controls.Add(Me.BatchVisualLabel, 0, 4) Me.TableLayoutPanel1.Controls.Add(Me.BatchLabel, 1, 4) Me.TableLayoutPanel1.Controls.Add(Me.RemoveEmployeeButton, 2, 3) Me.TableLayoutPanel1.Location = New System.Drawing.Point(3, 3) @@ -90,17 +90,17 @@ Me.ActivityNameLabel.Text = "activity" Me.ActivityNameLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' - 'Label2 + 'ActivityVisualLabel ' - Me.Label2.AutoSize = true - Me.Label2.Dock = System.Windows.Forms.DockStyle.Right - Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0,Byte)) - Me.Label2.Location = New System.Drawing.Point(104, 290) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(57, 58) - Me.Label2.TabIndex = 9 - Me.Label2.Text = "Activiteit" - Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight + Me.ActivityVisualLabel.AutoSize = true + Me.ActivityVisualLabel.Dock = System.Windows.Forms.DockStyle.Right + Me.ActivityVisualLabel.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0,Byte)) + Me.ActivityVisualLabel.Location = New System.Drawing.Point(104, 290) + Me.ActivityVisualLabel.Name = "ActivityVisualLabel" + Me.ActivityVisualLabel.Size = New System.Drawing.Size(57, 58) + Me.ActivityVisualLabel.TabIndex = 9 + Me.ActivityVisualLabel.Text = "Activiteit" + Me.ActivityVisualLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'ImagePictureBox ' @@ -177,17 +177,17 @@ Me.StatusLabel.Text = "Status" Me.StatusLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft ' - 'Label1 + 'BatchVisualLabel ' - Me.Label1.AutoSize = true - Me.Label1.Dock = System.Windows.Forms.DockStyle.Right - Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0,Byte)) - Me.Label1.Location = New System.Drawing.Point(119, 232) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(42, 58) - Me.Label1.TabIndex = 8 - Me.Label1.Text = "Batch" - Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight + Me.BatchVisualLabel.AutoSize = true + Me.BatchVisualLabel.Dock = System.Windows.Forms.DockStyle.Right + Me.BatchVisualLabel.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0,Byte)) + Me.BatchVisualLabel.Location = New System.Drawing.Point(119, 232) + Me.BatchVisualLabel.Name = "BatchVisualLabel" + Me.BatchVisualLabel.Size = New System.Drawing.Size(42, 58) + Me.BatchVisualLabel.TabIndex = 8 + Me.BatchVisualLabel.Text = "Batch" + Me.BatchVisualLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'BatchLabel ' @@ -236,8 +236,8 @@ Friend WithEvents StopButton As Button Friend WithEvents NameLabel As Label Friend WithEvents StatusLabel As Label - Friend WithEvents Label1 As Label - Friend WithEvents Label2 As Label + Friend WithEvents BatchVisualLabel As Label + Friend WithEvents ActivityVisualLabel As Label Friend WithEvents BatchLabel As Label Friend WithEvents ActivityNameLabel As Label Friend WithEvents RemoveEmployeeButton As Button Index: ActiviteitenOpvolging/ActiviteitenOpvolging/ActiviteitenOpvolging.vbproj.user =================================================================== diff -u --- ActiviteitenOpvolging/ActiviteitenOpvolging/ActiviteitenOpvolging.vbproj.user (revision 0) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/ActiviteitenOpvolging.vbproj.user (revision 1743) @@ -0,0 +1,13 @@ + + + + + + + + + + en-US + false + + \ No newline at end of file Index: ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/details/EmployeeDetailUserControl.resx =================================================================== diff -u -r1724 -r1743 --- ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/details/EmployeeDetailUserControl.resx (.../EmployeeDetailUserControl.resx) (revision 1724) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/details/EmployeeDetailUserControl.resx (.../EmployeeDetailUserControl.resx) (revision 1743) @@ -121,7 +121,7 @@ iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6 - JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA3UAAAN1AHvkboVAAAAAmJL + JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA3TAAAN0wG91RxqAAAAAmJL R0QAAKqNIzIAAAAHdElNRQfjBx8NGQ0LNx6jAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE5LTA3LTMxVDEx OjI1OjEzKzAyOjAwyknErwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxOS0wNy0zMVQxMToyNToxMyswMjow MLsUfBMAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwaAABPM0lEQVR4Xu29Cfju1by/ Index: ActiviteitenOpvolging/ActiviteitenOpvolging/configs/ConfigsLoader.vb =================================================================== diff -u -r1735 -r1743 --- ActiviteitenOpvolging/ActiviteitenOpvolging/configs/ConfigsLoader.vb (.../ConfigsLoader.vb) (revision 1735) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/configs/ConfigsLoader.vb (.../ConfigsLoader.vb) (revision 1743) @@ -232,7 +232,7 @@ Throw New ConfigurationException("The amount of 'SQL queries' is not equal to the 'number of grids'.") End If 'Number of users. - If NumberOfEmployees <= 0 Then + If NumberOfEmployees < 0 Then Throw New ConfigurationException("Number of users is not defined or invalid.") End If End Sub Index: ActiviteitenOpvolging/ActiviteitenOpvolging/mappers/EmployeesDatabaseMapper.vb =================================================================== diff -u -r1724 -r1743 --- ActiviteitenOpvolging/ActiviteitenOpvolging/mappers/EmployeesDatabaseMapper.vb (.../EmployeesDatabaseMapper.vb) (revision 1724) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/mappers/EmployeesDatabaseMapper.vb (.../EmployeesDatabaseMapper.vb) (revision 1743) @@ -109,6 +109,7 @@ Dim employee As New Employee With employee .PersonelNumber = ExtractItemFromDataReader(Of Integer)(dr, "PersNr", True) + .Picture = ExtractItemFromDataReader(Of String)(dr, "Foto", True, String.Empty) .FirstName = ExtractItemFromDataReader(Of String)(dr, "Voornaam", False, String.Empty) .LastName = ExtractItemFromDataReader(Of String)(dr, "Achternaam", False, String.Empty) .Initials = ExtractItemFromDataReader(Of String)(dr, "Initialen", True) Index: ActiviteitenOpvolging/ActiviteitenOpvolging/domain/controllers/DomainController.vb =================================================================== diff -u -r1736 -r1743 --- ActiviteitenOpvolging/ActiviteitenOpvolging/domain/controllers/DomainController.vb (.../DomainController.vb) (revision 1736) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/domain/controllers/DomainController.vb (.../DomainController.vb) (revision 1743) @@ -63,16 +63,28 @@ Return _workItemManager.GiveWorkItems(workPostIndex, _employeeManager.Employees.ToList()) End Function - Public Sub StartActivity(activity As IActivity, employee As IEmployee) Implements IDomainController.StartActivity + Public Sub StartActivity(activity As IActivity, employeeNumber As Integer) Implements IDomainController.StartActivity + Dim employee = _employeeManager.GetSelectedEmployee(employeeNumber) + 'Employee can't be nothing. + If IsNothing(employee) Then Throw New Exception($"No employee found for employee number: {employeeNumber}.") + 'Finish the activity. _workItemManager.StartActivity(activity, employee) End Sub - Public Sub FinishActivity(activity As IActivity) Implements IDomainController.FinishActivity - _workItemManager.FinishActivity(activity) + Public Sub FinishActivity(employeeNumber As Integer) Implements IDomainController.FinishActivity + Dim employee = _employeeManager.GetSelectedEmployee(employeeNumber) + 'Employee can't be nothing. + If IsNothing(employee) Then Throw New Exception($"No employee found for employee number: {employeeNumber}.") + 'Finish the activity. + _workItemManager.FinishActivity(employee.CurrentActivity) End Sub - Public Sub StopActivity(activity As IActivity) Implements IDomainController.StopActivity - _workItemManager.StopActivity(activity) + Public Sub StopActivity(employeeNumber As Integer) Implements IDomainController.StopActivity + Dim employee = _employeeManager.GetSelectedEmployee(employeeNumber) + 'Employee can't be nothing. + If IsNothing(employee) Then Throw New Exception($"No employee found for employee number: {employeeNumber}.") + 'Stop the activity. + _workItemManager.StopActivity(employee.CurrentActivity) End Sub #End Region Index: ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/implementations/activity state/ActivityStartedState.vb =================================================================== diff -u -r1737 -r1743 --- ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/implementations/activity state/ActivityStartedState.vb (.../ActivityStartedState.vb) (revision 1737) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/implementations/activity state/ActivityStartedState.vb (.../ActivityStartedState.vb) (revision 1743) @@ -3,12 +3,18 @@ 'Not from other state. Public Sub New(activity As IActivity, employee As IEmployee) + 'Set the current activity of the employee, only happens in this state. + employee.CurrentActivity = Activity + Me.Activity = activity Me.CurrentEmployee = employee End Sub 'From other state. Public Sub New(state As ActivityState, employee As IEmployee) + 'Set the current activity of the employee, only happens in this state. + employee.CurrentActivity = Activity + Activity = state.Activity Me.CurrentEmployee = employee End Sub Index: ActiviteitenOpvolging/ActiviteitenOpvolging/ActiviteitenOpvolgingForm.vb =================================================================== diff -u -r1736 -r1743 --- ActiviteitenOpvolging/ActiviteitenOpvolging/ActiviteitenOpvolgingForm.vb (.../ActiviteitenOpvolgingForm.vb) (revision 1736) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/ActiviteitenOpvolgingForm.vb (.../ActiviteitenOpvolgingForm.vb) (revision 1743) @@ -124,6 +124,8 @@ ''' Private Function RefreshUserGridsData() As Boolean Try + 'Reset selected activity because none will be selected after refresh. + _selectedActivity = Nothing 'Refresh every user control. Register whether or not all refreshes were successful. Return _datagridViewUserControls.All(Function(userControl) userControl.RefreshData()) Catch ex As Exception @@ -181,34 +183,40 @@ _domainController.SelectEmployee(employeeIndex, employee) 'Send message that the selected employee changed to all user controls. _employeeUserControls.ForEach(Sub(employeeUserControl) employeeUserControl.SelectedEmployeeChanged()) - 'Refresh the grids, so one can recolor. - RefreshUserGridsData() + 'Refresh all the grids, so data grid can recolor. This removes the selection, so the employee controls also need to be updated. + RefreshAllData() End Sub ''' Public Sub DeselectEmployee(employeeIndex As Integer) Implements IEmployeesMainForm.DeselectEmployee _domainController.DeselectEmployee(employeeIndex) 'Send message that the selected employee changed to all user controls. _employeeUserControls.ForEach(Sub(employeeUserControl) employeeUserControl.SelectedEmployeeChanged()) - 'Refresh the grids, so one can recolor. - RefreshUserGridsData() + 'Refresh the grids, so one can recolor. This removes the selection, so the employee controls also need to be updated. + RefreshAllData() End Sub ''' Public Function GetSelectedEmployee(employeeIndex As Integer) As IEmployee Implements IEmployeesMainForm.GetSelectedEmployee Return _domainController.GetSelectedEmployee(employeeIndex) End Function - Public Sub StartActivity(employee As IEmployee) Implements IEmployeesMainForm.StartActivity - _domainController.StartActivity(_selectedActivity, employee) + Public Sub StartActivity(employeeIndex As Integer) Implements IEmployeesMainForm.StartActivity + _domainController.StartActivity(_selectedActivity, employeeIndex) + 'Refresh all the data. + RefreshAllData() End Sub - Public Sub FinishActivity() Implements IEmployeesMainForm.FinishActivity - _domainController.FinishActivity(_selectedActivity) + Public Sub FinishActivity(employeeIndex As Integer) Implements IEmployeesMainForm.FinishActivity + _domainController.FinishActivity(employeeIndex) + 'Refresh all the data. + RefreshAllData() End Sub - Public Sub StopActivity() Implements IEmployeesMainForm.StopActivity - _domainController.StopActivity(_selectedActivity) + Public Sub StopActivity(employeeIndex As Integer) Implements IEmployeesMainForm.StopActivity + _domainController.StopActivity(employeeIndex) + 'Refresh all the data. + RefreshAllData() End Sub #End Region Index: ActiviteitenOpvolging/ActiviteitenOpvolging/screens/DataGridViewUserControl.vb =================================================================== diff -u -r1735 -r1743 --- ActiviteitenOpvolging/ActiviteitenOpvolging/screens/DataGridViewUserControl.vb (.../DataGridViewUserControl.vb) (revision 1735) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/screens/DataGridViewUserControl.vb (.../DataGridViewUserControl.vb) (revision 1743) @@ -38,6 +38,8 @@ ''' Public Function RefreshData() As Boolean Implements IDataGridUserControl.RefreshData Try + 'Ignore selection changed event. + _skipSelectionChanged = true 'Call helper method. LoadGrid() 'Remove selection. Index: ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/details/EmployeeDetailUserControl.vb =================================================================== diff -u -r1736 -r1743 --- ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/details/EmployeeDetailUserControl.vb (.../EmployeeDetailUserControl.vb) (revision 1736) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/details/EmployeeDetailUserControl.vb (.../EmployeeDetailUserControl.vb) (revision 1743) @@ -1,4 +1,5 @@ -Imports ActiviteitenOpvolging.configs +Imports System.Windows.Navigation +Imports ActiviteitenOpvolging.configs Public Class EmployeeDetailUserControl Implements IEmployeeDetailUserControl @@ -60,16 +61,32 @@ 'Fetch the employee. Dim employee = _parentUserControl.FetchEmployee() + 'If employee is nothing, do nothing. + if employee is Nothing then Return + 'Show all information on screen. NameLabel.Text = $"{employee.FirstName} {employee.LastName}" + Try + ImagePictureBox.Load(employee.Picture) + Catch ex As Exception + 'Default image. + ImagePictureBox.Image = My.Resources.user + End Try + 'If activity is Nothing, empty the labels. If IsNothing(employee.CurrentActivity) Then - 'Nothing, empty labels. + 'Nothing, empty or hide labels. + BatchVisualLabel.Visible = False + ActivityVisualLabel.Visible = False StatusLabel.Text = String.Empty BatchLabel.Text = String.Empty ActivityNameLabel.Text = String.Empty Else + 'Show visual labels. + BatchVisualLabel.Visible = True + ActivityVisualLabel.Visible = True + Dim activity = employee.CurrentActivity 'Set activity status according to state. Select Case activity.Status Index: ActiviteitenOpvolging/ActiviteitenOpvolging/ActiviteitenOpvolging.vbproj =================================================================== diff -u -r1731 -r1743 --- ActiviteitenOpvolging/ActiviteitenOpvolging/ActiviteitenOpvolging.vbproj (.../ActiviteitenOpvolging.vbproj) (revision 1731) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/ActiviteitenOpvolging.vbproj (.../ActiviteitenOpvolging.vbproj) (revision 1743) @@ -14,6 +14,21 @@ v4.7.2 true true + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true AnyCPU @@ -203,5 +218,17 @@ + + + False + Microsoft .NET Framework 4.7.2 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + \ No newline at end of file Index: ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/EmployeeUserControl.vb =================================================================== diff -u -r1736 -r1743 --- ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/EmployeeUserControl.vb (.../EmployeeUserControl.vb) (revision 1736) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/EmployeeUserControl.vb (.../EmployeeUserControl.vb) (revision 1743) @@ -155,17 +155,17 @@ ''' Public Sub StartActivity() Implements IEmployeeDetailParentUserControl.StartActivity 'Start activity with correct employee. - _parentForm.StartActivity(_parentForm.GetSelectedEmployee(EmployeeIndex)) + _parentForm.StartActivity(EmployeeIndex) End Sub ''' Public Sub FinishActivity() Implements IEmployeeDetailParentUserControl.FinishActivity - _parentForm.FinishActivity() + _parentForm.FinishActivity(EmployeeIndex) End Sub ''' Public Sub StopActivity() Implements IEmployeeDetailParentUserControl.StopActivity - _parentForm.StopActivity() + _parentForm.StopActivity(EmployeeIndex) End Sub #End Region