Index: ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/details/EmployeeDetailUserControl.Designer.vb =================================================================== diff -u -r1721 -r1724 --- ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/details/EmployeeDetailUserControl.Designer.vb (.../EmployeeDetailUserControl.Designer.vb) (revision 1721) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/details/EmployeeDetailUserControl.Designer.vb (.../EmployeeDetailUserControl.Designer.vb) (revision 1724) @@ -24,7 +24,7 @@ Private Sub InitializeComponent() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(EmployeeDetailUserControl)) Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel() - Me.ActivityLabel = New System.Windows.Forms.Label() + Me.ActivityNameLabel = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.ImagePictureBox = New System.Windows.Forms.PictureBox() Me.StartButton = New System.Windows.Forms.Button() @@ -48,7 +48,7 @@ Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33332!)) 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.ActivityLabel, 1, 5) + Me.TableLayoutPanel1.Controls.Add(Me.ActivityNameLabel, 1, 5) Me.TableLayoutPanel1.Controls.Add(Me.Label2, 0, 5) Me.TableLayoutPanel1.Controls.Add(Me.ImagePictureBox, 2, 0) Me.TableLayoutPanel1.Controls.Add(Me.StartButton, 1, 7) @@ -78,17 +78,17 @@ Me.TableLayoutPanel1.Size = New System.Drawing.Size(494, 594) Me.TableLayoutPanel1.TabIndex = 0 ' - 'ActivityLabel + 'ActivityNameLabel ' - Me.ActivityLabel.AutoSize = true - Me.ActivityLabel.Dock = System.Windows.Forms.DockStyle.Fill - Me.ActivityLabel.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0,Byte)) - Me.ActivityLabel.Location = New System.Drawing.Point(167, 290) - Me.ActivityLabel.Name = "ActivityLabel" - Me.ActivityLabel.Size = New System.Drawing.Size(158, 58) - Me.ActivityLabel.TabIndex = 11 - Me.ActivityLabel.Text = "activity" - Me.ActivityLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.ActivityNameLabel.AutoSize = true + Me.ActivityNameLabel.Dock = System.Windows.Forms.DockStyle.Fill + Me.ActivityNameLabel.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0,Byte)) + Me.ActivityNameLabel.Location = New System.Drawing.Point(167, 290) + Me.ActivityNameLabel.Name = "ActivityNameLabel" + Me.ActivityNameLabel.Size = New System.Drawing.Size(158, 58) + Me.ActivityNameLabel.TabIndex = 11 + Me.ActivityNameLabel.Text = "activity" + Me.ActivityNameLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'Label2 ' @@ -239,6 +239,6 @@ Friend WithEvents Label1 As Label Friend WithEvents Label2 As Label Friend WithEvents BatchLabel As Label - Friend WithEvents ActivityLabel As Label + Friend WithEvents ActivityNameLabel As Label Friend WithEvents RemoveEmployeeButton As Button End Class Index: ActiviteitenOpvolging/ActiviteitenOpvolging/mappers/EmployeesDatabaseMapper.vb =================================================================== diff -u -r1718 -r1724 --- ActiviteitenOpvolging/ActiviteitenOpvolging/mappers/EmployeesDatabaseMapper.vb (.../EmployeesDatabaseMapper.vb) (revision 1718) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/mappers/EmployeesDatabaseMapper.vb (.../EmployeesDatabaseMapper.vb) (revision 1724) @@ -111,7 +111,7 @@ .PersonelNumber = ExtractItemFromDataReader(Of Integer)(dr, "PersNr", True) .FirstName = ExtractItemFromDataReader(Of String)(dr, "Voornaam", False, String.Empty) .LastName = ExtractItemFromDataReader(Of String)(dr, "Achternaam", False, String.Empty) - .Initials = ExtractItemFromDataReader(Of String)(dr, "Achternaam", True) + .Initials = ExtractItemFromDataReader(Of String)(dr, "Initialen", True) End With 'Add new employee to list. Index: ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/implementations/Employee.vb =================================================================== diff -u -r1718 -r1724 --- ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/implementations/Employee.vb (.../Employee.vb) (revision 1718) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/implementations/Employee.vb (.../Employee.vb) (revision 1724) @@ -7,6 +7,7 @@ Public Property FirstName As String Implements IEmployee.FirstName Public Property LastName As String Implements IEmployee.LastName Public Property Initials As String Implements IEmployee.Initials + Public Property currentActivity As IActivity Implements IEmployee.currentActivity Public Overrides Function Equals(obj As Object) As Boolean Implements IEmployee.Equals If Not TypeOf obj Is IEmployee Then Index: ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/IEmployee.vb =================================================================== diff -u -r1718 -r1724 --- ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/IEmployee.vb (.../IEmployee.vb) (revision 1718) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/IEmployee.vb (.../IEmployee.vb) (revision 1724) @@ -5,5 +5,7 @@ Property LastName As String Property Initials As String + Property currentActivity As IActivity + Function Equals(obj As Object) As Boolean End Interface Index: ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/details/EmployeeDetailUserControl.resx =================================================================== diff -u -r1722 -r1724 --- ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/details/EmployeeDetailUserControl.resx (.../EmployeeDetailUserControl.resx) (revision 1722) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/details/EmployeeDetailUserControl.resx (.../EmployeeDetailUserControl.resx) (revision 1724) @@ -121,7 +121,7 @@ iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6 - JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA3VAAAN1QE91ljxAAAAAmJL + JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA3UAAAN1AHvkboVAAAAAmJL R0QAAKqNIzIAAAAHdElNRQfjBx8NGQ0LNx6jAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE5LTA3LTMxVDEx OjI1OjEzKzAyOjAwyknErwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxOS0wNy0zMVQxMToyNToxMyswMjow MLsUfBMAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwaAABPM0lEQVR4Xu29Cfju1by/ Index: ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/picker/EmployeePickerUserControl.vb =================================================================== diff -u -r1717 -r1724 --- ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/picker/EmployeePickerUserControl.vb (.../EmployeePickerUserControl.vb) (revision 1717) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/picker/EmployeePickerUserControl.vb (.../EmployeePickerUserControl.vb) (revision 1724) @@ -49,14 +49,14 @@ ''' Private Sub LoadData() 'Fetch the employees. - _employees = _parentUserControl.GetAllEmployees().ToList() + _employees = _parentUserControl.GetAllEmployees().OrderBy( Function(employee1) employee1.FirstName).ToList() 'Check if data is correct. If _employees Is Nothing OrElse _employees.Count = 0 Then 'No items in collection _employees = Nothing End If 'Fill the combobox with names. - EmployeesComboBox.DataSource = _employees.Select(Function(employee) $"{employee.FirstName} {employee.LastName}").ToArray() + EmployeesComboBox.DataSource = _employees.Select(Function(employee) $"{employee.FirstName} {employee.LastName} ({employee.Initials})").ToArray() End Sub Private Sub EmployeesComboBox_SelectionChangeCommitted(sender As Object, e As EventArgs) Handles EmployeesComboBox.SelectionChangeCommitted Index: ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/details/EmployeeDetailUserControl.vb =================================================================== diff -u -r1723 -r1724 --- ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/details/EmployeeDetailUserControl.vb (.../EmployeeDetailUserControl.vb) (revision 1723) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/screens/employee/details/EmployeeDetailUserControl.vb (.../EmployeeDetailUserControl.vb) (revision 1724) @@ -58,10 +58,30 @@ ''' Private Sub LoadEmployee() 'Fetch the employee. - dim employee = _parentUserControl.FetchEmployee() + Dim employee = _parentUserControl.FetchEmployee() 'Show all information on screen. - NameLabel.Text = $"{Employee.FirstName} {Employee.LastName}" + NameLabel.Text = $"{employee.FirstName} {employee.LastName}" + 'If activity is Nothing, empty the labels. + If IsNothing(employee.currentActivity) Then + 'Nothing, empty labels. + StatusLabel.Text = String.Empty + BatchLabel.Text = String.Empty + ActivityNameLabel.Text = String.Empty + Else + Dim activity = employee.currentActivity + 'Set activity status according to state. + Select Case activity.Status + Case ActivityStateEnum.Started + StatusLabel.Text = "Gestart" + Case ActivityStateEnum.Finished + StatusLabel.Text = "Afgewerkt" + Case ActivityStateEnum.Pauzed + StatusLabel.Text = "Onderbroken" + Case ActivityStateEnum.Defaulted + StatusLabel.Text = "Beschikbaar" + End Select + End If 'Todo activity status 'todo enable status of buttons. End Sub