forked from omkargokhale05/Gym-Management-System
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimp.txt
More file actions
66 lines (55 loc) · 1.91 KB
/
imp.txt
File metadata and controls
66 lines (55 loc) · 1.91 KB
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
59
60
61
62
63
64
65
66
Validations--------------------------------------------------------------------------------------------------------
#Region "ContactsNoValidation"
Public Function numval(ByVal val As Integer) As Byte
If val Like "8" Then
numval = val
Exit Function
End If
If Not Chr(val) Like "[0-9]" Then
val = 0
Else
numval = val
End If
End Function
#End Region
#Region "CheckEmail"
Public Function EmailAddressCheck(ByVal emailAddress As String) As Boolean
Dim pattern As String = "^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$"
Dim emailAddressMatch As Match = Regex.Match(emailAddress, pattern)
If emailAddressMatch.Success Then
EmailAddressCheck = True
Else
EmailAddressCheck = False
End If
End Function
#End Region
#Region "CheckName"
Public Function TextOnly(ByVal val As Integer) As Byte
If val Like "8" Then
TextOnly = val
Exit Function
End If
If Not Chr(val) Like "[a-zA-Z. ' ' ]" Then
val = 0
Else
TextOnly = val
End If
End Function
-------------------------------------------------------------------------------------------------------------------
BInding to any Function
Public Function BindCombo(ByVal Query As String, ByVal cmb As ComboBox)
Try
Dim ds As New DataSet
Con = objDb.SetConnection()
Con.Open()
da = New SqlDataAdapter(Query, Con)
da.Fill(ds)
cmb.DataSource = ds.Tables(0)
cmb.DisplayMember = ds.Tables(0).Columns(1).ToString()
cmb.ValueMember = ds.Tables(0).Columns(0).ToString()
Con.Close()
Catch ex As Exception
'MessageBox.Show(ex.Message)
End Try
Return ds
End Function