Public Class frmManageUsers
    Private Sub frmManageUsers_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        sql = "SELECT ACCOUNT_ID,`ACCOUNT_NAME` as 'Full Name', `ACCOUNT_USERNAME` as 'Username', `ACCOUNT_TYPE` as 'Type'FROM `useraccounts`"
        fillGrid(sql, dtgList)
        dtgList.Columns(0).Visible = False
    End Sub

    Private Sub btnDelete_Click(sender As Object, e As EventArgs) Handles btnDelete.Click
        sql = "DELETE FROM useraccounts WHERE  ACCOUNT_ID='" & dtgList.CurrentRow.Cells(0).Value & "'"
        messageTrue = "User has beeen deleted."
        messageFalse = "Failed to delete the user."
        CreateUpdateDeleteAllMessage(sql, messageTrue, messageTrue)
        Call frmManageUsers_Load(sender, e)
    End Sub

    Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
        sql = "SELECT ACCOUNT_ID,`ACCOUNT_NAME` as 'Full Name', `ACCOUNT_USERNAME` as 'Username', `ACCOUNT_TYPE` as 'Type'FROM `useraccounts` WHERE ACCOUNT_USERNAME LIKE '%" & TextBox1.Text & "%'"
        fillGrid(sql, dtgList)
        dtgList.Columns(0).Visible = False
    End Sub

    Private Sub btnEdit_Click(sender As Object, e As EventArgs) Handles btnEdit.Click

        Dim f As frmAddEditUsers = New frmAddEditUsers()
        f.FormBorderStyle = FormBorderStyle.None
        f.StartPosition = FormStartPosition.CenterScreen
        f.lblId.Text = dtgList.CurrentRow.Cells(0).Value
        f.ShowDialog()

    End Sub

    Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click
        Dim f As frmAddEditUsers = New frmAddEditUsers()
        f.FormBorderStyle = FormBorderStyle.None
        f.StartPosition = FormStartPosition.CenterScreen
        f.lblId.Text = ""
        f.ShowDialog()

    End Sub
End Class