Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class LogIn
- Private SQL As New SQLControl
- Private Sub LogIn_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- Me.KeyPreview = True
- If SQL.hasConnection = True Then
- ToolStripStatusLabel1.Text = "Kontektovan."
- Else
- Me.Close()
- End If
- End Sub
- Private Function logincheck() As Boolean
- If SQL.SQLDS IsNot Nothing Then
- SQL.SQLDS.Clear()
- End If
- SQL.runQuery("select count(username) as userCount from administrator where username='" &
- userText.Text & "' and password='" & passText.Text & "' collate SQL_Latin1_General_CP1_CS_AS")
- If SQL.SQLDS.Tables(0).Rows(0).Item("userCount") = 1 Then
- Return True
- End If
- MsgBox("Neispravni podaci", MsgBoxStyle.Critical, "Neuspješno logovanje")
- Return False
- End Function
- Private Sub loginBtn_Click(sender As Object, e As EventArgs) Handles loginBtn.Click
- If logincheck() = True Then
- Main.Show()
- Me.Hide()
- End If
- End Sub
- Private Sub loginBtn_KeyPress(sender As Object, e As KeyPressEventArgs) Handles Me.KeyPress
- If e.KeyChar = "Enter" Then
- MsgBox("B key was pressed")
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement