public DashboardForm(LoginForm login, User user) { this.login = login; this.user = user; InitializeComponent(); username.Text = user.username; PayrollControllerInterface payrollController = new PayrollController(); List <Payroll> payrolls = payrollController.fetchUserPayrolls(user); loadPayrollList(payrolls); }
private void loadPayrollList() { PayrollControllerInterface payrollController = new PayrollController(); List <Payslip> payroll = payrollController.fetchUserPayrolls(user); userPayrollListBox.Items.Clear(); foreach (Payslip payslip in payroll) { userPayrollListBox.Items.Add(payslip.id + ".)" + payslip.startDatePeriod.ToString("MM/dd/yyyy") + "-" + payslip.endDatePeriod.ToString("MM/dd/yyyy")); } }