private void viewPayslipButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (payrollListBox.SelectedIndex != -1)
                {
                    int payslipId = Convert.ToInt32(payrollListBox.SelectedItem.ToString().Split('.')[0]);
                    PayrollControllerInterface payrollController = new PayrollController();
                    Payslip payslip = payrollController.fetchPayslipById(payslipId);

                    EmployeeControllerInterface employeeController = new EmployeeController();
                    payslip.employee = employeeController.fetchEmployeeById(payslip.employee.id);

                    FormControllerInterface formController = new FormController();
                    formController.showUserPayroll(this, payslip);
                }
                else
                {
                    showErrorMessage("Please select a record to view.");
                }
            }
            catch (FormatException ex)
            {
                Console.WriteLine("No item selected: " + ex.Message);
            }
        }