private void btnAddUser_Click(object sender, EventArgs e) { AppUser u = new AppUser(); u.fullname = textBox1.Text; u.username = textBox2.Text; u.userType = checkBox1.Checked; try { AppUserDAO.addAppUser(u); MessageBox.Show("User added successfully.", "HUGO", MessageBoxButtons.OK, MessageBoxIcon.Information); btnClearUser_Click(sender, e); updateAdminControls(); } catch (Exception exception) { MessageBox.Show("Error: " + exception.Message, "Error dialog", MessageBoxButtons.OK, MessageBoxIcon.Error); } }