/// <summary>
        /// Deletes selected user's data from database
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDeleteUser_Click(object sender, EventArgs e)
        {
            if (cboDeleteUser.SelectedIndex < 0)  // if no user is selected
            {
                MessageBox.Show("You must select a user.");
                return;
            }

            User user = cboDeleteUser.SelectedItem as User;

            DialogResult answer =
                MessageBox.Show($"Are you sure you want to delete {user.Username}?",
                                "Delete User?",
                                MessageBoxButtons.YesNo,
                                MessageBoxIcon.Exclamation);

            if (answer == DialogResult.Yes)
            {
                if (UserDB.DeleteUser(user))
                {
                    MessageBox.Show("User account deleted successfully.");
                    UserFormHelper.PopulateUserList(cboDeleteUser);
                }
                else
                {
                    MessageBox.Show("Unable to delete user at this time.");
                }
            }
            cboDeleteUser.Text = "";
        }
        /// <summary>
        /// Updates selected user's data in database
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (cboUsers.SelectedIndex < 0)  // if no user is selected
            {
                MessageBox.Show("You must select a user.");
                return;
            }

            User selectedUser = cboUsers.SelectedItem as User;

            User updatedUser = new User()
            {
                Username    = txtEditUsername.Text,
                Password    = txtEditPassword.Text,
                Email       = txtEditEmail.Text,
                DateOfBirth = dtpEditDOB.Value
            };

            if (UserDB.EditUser(selectedUser, updatedUser))
            {
                MessageBox.Show("User account updated successfully.");
                UserFormHelper.PopulateUserList(cboUsers);
            }
            else
            {
                MessageBox.Show("Unable to update user at this time.");
            }
            cboUsers.Text        = "";
            txtEditUsername.Text = "";
            txtEditPassword.Text = "";
            txtEditEmail.Text    = "";
            dtpEditDOB.Value     = new DateTime(1960, 1, 1);
        }
 private void frmDeleteUser_Load(object sender, EventArgs e)
 {
     UserFormHelper.PopulateUserList(cboDeleteUser);
 }
 private void frmEditUser_Load(object sender, EventArgs e)
 {
     UserFormHelper.PopulateUserList(cboUsers);
 }