Module Module1
    ' THIS WAS CREATED BY Michael Angelo Ico
    ' 3IT-1M @ ARAULLO UNIVERSITY
    Public conn As New System.Data.OleDb.OleDbConnection
    Public strConnString As String

    Public Sub connectDatabase()
        strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\dbOrder.mdb"
        conn.ConnectionString = strConnString
        conn.Open()
    End Sub
    Public Sub DisconnectDatabase()
        If conn.State = ConnectionState.Open Then
            conn.Close()
        Else
            'continue
        End If


    End Sub
    Public Function getDate() As String
        Return Format(Date.Today, "Short Date")
    End Function
    Public Function getTime() As String
        Return Format(Date.Now, "Long Time")
    End Function
    Public Function IsValidTextbox(ByVal TxtBox As TextBox) As Boolean
        If IsNumeric(TxtBox.Text) Then
            TxtBox.Text = Format(CDbl(TxtBox.Text), "0.00")
            IsValidTextbox = True
        Else
            'MsgBox("Please Enter Correct Information", MsgBoxStyle.OkOnly)
            TxtBox.Focus()
            TxtBox.SelectAll()
            IsValidTextbox = False
        End If
    End Function
    Public Function IsValidTextboxForNumbers(ByVal TxtBox As TextBox) As Boolean
        If IsNumeric(TxtBox.Text) Then
            TxtBox.Text = Format(CDbl(TxtBox.Text), "0")
            IsValidTextboxForNumbers = True
        Else
            'MsgBox("Please Enter Correct Information", MsgBoxStyle.OkOnly)
            TxtBox.Focus()
            TxtBox.Text = ""
            IsValidTextboxForNumbers = False
        End If
    End Function
    Public Sub ShowError()
        MsgBox("Error!", MsgBoxStyle.Information + MsgBoxStyle.OkOnly, "WARNING")
    End Sub
    Public Sub ShowGranted()
        MsgBox("Access Granted!", MsgBoxStyle.Information + MsgBoxStyle.OkOnly, "SUCCESS")
    End Sub
    Public Sub ShowErrorDuplicate()
        MsgBox("Record Exist!", MsgBoxStyle.Information + MsgBoxStyle.OkOnly, "ERROR")
    End Sub
    Public Sub ChangePassword()
        MsgBox("Password Change!", MsgBoxStyle.Information + MsgBoxStyle.OkOnly, "SUCCESS")
    End Sub
    Public Sub PasswordDontMatch()
        MsgBox("Password Dont Match!", MsgBoxStyle.Information + MsgBoxStyle.OkOnly, "SUCCESS")
    End Sub
End Module
