Simtoon
2010-08-20 07:29:05
Putting it here because i dont want my teacher to find it
Just wanted to know if i can change anything? To make it better its a atm system
Just wanted to know if i can change anything? To make it better its a atm system
Private Sub btn_Enter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Enter.Click
Dim txtboxString = txtbox_cardacc.Text
btnClick += 1
If accFound = False Then
If Attemptss >= 3 Then
MsgBox("The account you have been trying to access does not exist please visit your nearest branch to rectify the problem")
txtbox_cardacc.Clear()
btnClick = 0
Exit Sub
End If
If Len(txtboxString) = 9 And Attemptss <= 3 Then
For i = 0 To maxNumCustomers - 1
If txtboxString = customerArray(i).cardNum Or txtboxString = customerArray(i).accNum Then
whatArray = i
MsgBox("True")
whatArray = i
accFound = True
txtbox_cardacc.UseSystemPasswordChar = True
Exit For
End If
Next i
If accFound = False Then
MsgBox("Please Enter a Valid Account Number or Card Number")
Attemptss += 1
btnClick = 0
End If
Else
MsgBox("Please Enter 9 Characters")
Attemptss += 1
btnClick = 0
End If
End If
Dim pinString = txtbox_cardacc.Text
txtbox_cardacc.Clear()
If accFound = True And btnClick >= 2 Then
If pinatm >= 3 Then
MsgBox("Your account will be disabled, please visit their nearest branch to rectify this problem.")
customerArray(whatArray).accDisabled = True
btnClick = 0
accFound = False
pinatm = 0
txtbox_cardacc.UseSystemPasswordChar = False
Exit Sub
End If
If Len(pinString) >= 4 And Len(pinString) < 6 Then
If pinString = customerArray(whatArray).pinNum Then
If customerArray(whatArray).accDisabled = True Then
MsgBox("Your account is disabled")
txtbox_cardacc.UseSystemPasswordChar = False
btnClick = 0
Exit Sub
End If
MsgBox("Both CardNum and AccNum and Pin Correct" & " " & CStr(customerArray(whatArray).accNum) & " " & customerArray(whatArray).cardNum & " " & CStr(customerArray(whatArray).pinNum))
txtbox_cardacc.UseSystemPasswordChar = False
btnClick = 0
Exit Sub
Else
MsgBox("NO")
pinatm += 1
End If
Else
MsgBox("Please Enter 4 - 6 characters")
pinatm += 1
End If
End If
End Sub