]> fbox.kageds.com Git - NEATEST.git/blob - NEA/mainwindow.xaml.vb
3rd commit
[NEATEST.git] / NEA / mainwindow.xaml.vb
1 
2 Class MainWindow
3 Private Sub BtnLogIn_Click(sender As Object, e As RoutedEventArgs) Handles btnLogIn.Click
4 Dim ds As New NEADataSet
5 Dim dr As System.Data.DataRow
6 Dim da As New NEADataSetTableAdapters.UsersTableAdapter
7 Dim dt As System.Data.DataTable
8 dt = ds.Tables("Users")
9 da.fill(dt)
10 For Each dr In dt.Rows
11 If String.Compare(dr("Username"), txtUserName.Text) = 0 And String.Compare(dr("Password"), txtPassword.Text) = 0 Then
12 If chkRememberMe.IsChecked = True Then
13 Dim file As System.IO.StreamWriter
14 file = My.Computer.FileSystem.OpenTextFileWriter("CheckedBox.txt", True)
15 file.WriteLine("Checked")
16 file.Close()
17 Dim A = New Store()
18 A.Show()
19 Me.Close()
20 Else
21 Dim A = New Store()
22 A.Show()
23 Me.Close()
24 End If
25 GoTo LineBreak
26 End If
27 Next
28 MsgBox("Your username or password is incorrect!", vbExclamation)
29 LineBreak:
30 ds.Dispose()
31 End Sub
32
33 Private Sub BtnSignUp_Click(sender As Object, e As RoutedEventArgs) Handles btnSignUp.Click
34 Dim A = New Signup()
35 A.show()
36 Me.Close()
37 End Sub
38
39 ' Private Sub txtUserName_MouseEnter(sender As Object, e As MouseEventArgs) Handles txtUserName.MouseEnter
40 ' If txtUserName.Text = "Username" Then
41 ' txtUserName.Text = ""
42 ' End If
43 'End Sub
44 '
45 ' Private Sub txtUserName_MouseLeave(sender As Object, e As MouseEventArgs) Handles txtUserName.MouseLeave
46 ' If txtUserName.Text = "" Then
47 ' txtUserName.Text = "Username"
48 'End If
49 'End Sub
50
51 ' Private Sub txtPassword_MouseEnter(sender As Object, e As MouseEventArgs) Handles txtPassword.MouseEnter
52 ' If txtPassword.Text = "Password" Then
53 ' txtPassword.Text = ""
54 ' End If
55 'End Sub
56
57 ' Private Sub txtPassword_MouseLeave(sender As Object, e As MouseEventArgs) Handles txtPassword.MouseLeave
58 ' If txtPassword.Text = "" Then
59 ' txtPassword.Text = "Password"
60 'End If
61 ' End Sub
62 End Class