-
Notifications
You must be signed in to change notification settings - Fork 0
/
VibeChangePin.vb
58 lines (43 loc) · 1.74 KB
/
VibeChangePin.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Public Class VibeChangePin
'--------------------------------[Variables]--------------------------------
Private ServerMSG As String
Private ID As String
Private Pin As String
'--------------------------------[Buttons]--------------------------------
Private Sub TimeForANewPin() Handles OKBTN.Click
Pin = NewPinTextBox.Text
ID = VibeLogin.LogonID.Text
If Not IsValidPin(Pin) Then
MsgBox("Invalid Pin specified", MsgBoxStyle.Critical)
Exit Sub
End If
Enabled = False
RefreshNotice.Show()
BackgroundWorker1.RunWorkerAsync()
End Sub
Private Sub Nevermind() Handles CancelBTN.Click
Close()
End Sub
'--------------------------------[Background Worker]--------------------------------
Private Sub SendNewPin(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
ServerMSG = ChangePin(ID, Pin)
End Sub
Private Sub TheResults() Handles BackgroundWorker1.RunWorkerCompleted
Enabled = True
RefreshNotice.Close()
Select Case ServerMSG
Case "1"
MsgBox("Improperly Coded Change Pin Request", vbInformation, "Change Pin Notice")
Case "2"
MsgBox("Could not complete pin change", vbInformation, "Change Pin Notice")
Case "S"
MsgBox("Pin Changed Successfully", vbInformation, "Change Pin Notice")
Enabled = True
Close()
End Select
End Sub
'--------------------------------[Other Functions]--------------------------------
Private Function IsValidPin(Pin As String) As Boolean
Return Pin.Count = 4
End Function
End Class